[.courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Cameron Elliott <cam@indy.mvbms.com> writes:
:I am writing an HTTP daemon in perl, and am having a problem
:removing a memory leak.
:
:
:Hence the following program:
:#!/usr/local/bin/perl
:
:for(;;) {
:$test = 'This is a simple program';
: $test =~ s/simple/5+5/ee;
:}
:
:
:This puppy eats memory like there is no tommorow, please help me
:solve this.
:(I do need the double 'ee' functionallity, which is the problem)
While that's probably a bug, be apprised that most /ee functionality can
be achieved via careful closures and /e.
$foo = '$1 + $2';
s/(\d+)\s+(\d+)/$foo/ee;
Could have been
$foo = sub { $1 + $2 };
s/(\d+)\s+(\d+)/&$foo/;
--tom
In comp.lang.perl.misc,
Cameron Elliott <cam@indy.mvbms.com> writes:
:I am writing an HTTP daemon in perl, and am having a problem
:removing a memory leak.
:
:
:Hence the following program:
:#!/usr/local/bin/perl
:
:for(;;) {
:$test = 'This is a simple program';
: $test =~ s/simple/5+5/ee;
:}
:
:
:This puppy eats memory like there is no tommorow, please help me
:solve this.
:(I do need the double 'ee' functionallity, which is the problem)
While that's probably a bug, be apprised that most /ee functionality can
be achieved via careful closures and /e.
$foo = '$1 + $2';
s/(\d+)\s+(\d+)/$foo/ee;
Could have been
$foo = sub { $1 + $2 };
s/(\d+)\s+(\d+)/&$foo/;
--tom