Hi Jeremy,
On Mar 18, 2009, at 6:43 AM, Jer A wrote:
> I want to override all 'our' and all 'my' statements in a script.
> how do i do this, without any third party modules, just code.
Mmm, sounds tricky. There was an article on StackOverflow recently
about redefining Perl functions, perhaps you could start there?
http://stackoverflow.com/questions/651124/how-do-i-redefine-built-in-perl-functions
> this may sound funny, but I would like to initialize all declared
> variables to 'undef' or '()'.
Aren't all declared variables initialized to undef or () automatically
anyway? According to perlsyn [1]:
"A variable holds the undefined value (undef) until it has been
assigned a defined value, which is anything other than undef. When
used as a number, undef is treated as 0 ; when used as a string, it is
treated as the empty string, "" ; and when used as a reference that
isn't being assigned to, it is treated as an error."
I can't find a reference for arrays/hashes, but I think they work the
same. Why do you need to override 'our' and 'my'?
cheers,
Gaurav
[1] http://perldoc.perl.org/perlsyn.html, but also 'perldoc perlsyn'
from the command prompt on your computer.
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs