Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 wandering the Monastery: (3)
As of 2014-09-20 19:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls