in reply to Re: Returning all data from subroutine
in thread Returning all data from subroutine
Your question makes no sense. In the code you show there is no point at which you are explicitly returning data from any of your subs and at no point is implicitly returned data from any sub used. Maybe you meant something like:
use warnings; use strict; print addIronman(addAm(addI(""))); sub addI { my ($string) = @_; $string . "i"; } sub addAm { my ($string) = @_; return $string . " am"; } sub addIronman { my ($string) = @_; return "$string ironman"; }
Note that addI returns its result implicitly because the result is the last value evaluated before the implicit return at the end of the sub. The other subs return explicit values.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Returning all data from subroutine
by james28909 (Deacon) on Nov 05, 2014 at 03:59 UTC | |
by GotToBTru (Prior) on Nov 05, 2014 at 05:47 UTC |