Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: quotes in Perl

by nedals (Deacon)
on Oct 21, 2004 at 07:02 UTC ( [id://401076]=note: print w/replies, xml ) Need Help??


in reply to quotes in Perl

Minor gotcha in the here-is doc
print <<HTML; .. <style type="text/css"> \@import(url) </style> .. .. HTML
Don't forget to escape the '@' symbol.

Replies are listed 'Best First'.
Re^2: quotes in Perl
by Happy-the-monk (Canon) on Oct 21, 2004 at 09:27 UTC

    I don't experience that gotcha with a modern perl.

    However, a nicer fix than too many backslashes strewn in the data would be not to interpolate the Here-doc:
        print <<'HTML';

    Look again at jZed's post or ikegami's last point.

    Cheers, Sören

Re^2: quotes in Perl
by nedals (Deacon) on Oct 22, 2004 at 01:06 UTC

    You wish to create an HTML doc using <<HTML; that requires interpolation.

    An @import (style sheet) or email address may be included. If the '@' symbol is not escaped, an error message will be returned that refers ONLY to the first line of the here-is

    Global symbol "@import" requires explicit package name at /usr/local/a +pache/..... line 100. Execution of /usr/local/apache/.... aborted due to compilation errors.

    Knowing the above helps to quickly locate the problem. (or avoid it)

    Just a item to add to your
    ...some notes to keep in mind:...
Re^2: quotes in Perl
by apotheon (Deacon) on Oct 21, 2004 at 07:24 UTC
    I don't know what you're referring to, as there's nothing remotely similar to the example code you've indicated in the text of my tutorial. I have added a notation about escaping @ and $ symbols in interpolated strings within the "escape characters" section, however.

    - apotheon
    CopyWrite Chad Perrin

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-03-28 18:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found