in reply to Using RETURN in a sub
Please be a little more specific on the "but it doesnt return anything" part, cause this code runs smoothly on my machine. Maybe a stupid question, but do you actually do something with the returned value? Like:
print makeDate(); sub makeDate{ @days = ("Sun","Mon","Tues","Wed","Thurs","Fri","Sat"); @mons = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct", +"Nov","Dec"); (undef,undef,undef,$mday,$mon,$year,$wday,undef,undef) = localtime(tim +e); $year = 2000 + ($year - 100); $date = "$days[$wday] $mons[$mon] $mday $year"; return $date; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Using RETURN in a sub
by MysticFallout (Initiate) on Feb 19, 2004 at 17:02 UTC | |
by b10m (Vicar) on Feb 19, 2004 at 17:13 UTC | |
|
Re: Re: Using RETURN in a sub
by Anonymous Monk on Feb 19, 2004 at 18:10 UTC |