|sorry for delay acknowledging your and others' posts - I mistook the first response to mine as some kind of disapproval
As to your
What is the practical advantage ...
I view the task of performing the unpacking of the string as logically one task, not two, and so perhaps it is clearer to any reader how this task is being accomplished if done in one reasonably intuitive statement rather than two. If by practical you were thinking more of performance, then none.
And I omitted to say originally that what encouraged me to believe that such a statement might exist is this from perlfunc "pack"
For "unpack", an internal stack of integer arguments unpacked so far is used. You write "/"sequence-item
and the repeat count is obtained by popping off the last element from the stack. The sequence-item must not
have a repeat count.
I was not sure what this meant but it seemed relevant.
I tried using it in various ways but all failed.
I did not find any elucidation of this in perltut
I *think* some of the suggestions offered in this thread are using such sequence-items but I'm not sure; and if so, I'm also not sure how the argument numbers are being pushed onto the stack.
If anyone can explain what the quoted text means (specifically the integer arguments) or have a simpler example, I would appreciate that.
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||