Not the answer to your question (tho I will expand a bit on info sources), but the PRIMARY POINTS ILLUSTRATED BY THE CODE SHOWN ARE ... wait for them... just a little longer...
- Use meaningful variable names.
$a and $b violate not only that wisdom, but should also be reserved for use in comparisons
and...
- Don't get too lazy to type a few extra chars for clarity. Saving chars too enthusiastically will usually obfuscate your code rather than improve it.
As to info sources: perldoc func, op, module_name is an incantation that will lead you to explanatory docs, right on your own computer. For example, for the regexen, you might want to see perldoc perlretut (or one of its siblings); for printf (which is a function and thus needs a "-f" before its name, thusly) perldoc -f printf (which will give you a referal to another function instead of usefully answer the question "what does it do?" unless you are intimate with sprintf's format arguement ...but that's a whole different can of worms); and, as an exercise to the OP, we have the likes of qw (for which vist re "quote word" and friends); some lists (defined by the square brackets) and a few more.
...and welcome to Perl and to the Monastery!
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.