On 29/07/2011 15:53, Emeka wrote:
Rob,
I checked perldoc , and it is pretty like reading Latin. I have been
babied by Factor and co. Perl is something else(or should I say
perldoc) , and as if that is not enough Google is not even finding it
easy to search for stuff like $\ and $/. I am not infinitely lazy ,
and naturally I use Google to pick thing out easily. But when Google
is not there to back me up ....I would only depend on your mercy and
stackoverflow.
(Please bottom-post your responses to this list Emeka. It is the
standard here, and threads can become very difficult to read if
different people are posting to opposite ends of the quoted text. Thank
you.)
Yes, $/ is a little more convoluted. Basically it defines how much data
the 'readline' function (same as <>) fetches from the file. By default
it is set to "\n", so that each <FILEHANDLE> will return a string up to
and including the next newline in the file.
Aside from changing it to something special for unusually-formatted
files, these values are possible:
- $/ = undef will read the whole of the rest of the file, with stopping
at any terminators.
- $/ = "" (the null string) will read everything up to one or more blank
lines
- $/ = \999 (reference to any integer) will read (a maximum of) that
much data as the next record, ignoring record boundaries.
HTH,
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/