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

Re: amateur at Perl need helpwith small script

by jwkrahn (Abbot)
on Sep 01, 2022 at 00:52 UTC ( [id://11146581]=note: print w/replies, xml ) Need Help??


in reply to amateur at Perl need helpwith small script

open(UPD, "<$data_file") or die "Cannot open $data_file (5Z)."; flock UPD,2; seek(UPD,0,0); @upd = <UPD>; close(UPD); chomp(@upd); foreach $line (@upd) { ($d_line) = split (/\n/, $line);

You are reading a text file into the array @upd and then you chomp the array which removes all newlines ("\n").

Inside the foreach loop you try to split the current line on newlines which do not exist because you have already removed them.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-16 21:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found