Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: system call with variable interpolation

by Bloodnok (Vicar)
on Jul 15, 2011 at 11:30 UTC ( #914562=note: print w/ replies, xml ) Need Help??


in reply to system call with variable interpolation

Hmmm, seems to work for me, aren't I lucky :-)

# perl -e '$d=`date`;system "echo \"d: $d\">t"' # more t d: Fri Jul 15 13:54:50 BST 2011 #
A user level that continues to overstate my experience :-))


Comment on Re: system call with variable interpolation
Download Code
Re^2: system call with variable interpolation
by JavaFan (Canon) on Jul 15, 2011 at 11:33 UTC
    Hmmm, seems to work for me, aren't I lucky
    But you're doing something else. You've added quotes.
Re^2: system call with variable interpolation
by Anonymous Monk on Jul 15, 2011 at 11:34 UTC
    put it in a file with #!/usr/bin/perl -- and it probably won't work -- your shell probably sets/expands $d before your perl program runs
      Not true - if you notice, the 'program' is in single quotes - which has the same effect in the shell as it does in a perl program i.e. variables aren't expanded.

      A user level that continues to overstate my experience :-))
        I could have sworn you had no double-quotes in there anywhere

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-09-22 22:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (205 votes), past polls