Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Perl and PHP playing together

by sweetblood (Prior)
on Nov 29, 2004 at 19:04 UTC ( [id://411007]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-04-18 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found