Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Modifying Global Variable

by boo_radley (Parson)
on Jan 08, 2003 at 18:53 UTC ( #225329=note: print w/replies, xml ) Need Help??

in reply to Modifying Global Variable

Can't modify constant item in scalar assignment at line 276, near ""$year.$month.$day";"
This error is caused because you've forgotten the glyph to main::date -- it should be $main::date. Without the dollar sign, it's not considered a variable.
You should be wary of using a global variable for a return value, too. Are you really sure you want to change $main::date every time you want convert to epoch time? This sort of side effect, as well as the logic behind omitting a local declaration, should be documented to whatever standards you have.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2023-03-24 07:15 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (60 votes). Check out past polls.