Reading from a file handle returns either a
scalar, if you're doing something like "
$x = <FH>", or a list, if you're doing something like "
@x = <FH>". These are the only 2 contexts (
scalar context and
list context) available in Perl
(well, there's also a void context, if you're really picky).
But I don't think that's what you're asking. If you meant "can reading from a file handle return non-strings", the answer is also positive. Your READLINE method can return any scalars it likes. A list reference is just a scalar, so it could return a list reference in scalar context and a list of list references in list context. Just like any Perl function, really.
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.