in reply to Odd constructor in HTML::Template

No deep magic. No superstition. Just "style". It might have something to do with earlier versions of perl (I know nothing of perl4), but nothing to do with mod_perl.

 
______crazyinsomniac_____________________________
Of all the things I've lost, I miss my mind the most.
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"

  • Comment on (crazyinsomniac) Re: Odd constructor in HTML::Template

Replies are listed 'Best First'.
Re: (crazyinsomniac) Re: Odd constructor in HTML::Template
by drewcifer (Novice) on Mar 29, 2002 at 13:42 UTC
    I believe it has something to do with the scope of the variables and the Authors attempt to force the $hash variable to be truly private. There is a great discussion of this in "Object Oriented Perl" by Damian Conway. If you do not have this book it is a must for any OOP Perl programmer and a great introduction to OOP with Perl.
      Except that it does nothing of the kind. There's no difference to creating a named lexical and letting it fall out of scope versus creating an anonymous value in the first place. So, perhaps this is vestigial code, left over from a larger cut-n-paste, or this is from someone who didn't quite "get it".

      In either case, I'd yellow flag this in a formal code review. Meaning I'd let it stand as workable, but if resources were available, bring it in line with more common idioms.

      -- Randal L. Schwartz, Perl hacker

Re: (crazyinsomniac) Re: Odd constructor in HTML::Template
by impossiblerobot (Deacon) on Mar 29, 2002 at 16:32 UTC
    Definitely not a Perl 4 issue, since it had no references, and therefore no need/use for a bless() function. :-)

    (Not to mention a lack of modules.)

    Impossible Robot