I know how to do slices of arrays and hashes, but in writing a debug statement, I was having to do too much repetitive typing:
Pe "create_lv_snap,name=%s, path=%s, vgname=%s,mp=%s,size=%s",
$snap_lvh->lv_name, $snap_lvh->lv_path, $snap_lvh->vg_name,
$snap_lvh->_mp, $snap_lvh->lv_size;
What I would have liked to have done was something like:
Pe "create_lv_snap,name=%s, path=%s, vgname=%s,mp=%s,size=%s",
&{$snap_lvh}{lv_name, lv_path, vg_name,_mp, lv_size};
Where the output's of each subroutine call (a variable) would be passed as args to the print statement... Is there something like that already in perl that I'm not aware of?
Remember, this was a debug statement -- so minimizing time to type it in was typical of this type of problem.....
Ideas? Clue sticks? ;-)
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.