Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Double Qoutes in string command

by inktuma (Initiate)
on Aug 02, 2013 at 14:03 UTC ( #1047604=perlquestion: print w/ replies, xml ) Need Help??
inktuma has asked for the wisdom of the Perl Monks concerning the following question:

Im trying to send a command through the telnet module. This command includes more double qoutes inside of the perl normal two qoutes for string definition. How can i do this ? this is what i have so far...

$telnet->open($host2)or die "cant open \n" ; my $string = "sysBootFileWrite "QSDvxWorks.aif""; $telnet->cmd($string) or die "cant write freakin command";

Thanks

Comment on Double Qoutes in string command
Download Code
Re: Double Qoutes in string command
by choroba (Abbot) on Aug 02, 2013 at 14:08 UTC
    Read perlop, especially the Quote and Quote like Operators section. You do not need double quotes here, as there is nothing to interpolate, so you can switch to single quotes:
    my $string = 'sysBootFileWrite "QSDvxWorks.aif"';

    For cases where interpolation is needed, you can backslash the inner double quotes or use the qq operator:

    print "He said, \"Hello, $darling.\""; print qq(He said, "Hello, $darling.");
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1047604]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2014-08-29 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (287 votes), past polls