Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a subroutine as follows
################## sub sample { ################## my $t = shift; my ($p, @r, $v, $rt); $t->get_handles(params=>\$p, rtrs=>\@r, vars=>\$v, t=>\$rt); my @subs; foreach my $rh (@r) { <some command at execution> }
Here, @r takes values which is defined in a file, which is pre-defined, @r always inputs from $r[0]..$r5 .Users can't modify this file or this sub sample. They can only access from their own sub/file
I am calling this sub via another file, but i need @r to process only $r[0]. Is there a way to statically set @r to a single value say, $r[0] ,temporarily from the calling file/sub
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: setting values inside subroutine
by BillKSmith (Monsignor) on Sep 16, 2015 at 13:10 UTC | |
|
Re: setting values inside subroutine
by tangent (Parson) on Sep 16, 2015 at 12:20 UTC | |
by Anonymous Monk on Sep 16, 2015 at 12:29 UTC | |
|
Re: setting values inside subroutine
by Anonymous Monk on Sep 16, 2015 at 11:30 UTC | |
|
Re: setting values inside subroutine
by Anonymous Monk on Sep 18, 2015 at 15:15 UTC | |
by Anonymous Monk on Sep 18, 2015 at 23:03 UTC | |
by Anonymous Monk on Sep 28, 2015 at 05:39 UTC | |
by Anonymous Monk on Sep 28, 2015 at 06:43 UTC |