jonam has asked for the wisdom of the Perl Monks concerning the following question:
How can I skip the first two return values of the function(which returns an array)?
Consider the following example#! /bin/perl use strict; sub sample { my @arr=(1,2,3,4); return @arr; } my ($a,$b,$c,$d) = &sample; print "$a\n$b\n$c\n$d\n";
In the above code, How can I get the $c without using the arguments such as $a,$b.
I don't want to use any array to get the return values.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Skip return values
by jwkrahn (Abbot) on Apr 03, 2009 at 06:24 UTC | |
|
Re: Skip return values
by lakshmananindia (Chaplain) on Apr 03, 2009 at 05:25 UTC | |
|
Re: Skip return values
by vinoth.ree (Monsignor) on Apr 03, 2009 at 06:26 UTC | |
by AnomalousMonk (Archbishop) on Apr 03, 2009 at 07:21 UTC | |
by codeacrobat (Chaplain) on Apr 03, 2009 at 14:22 UTC |