Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Modifying Global Variable

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


in reply to Modifying Global Variable

Can't modify constant item in scalar assignment at calendar.pl 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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-20 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found