![]() |
|
go ahead... be a heretic | |
PerlMonks |
processing a file once within a nest for loopby c (Hermit) |
on Feb 15, 2002 at 14:18 UTC ( #145680=perlquestion: print w/replies, xml ) | Need Help?? |
c has asked for the wisdom of the Perl Monks concerning the following question:
i ran into an interesting problem this morning that i was able to fix, but leaves me thinking that the script does a little more processing than it should/i want it to. my code:
now, it makes sense that this works for the first value in @sub, but doesnt work for the remaining two, since each of the files opened will be written out with the first instance in the for $i loop, meaning that subsequent matches of DOMAIN won't be found. its easily remedied by matching against \w+ rather than an explicit DOMAIN, however, i end up processing more than i would like. when my @subs lists gets *very* long, that could be a bad thing. i continue to loop over it in my head, but i am not sure of the right way to do this. thanks -c
Back to
Seekers of Perl Wisdom
|
|