On Fri, Sep 07, 2001 at 10:49:00PM -0600, Chris Fedde wrote:
> On Fri, 7 Sep 2001 16:58:32 -0400  Michael G Schwern wrote:
>  +------------------
>  | On Fri, Sep 07, 2001 at 02:32:51PM -0600, Chris Fedde wrote:
>  | > Find below recent patches to the FAQ derived from postings to usenet CLPM.
>  | > Is there a better place I should be posting these? 
>  | 
>  | > +If you need to initialize a large variable in your code, you
>  | > +might consider doing it with an C<eval> statement:
>  | > +
>  | > +        my $large_string = eval ' "a" x 5_000_000 ';
>  | > +
>  | > +This allows perl to immediately free the memory allocated to the
>  | > +eval statement, but carries a (small) performance penalty.
>  | 
>  | Does this really work?
>  +------------------
> 
> Apparently. 


I am not at all happy with this. This problem of using too much memory
should be fixed at the language level - and not at the program level.
Such practices should certainly not be recommended in a FAQ.

Unless one has quite some knowledge of the Perl internals (and then,
one presumely doesn't read the FAQ anymore), the use of eval will not at
all be understood. Hence leading to usuage of eval where nothing is to
be gained, more cargo-cult programming, and it will fuel the idea that
Perl is a hard to use language, with many quirks and requiring inside
knowledge to program in.

Please don't put things like this in the FAQ.



Abigail

Reply via email to