in reply to Re: Capture Console Results?
in thread Capture Console Results?

Just a side note really, but I think that

(undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,$comm,$comm1,$comm2) = split;

is probably best written as

($comm, $comm1, $comm2) = (split)[10..12];


acid06
perl -e "print pack('h*', 16369646), scalar reverse $="

Replies are listed 'Best First'.
Re^3: Capture Console Results?
by chargrill (Parson) on Feb 25, 2006 at 06:51 UTC

    True, but I made the assumption he cared about some of the columns as he went through the trouble of creating variables to store them (though the example script makes no use of them). aundef,<esc>l8. in vi (to repeat adding more 'undef,') was easier than typing out new variable names, plus gives a hint that there are more columns of output than the original command provides, and could therefore be turned back into variables should the OP so desire.



    --chargrill
    $/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ } + sig map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu +" );
Re^3: Capture Console Results?
by ecuguru (Monk) on Feb 26, 2006 at 05:36 UTC
    Actually I do care about the variables that come before it, but I didn't know that you could even do what you're suggesting, so thanks!!