Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Subroutine's output as input to a subroutine

by perlfan (Vicar)
on Nov 20, 2007 at 23:28 UTC ( [id://652023]=note: print w/replies, xml ) Need Help??


in reply to Subroutine's output as input to a subroutine

I have no idea what you're trying to do, but you're missing a closing } and get rid of the &
sub makeitbig { my $default_value = 'xxx'; if (@_) { $default_value = shift; } return $default_value; } sub testmode { my $random1 = int( rand(makeitbig()) ); return $random1; }
BTW, this could be rewritten:
# not tested, but you get the gist sub makeitbig { return @_ ? shift @_ : 'xxx'; } sub testmode { return int( rand(makeitbig()) ); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-20 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found