Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Modifying Global Variable

by vek (Prior)
on Jan 08, 2003 at 17:41 UTC ( [id://225307]=note: print w/replies, xml ) Need Help??


in reply to Modifying Global Variable

I think you're a little confused on how to return data from subroutines. I think this is what you want:
my $date = dateconverter($date_begin); print $date, "\n"; sub dateconverter { my $dateFoo = shift; # do stuff here, # store your end result in $somevar return $somevar; # returns the value }
Your $date var will now contain the value of $somevar.

-- vek --

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-25 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found