in reply to Perl and PHP playing together

in your line:
`$MODULE::PROGS/variable_setup.sh $MODULE::PROGS/myscript.php 'data=$_ +[1]' > $file$_[1].$ext`;
you are single quoting the data=$_[1]. Perl will not interpolate $_[1] when wrapped in single quotes.It won't interpolate any variable inside single quotes for that matter.

HTH

Sweetblood

Replies are listed 'Best First'.
Re^2: Perl and PHP playing together
by jimbojones (Friar) on Nov 29, 2004 at 19:27 UTC
    Hello

    I don't think this statement is 100% correct. Perl won't interpolate between single quotes when assigning to a variable. However, if the single quotes are inside double-quotes or a set of backticks, it will interpolate. See the following.

    my $x = "this is the x variable"; my $y = 'single quote of $x'; my $z = "echo '$x'\n"; print $x, "\n"; print $y, "\n"; print $z; print `echo '$x'`; print `$z`; __DATA__ this is the x variable single quote of $x echo 'this is the x variable' this is the x variable this is the x variable
    note that the assignment to $z does interpolate $x, as does the backtick call to 'echo'

    -j

      I stand corrected. You are absolutely right.

      Thanks!

      Sweetblood