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 :-))

Replies are listed 'Best First'.
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