And so others can get the benefit of your wisdom w/o
the
OOPerl book
(but buy it nonetheless, its a
great book), pg 34
gives the example:
sub listdir
{
# do file listing and the:
return @missing_files if wantarray();
return $listed_count if defined(wantarray());
carp "subroutine &listdir was called in a void context";
} # sub listdir
The really cool thing here: wantarray returns true if:
@missing = listdir(@files);
(called in a list context); returns "" (i.e. false but defined) if:
$list_count = listdir(@files);
(called in a scalar context) and returns
undef if:
listdir(@files);
(called in a void context - get the carp).
a
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.