Er, maybe I'm not understanding something here, but... Wouldn't @pad disappear, completely, when the scope of the BEGIN block closed?
TIA for clarifying.
Deane
| [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED] 06/23/2006 11:41 AM
|
To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject: Re: Module to encrypt/store/retrieve/decrypt passwords |
In a message dated 6/23/2006 12:30:35 P.M. Eastern Standard Time, [EMAIL PROTECTED] writes:
> hi charles --
>
> In a message dated 6/22/2006 10:38:47 P.M. Eastern Standard Time, [EMAIL PROTECTED] writes:
>
> > BEGIN {
> >
> > my @pad = (some large list of numbers);
> >
> > ...
>
>
> just a point of curiosity...
> why is @pad defined inside a BEGIN block instead of just any old block?
>
> regards -- bill walters
a little more reflection is sometimes useful.
the answer, correct me if i'm wrong, is that placing @pad in a BEGIN block closure
allows one to be sure that the array will be initialized before any of the functions that
depend upon it are run, whereas if it was in an ordinary block closure one could not
be so assured.
bill
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
