But there is no free lunch. More often than not it leads to additional complications.
For example, it allows enough rope to lead to troubles with the debugger. As you can see below, in v5.26.3 the debugger accepts the statement {$i=5; $j=20) } if( $new_cycle ); which is clearly a violation of the Perl grammar.
Why it is accepted?
And now even more interesting:DB<100> $new_cycle=1 DB<101> { $i=5; $j=10 } if( $new_cycle ); DB<102> p "i=$i,j=$j" i=,j=
No syntax error detected.DB<104> { $i=5; $j=10 ) } if( $new_cycle );
Interpreter catches those errors as it should:
But even $i=5, $j=10 if( 1 ); which is legit, is a a little but too much rope; enough to hang yourself. Again, I would limit postfix statements to loop control statements, return/exit/die and a couple of others. But this is just me.perl minitest.pl syntax error at minitest.pl line 2, near ");" syntax error at minitest.pl line 4, near "10 ) " syntax error at minitest.pl line 4, near ");" Execution of minitest.pl aborted due to compilation errors. /cygdrive/f/_Scripts/Pl2py [255] # cat -n minitest.pl 1 $new_cycle=1; 2 { $i=5; $j=10; } if( $new_cycle ); 3 print "i=$i,j=$j\n"; 4 { $i=5; $j=10 ) } if( $new_cycle );
In reply to Re^8: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by likbez
in thread What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by likbez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |