Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: strange quotes

by moodster (Hermit)
on Feb 04, 2002 at 09:21 UTC ( [id://143190]=note: print w/replies, xml ) Need Help??


in reply to strange quotes

Except that I had to slap a ';' onto the second my declaration near the top, and there were some complaint about unintialized values in concatenation, you script worked fine and produced the desired results. I'm running v5.6.1 under cygwin.

Whether you have to escape your quotes or not depends on what kind of surrounding quotes you're using. If the surrounding quotes are ", then you don't have to escape ' qutoes, but other " quotes MUST be escaped (otherwise they mark the end of the string and will probably cause compilation errors). And vice versa.

If you are using a mixture of single and double quotes you may find it more comfortable the qq construct for strings:

my $string = qq( A "string" with lots of 'quotes' );

I notice, BTW, that you open an output file but never writes anything to it; I assume that you changed this for debugging purposes... :)

Cheers,
-- moodster

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-19 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found