F
Farhad
Hi,
in the following example there is a output difference in version 5.00 and
5.8 of Perl. In case of a missmatch in element 2, the whole element gets
lost instead of an "undef" value. Does anybody know why in version 5.8 we
lost the element and is that an error in Perl interpreter or does it work as
designed.
Thanks
Farhad
----------------------------------
#!/usr/local/bin/perl -w
my $var="Test";
my @list=('a', # Element 1
$var=~m/\n/, # Element 2
$var=~m/es/ # Element 3
);
print scalar(@list)." (should be 3)\n";
push @list, {
'd' => $var=~m/\n/, # Element 4
};
print scalar(@list)." (should be 4)\n"
in the following example there is a output difference in version 5.00 and
5.8 of Perl. In case of a missmatch in element 2, the whole element gets
lost instead of an "undef" value. Does anybody know why in version 5.8 we
lost the element and is that an error in Perl interpreter or does it work as
designed.
Thanks
Farhad
----------------------------------
#!/usr/local/bin/perl -w
my $var="Test";
my @list=('a', # Element 1
$var=~m/\n/, # Element 2
$var=~m/es/ # Element 3
);
print scalar(@list)." (should be 3)\n";
push @list, {
'd' => $var=~m/\n/, # Element 4
};
print scalar(@list)." (should be 4)\n"