in reply to Bareword rules?
print is a bit special, since it expects a file handle as an optional first argument, which can be a bareword.
You can eliminate that speciality by adding an explicit STDOUT:
$ perl -le 'print STDOUT one, two, three' onetwothree
So you can have as many barewords in term position as you like.
If you leave out a comma, you have indirect method call syntax instead:
$ perl -le 'print STDOUT one, two three' Can't locate object method "two" via package "three" (perhaps you forg +ot to load "three"?) at -e line 1.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Bareword rules?
by cheekuperl (Monk) on Aug 23, 2012 at 06:08 UTC |
In Section
Seekers of Perl Wisdom