in reply to Re: Perl and PHP playing together
in thread Perl and PHP playing together

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

Replies are listed 'Best First'.
Re^3: Perl and PHP playing together
by sweetblood (Prior) on Nov 29, 2004 at 20:09 UTC
    I stand corrected. You are absolutely right.

    Thanks!

    Sweetblood