Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Looking for syntactic shortcut

by virtualsue (Vicar)
on Jul 19, 2005 at 13:01 UTC ( #476071=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Looking for syntactic shortcut
in thread Looking for syntactic shortcut

That's not a very good test. Here's a very small program that does what you say you want:

#!/usr/bin/perl use warnings; use strict; sub retarray { my $param = shift; my @array=(1,2,3,4,5,56); return @array; } my $param = 2; my $val = (retarray($param))[3]; print "val is $val\n";


Comment on Re^3: Looking for syntactic shortcut
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://476071]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2015-07-29 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls