perl-diddler has asked for the wisdom of the Perl Monks concerning the following question:
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:
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, $snap_lvh->lv_path, $snap_lvh->vg_name, $snap_lvh->_mp, $snap_lvh->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?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};
Remember, this was a debug statement -- so minimizing time to type it in was typical of this type of problem.....
Ideas? Clue sticks? ;-)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: slice of ptr-based-output routines?
by Athanasius (Archbishop) on Aug 01, 2012 at 07:10 UTC | |
Re: slice of ptr-based-output routines?
by sundialsvc4 (Abbot) on Aug 01, 2012 at 13:51 UTC | |
by perl-diddler (Chaplain) on Aug 01, 2012 at 21:02 UTC |
Back to
Seekers of Perl Wisdom