"Jay Savage" schreef:
>> There are, however,
>> modules that modify all sorts of internal variables and symbol tables
>> to enhance efficiency and work magic, and there is always a slight
>> chance that someone, somewhere has messed with $[ and not told you
>> about it. If they have, you'll end with unexplained and nearly
>> impossible to diagnose fencepost errors in your code if you expect
>> that $#array and @array -1 will always return the same value, and
>> $array[$#array] and [EMAIL PROTECTED] -1] will always refer to the same
>> item.
But "As of release 5 of Perl, assignment to $[ is treated as a com-
piler directive, and cannot influence the behavior of any other
file.". So it only influences the current file, onwards from where
it is set.
$ perl -Mstrict -MData::Dumper -wle'
my @x; $[ = -1;
$x[0] = "abc"; $[ = 1;
$x[1] = "cde";
print Dumper [EMAIL PROTECTED]
'
$VAR1 = [
'cde',
'abc'
];
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/