#! 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; } #### 14:00 >perl 1204_SoPW.pl blah blah for 11 14:00 >