|
Prev: Passing object from subroutine problem
Next: FAQ 2.6 What modules and extensions are available for Perl? What is CPAN? What does CPAN/src/... mean?
From: Michele Dondi on 27 Sep 2006 16:48 On Wed, 27 Sep 2006 21:38:34 +0200, Ralph Moritz <me(a)ralphm.info> wrote: >> why aren't you just doing: >> >> { >> package Foo; >> my $data = "Stuff"; >> >> sub new { >> #... >> } >> } >> >> ? > >Because I need to read the value of $data from a config file. Or because, more generally, you want for some reason to do that initialization only at the first instantiation of the class, which indeed is a good point, IMHO... Michele -- {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB=' ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_, 256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH, |