Your mission, should you choose to accept it, is to find the documentation (if any) that supports perl's actual behaviour. Or at least figure out why perl is doing what it is doing. Or at least have some fun and maybe learn something new.
Update: reordered the tests (before any replies) Update: verbosify ok() subuse strict; use warnings; use vars '$x'; sub ok ($$) { my ($testnum, $check) = @_; if ($check) { print "ok $testnum\n"; } else { print "not ok $testnum\n" } } $x=0; { no strict 'refs'; my $x=42; my $y = 'x'; ok 1, ${$y} == 42; } ok 2, eval 'no warnings; sub Foo::INIT { 42 } &Foo::INIT();'; $x="ad"; for ($x) { /a/gc; /\Gb?/gc; ok 3, /\Gc?/gc; } ok 4, eval ' "(R)" =~ m(\(?r\)?)i '; $x=1; { my $x=2; sub x {eval '$x'} } { my $x=3; ok 5, x; } ok 6, 17.98 == 17.99 - .01;
In reply to notabug quiz by ysth
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |