Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

How do you include a feature from the command line?

by toro (Beadle)
on Jul 30, 2012 at 20:46 UTC ( [id://984517]=perlquestion: print w/replies, xml ) Need Help??

toro has asked for the wisdom of the Perl Monks concerning the following question:

Normally to include a library like use LWP at the command line I would do perl -e -MLWP "the program text" . But say I want to, say, use feature 'say' from the command line. Various inflections of perl -eMsay and perl -eM"feature 'say'" haven't worked. How should I say it? If you know what I'm saying.

Replies are listed 'Best First'.
Re: How do you include a feature from the command line?
by Corion (Patriarch) on Jul 30, 2012 at 20:50 UTC

    See perlrun.

    >perl -E "say 'hello'" hello >perl -Mfeature=say -we "say 'hello'" hello

      Thank you!!

      ...

      To any googlers who happen to stumble upon this answer, the relevant part of perlrun is the header

      Command Switches
      and then scroll down to -E and further down to -M.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://984517]
Approved by tobyink
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-20 05:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found