Bill,
 
Would it not be better to post (copy) this message and the following postings to 
perl.tips oriented for beginners (like me)
 
http://www.nntp.perl.org/group/perl.tips
 
Later it is going to be much easier to search perl.tips with 8 messages posted up to 
date then go through 61314 messages in perl.beginners.
 
Thanks,
 
Serguei


> ATTACHMENT part 20 message/rfc822 
Date: Sat, 06 Mar 2004 00:57:58 -0500
From: WC -Sx- Jones 
To: [EMAIL PROTECTED]
Subject: HERE DOCUMENTS

This is Part One of a Multipart posting - just to see if we can't keep 
things in the list archieves (Give the listbots something to do :)

(These are not really posted questions so much as they are things that 
beginners need to consider.)


"HERE" DOCUMENTS

* Here documents are used to embed lines of text in a Perl
script, for printing or variable assignment.

$foo = < testing
one
two
three
$four
EOT

print <<_Html_;
various basic html can go here

sprinkled with Perl variables...
_Html_

NOTE that the ending portion of a heredoc must be in column zero -- I 
have noticed that having indented can cause issues at times...


* Variable interpolation is "on" by default. You turn it off
by making it single quoted.

print <<'EOP0'
interpolation is off:
$foo $bar are not converted to data
EOP0

Whether you use Double quotes, the variables are
interpolated into their corrisponding data:

print < interpolation supported:
$foo is related to $bar
EOP1


# The following is somewhat dangerous; use with
# appropriate caution -

* Commands will be executed if the ending-string uses backticks.
$sommand_results = <<`END_OF_COMMANDS`
ls -al
ps -aux
END_OF_COMMANDS

Also, I previously posted how to cram single lines of text into an 
array; it is left upto the reader as an exercise to find that posting 
out there in Usenet land.


That's a small start to what I hope will become a long term thing :)

So, if you have a statement or neat easy to understand fact about HERE 
Documents, post it; keep this Perl Chain Posting going...

-Bill-
__Sx__________________________________________
http://youve-reached-the.endoftheinternet.org/



---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

Reply via email to