in reply to Subroutine's output as input to a subroutine
BTW, this could be rewritten:sub makeitbig { my $default_value = 'xxx'; if (@_) { $default_value = shift; } return $default_value; } sub testmode { my $random1 = int( rand(makeitbig()) ); return $random1; }
# not tested, but you get the gist sub makeitbig { return @_ ? shift @_ : 'xxx'; } sub testmode { return int( rand(makeitbig()) ); }
|
|---|