Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Openind file for read+append

by jaldama (Acolyte)
on Feb 09, 2012 at 18:45 UTC ( [id://952810]=note: print w/replies, xml ) Need Help??


in reply to Re: Openind file for read+append
in thread Openind file for read+append

I'm having trouble matching strings in the file I'm opening. I just have it opening the file for reading now, because I"m trying to figure out what is going wrong. Is there something obvious that I am missing? It never matches the string on that file even though it IS there.

open FILE,'/Users/j/Desktop/test.log'; while (<FILE>) { chomp; #check for duplicate file if ($_ =~ m/appending/) { print "Looks like the data you entered is already on file\n"; close (FILE); } else { print "hey hey success\n"; close (FILE); &append; } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-18 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found