whether this should be classed as a bug or not.
(The older package delimiter, ' ,is used here)
- $x = 10 ;
- print "x=${'x}\n" ;
+ $x = 10;
+ print "x=${'x}\n";
# perl4 prints: x=10
# perl5 prints: Can't find string terminator "'" anywhere before EOF
You can avoid this problem, and remain compatible with perl4, if you
always explicitly include the package name:
- $x = 10 ;
- print "x=${main'x}\n" ;
+ $x = 10;
+ print "x=${main'x}\n";
Also see precedence traps, for parsing C<$:>.
Double darn.
$a = ("foo bar");
- $b = q baz ;
+ $b = q baz;
print "a is $a, b is $b\n";
# perl4 prints: a is foo bar, b is baz
$opt = 'r';
$_ = 'bar';
s/^([^$grpc]*$grpc[$opt]?)/foo/;
- print ;
+ print;
# perl4 prints: foo
# perl5 prints: foobar
the file.
open(TEST,">>seek.test");
- $start = tell TEST ;
+ $start = tell TEST;
foreach(1 .. 9){
print TEST "$_ ";
}
- $end = tell TEST ;
+ $end = tell TEST;
seek(TEST,$start,0);
print TEST "18 characters here";