
August 9th, 2000, 06:23 AM
|
|
Contributing User
|
|
Join Date: Aug 2000
Posts: 81
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
|
Use:
$inVar = qq/this is a string with both " and ' in it which will probably confuses the perl engine/;
If you have / characters occuring in your string, use some other delimiter (e.g ~ or !) -- basically, just pick some non-whitespace, non-alphanumeric character that doesn't occur in your string. If there is no such character, then you'll have to escape any characters that match your delimiter (i.e. if you use " as a delimiter you must replace all occurences of " in the string with ", or if you use / you'd have to replace it with /).
One note is that if you're not interpolating variables in that string, you should use single quotes or the q// operator, as that doesn't attempt to do any variable interpolation and so runs a lot faster. If you don't entirely understand what I'm talking about, run:
perldoc perlop
and go to the section entitled:
Quote and Quote-like Operators
|