Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
go ahead... be a heretic
 
PerlMonks  

Re: Processing words in a file.

by vinoth.ree (Vicar)
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2014-04-18 11:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (466 votes), past polls