Hi, On Mon, May 09, 2011 at 03:20:51PM +0200, Gian Piero Carrubba wrote: > This page seems suggesting something like (sorry, cannot produce a > real diff just now): > > use Scalar::Util 'reftype'; > ... > if ( reftype($OPT{$optname}) ne 'ARRAY' ) { There's no need for Scalar::Util::reftype here. What's wrong with plain ref()? Sebastian diff -ur maildirsync-1.1.orig/maildirsync.pl maildirsync-1.1/maildirsync.pl --- maildirsync-1.1.orig/maildirsync.pl 2011-07-04 08:25:45.117044233 +0200 +++ maildirsync-1.1/maildirsync.pl 2011-07-04 08:28:37.425898668 +0200 @@ -10,7 +10,6 @@ use IO::Handle; use IPC::Open2; use Fcntl qw(SEEK_SET); -use UNIVERSAL qw(isa); use strict; require 5.006; @@ -93,7 +92,7 @@ exit_with_error("Invalid parameter value: $optname: $value") if $value !~ /^$regex$/; } verbose 4 => "add option $optname = ".($value || ""); - if (!isa($OPT{$optname}, 'ARRAY')) { + if (!(ref($OPT{$optname}) eq 'ARRAY')) { $OPT{$optname} = $value; } else { push @{$OPT{$optname}}, $value;
Attachment:
signature.asc
Description: Digital signature