in reply to Re: Re: Re: how to dynamically declare a varialble?
in thread how to dynamically declare a varialble?
Well it depends on what do you do. If you have code like this:
then it's definitely better (and fairly easy) to change the code and assign the matches into an array. If you have something like:if (/regexp/) { no strict 'refs'; my $i = 1; while (defined ${$i}) { ... } }
it ain't that trivial.$text =~ s{regexp}{ no strict 'refs'; my $i = 1; while (defined ${$i}) { ... } ... }ge;
Jenda
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
-- Rick Osborne
Edit by castaway: Closed small tag in signature
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: how to dynamically declare a varialble?
by dragonchild (Archbishop) on May 24, 2004 at 16:27 UTC |