When learning any language, Perl or otherwise, it is vital
to have a handy desk reference. I have found
Programming Perl
to be the book of choice for me, and many others, as it
provides a function-by-function breakdown of what stuff does.
A good portion of this is also available in 'perldoc', if
you happen to have access to that. As in, 'perldoc -f seek',
which would return:
seek FILEHANDLE,POSITION,WHENCE
Sets FILEHANDLE's position, just like the fseek call of stdio.
FILEHANDLE may be an expression whose value gives the name of the
filehandle. The values for WHENCE are 0 to set the new position to
POSITION, 1 to set it to the current position plus POSITION, and
2 to set it to EOF plus POSITION (typically negative). For WHENCE
you may use the constants SEEK_SET, SEEK_CUR, and SEEK_END
(start of the file, current position, end of the file) from the Fcntl
module. Returns 1 upon success, 0 otherwise.
The moral of the story is if you ever stumble across something
you "don't understand", don't just paste it in there, read
up on it until you have a handle on what it does, at least
in theory.
Unlike, say, advanced particle physics where there is an
element of the unknown, Perl is very well documented and
there is little left to mystery.
Cargo Cult Programming
is not a productive way to learn.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.