Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Processing slurped file.

by arturo (Vicar)
on Sep 18, 2001 at 18:40 UTC ( [id://113128]=note: print w/replies, xml ) Need Help??


in reply to Processing slurped file.

This suggestion certainly won't help your efficiency, but simply grepping for lines that match /LONDON/ doesn't meet your specs. How important the difference is, I don't know, but to meet those specs (and assuming $n holds the number of the field you want):

my @london = grep { (split /\t/)[$n] =~ /LONDON/ } grep { /LONDON/ } @ +records;

This would only perform the split on the members of @records that matched somewhere.

perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://113128]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-24 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found