Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Turn off interpolation in print << ? 1

Status
Not open for further replies.

serpento

Programmer
Jun 16, 2002
92
GB
I have recently discovered the folloeing device:
Code:
print <<HTML_END;
(What you want to print)
HTML_END
And find it very useful. My questiuon is this: if what you want to print contains lots of @ and $ signs in (as in talking about email addresses and currency rather than variables), is there away of turning interpolation off so I don't have to put a backslash before every case?

Any help would as always be much appreciated.

-Ed ;-)

________________________________
Destiny is not a matter of chance; it is a matter of choice.
 
Enclose the end token in single quotes, e.g.
Code:
#!perl
use strict;

print <<'EOF';
@blah $twenty-seven
$ninety_two 43
@hike
EOF
Outputs
@blah $twenty-seven
$ninety_two 43
@hike
 
nice answer mikevh - i had no idea you could do that!


Kind Regards
Duncan
 
Thanks that perfect! Have a star.

-Ed ;-)

________________________________
Destiny is not a matter of chance; it is a matter of choice.
 
just nicked this :

print <<HTML_END;
(What you want to print)
HTML_END

works a treat, thanks !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top