Some simple code that is similar to other code I've written and used is returning something I don't understand.
I've used the notation below for shifting off elements of AR many times but don't recall seeing this output. I think I know what is happening but I don't understand why. Is the second 'shift' line, when the value of $dir2sr is printed it just shows '1'. I guess it is showing the boolean value of that variable instead of its content.... But why is that? Is it related to that being the last element? ------- ------- ---=--- ------- ------- use strict; use warnings; @ARGV==2 or die "ARGV not equal 2 <ARGV !~ 2>: $!"; my $re= qr/@{[shift]}/; if (! -d $ARGV[0]) { print "Sorry... <$ARGV[0]> not found .. aborting ..\n"; exit 1; } print "hpdb @ARGV\n"; my $dir2sr = @{[shift]}; print "<$re> $dir2sr\n"; __END__ ------- ------- ---=--- ------- ------- ./script '^use File::Find;' ~ hpdb /home/reader <(?^:^use File::Find;)> 1 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/