do expects a BLOCK, SUBROUTINE (deprecated) or an EXPR as its argument. So, I am guessing that, when a BLOCK or SUBROUTINE is not passed, it is looking for an expression and probably allowing barewords.>> perl -MO=Deparse -e 'do ("print")' do 'print'; -e syntax OK >> perl -MO=Deparse -e 'do (print)' do print($_); -e syntax OK >> perl -MO=Deparse -e 'do print' do 'print'; -e syntax OK >> perl -MO=Deparse -e 'do{print}' print $_;; -e syntax OK
In reply to Re: The Behavior of 'do'
by PrakashK
in thread The Behavior of 'do'
by dsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |