in reply to Re^2: Accessing single element without args
in thread Accesing single element without args
Here is one (inelegant) approach which might work for you:
#! perl use strict; use warnings; use Capture::Tiny ':all'; my ($stdout, $stderr, @result) = capture { interface_control(); }; my @lines = split "\n", $stdout; print $lines[0], "\n"; sub interface_control { my @r; get_handles(\@r); print "blah blah for $_\n" for @r; } sub get_handles { @{ $_[0] } = 11 .. 13; }
Output:
14:00 >perl 1204_SoPW.pl blah blah for 11 14:00 >
Update: Removed unnecessary parentheses from print statement, plus a blank line.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Accessing single element without args
by Anonymous Monk on Mar 31, 2015 at 04:18 UTC | |
by Athanasius (Archbishop) on Mar 31, 2015 at 06:09 UTC | |
by Anonymous Monk on Mar 31, 2015 at 06:39 UTC |