Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Processing words in a file.

by vinoth.ree (Monsignor)
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. } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018299]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2016-12-09 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (152 votes). Check out past polls.