[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] TMTOWTDI



Vicki Brown wrote:
> 
> #    3) stuff the returned data into a large string variable, split it, and
> #       foreach across the result
> 
>           $result = `command`;
>           @lines = split(/\n/, $result);
>           foreach $line (@lines) {

This would be the absolute last way I would do it, when

    @lines = `command`;
    for $line (@lines) {

would do.  But I would usually use 2) since it's not the memory hog that
3) is and it doesn't require two passes like 1).  What do I win?

-- 
Rick Delaney
rick.delaney@home.com

==== Want to unsubscribe from Fun With Perl?
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org