Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Processing words in a file.

by vinoth.ree (Prior)
on Feb 12, 2013 at 05:39 UTC ( #1018299=note: print w/ replies, xml ) Need Help??

in reply to Processing words in a file.

I guess you need first word of each line from the file

use strict; use warnings; open FH, '<', "filename.txt" or die "Can not open file $!"; while(<FH>) { my ($first_word) = $_ =~ /^(\w+)/; if ($first_word eq 'your string') { #Your wish. } }

Comment on Re: Processing words in a file.
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2015-11-29 17:32 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (751 votes), past polls