Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Using scalar variable in system set of commands

by choroba (Abbot)
on Nov 01, 2012 at 14:37 UTC ( #1001839=note: print w/ replies, xml ) Need Help??


in reply to Using scalar variable in system set of commands

By using the backslash, you prevent $month from being interpolated in the doublequotes. The shell then gets $month and tries to expand it - but there is no shell variable named $month.

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Using scalar variable in system set of commands
Re^2: Using scalar variable in system set of commands
by tobyink (Abbot) on Nov 01, 2012 at 14:50 UTC
    Indeed. The backslashes before the pipes are also unnecessary.
    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2014-09-20 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (159 votes), past polls