Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Bareword rules?

by moritz (Cardinal)
on Aug 23, 2012 at 05:44 UTC ( #989204=note: print w/replies, xml ) Need Help??


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
    Okay!! Thanks!!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989204]
help
Chatterbox?
Discipulus profited choroba distraction to answer a tk question..
Discipulus post that probably will bring some new hat..
Eily sets the confetti thrower

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2017-07-27 10:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (409 votes). Check out past polls.