1. From perldoc perlvar -
$/ The input record separator, newline by default. This influences
Perl's idea of what a "line" is. Works like awk's RS variable,
including treating empty lines as a terminator if set to the
null string. (An empty line cannot contain any spaces or tabs.)
You may set it to a multi-character string to match a
multi-character terminator, or to "undef" to read through the
end of file. Setting it to "\n\n" means something slightly
different than setting to "", if the file contains consecutive
empty lines. Setting to "" will treat two or more consecutive
empty lines as a single empty line. Setting to "\n\n" will
blindly assume that the next input character belongs to the next
paragraph, even if it's a newline. (Mnemonic: / delimits line
boundaries when quoting poetry.)
2. chomp removes whatever is in $/
3. Don't feel bad about people continuing to answer your question - others may benefit, and there is benefit for the answerer as well.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|