Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: defining variable values on the commandline

by broquaint (Abbot)
on Jul 09, 2002 at 15:45 UTC ( [id://180523]=note: print w/replies, xml ) Need Help??


in reply to defining variable values on the commandline

want to define the value of a var on the commandline is this possible ?
It certainly is. See the -s option in the perlrun manpage. Here's a brief example
shell> cat > dash_s_switch.pl print "\$foo is $foo\n"; ^D shell> perl -s dash_s_switch.pl -foo="a string" $foo is a string

HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: defining variable values on the commandline
by fjonckers (Novice) on Jul 09, 2002 at 16:30 UTC
    just what the monkdoctor ordered ... the -s works fine Thanks Guys !

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-20 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found