From: "Singh, Ajit p" <[EMAIL PROTECTED]>
> I am running a perl script as below which is working perfectly and
> want to replace the hardcoded values with variables. (the script
> accepts space as the delimiter)
>
> @respon = $placesock->print("./test.pl \"7741266\" \"DEM EXPO\"
> \"255.255.255.255\" \n");
>
> and i am doing this
>
> @respon = $placesock->print("./test.pl." ".$param1." ".$param2."
> ".$param3 \n");
I'm sure you'll like the qq operator:
@respon = $placesock->print(
qq{./test.pl "$param1" "$param2" "$param3"\n}
);
or
@respon = $placesock->print(
qq<./test.pl "$param1" "$param2" "$param3"\n>
);
or
@respon = $placesock->print(
qq#./test.pl "$param1" "$param2" "$param3"\n#
);
or
...
The qq (as well as it's brother q and relatives qx, qr, qw and even m
and s) allows you to use any delimiter you like. Which means that if
you select well you do not have to escape any quotes.
See the "Quote and Quote-like Operators" section of the perlop
manpage:
perldoc perlop
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>