The second and third arguments of C<splice()> are now evaluated in scalar
context (as the Camel says) rather than list context.
- sub sub1{return(0,2) } # return a 2-elem array
- sub sub2{ return(1,2,3)} # return a 3-elem array
+ sub sub1{return(0,2) } # return a 2-element list
+ sub sub2{ return(1,2,3)} # return a 3-element list
@a1 = ("a","b","c","d","e");
@a2 = splice(@a1,&sub1,&sub2);
print join(' ',@a2),"\n";
# perl4 prints: This is Perl 4
# perl5 prints:
- # Another example
-
- *fred = *barney; # fred is aliased to barney
- @barney = (1, 2, 4);
- # @fred;
- print "@fred"; # should print "1, 2, 4"
+=item * (Globs)
- # perl4 prints: 1 2 4
- # perl5 prints: In string, @fred now must be written as \@fred
+Assigning C<undef> to a glob has no effect in Perl 5. In Perl 4
+it undefines the associated scalar (but may have other side effects
+including SEGVs).
=item * (Scalar String)
=over 5
-=item * Unclassified
-
-C<require>/C<do> trap using returned value
+=item * C<require>/C<do> trap using returned value
If the file doit.pl has:
Same behavior if you replace C<do> with C<require>.
+=item * C<split> on empty string with LIMIT specified
+
+ $string = '';
+ @list = split(/foo/, $string, 2)
+
+Perl4 returns a one element list containing the empty string but Perl5
+returns an empty list.
+
=back
As always, if any of these are ever officially declared as bugs,