Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^3: Efficient file handling (was Re^3: trouble parsing log file...)

by Anonymous Monk
on Jul 05, 2009 at 03:09 UTC ( #777295=note: print w/replies, xml ) Need Help??

in reply to Re^2: Efficient file handling (was Re^3: trouble parsing log file...)
in thread trouble parsing log file...

OK, in light if this discussion, I have a similar problem.
I need help, I have a script that i am trying to do the following:
file1= list of unique ID numbers
file2= list of unique html code with the unique ID numbers within the code per line(about 16k-bytes each seperated by carage.
Both are standard text files.
#read each line in test1.txt into data_file array
open(DATA, $data_file) || die("Could not open file!");

#read each line in code.txt into a names_file array
open(NAMES, $names_file) || die("Could not open file!");

#create loop that reads each ID in code.txt (NAMES array), searches for each in array elements for #test1.txt (DATA array), redirects a new (NAMES).html for each element
foreach ( $NAMES )
($NAMES=$DATA<0> > +("$NAMES<0>.html"));

close NAMES;
close DATA;

I am new to perl but this is absolutely riddled with errors and I have written this according to examples of similar scripts.
  • Comment on Re^3: Efficient file handling (was Re^3: trouble parsing log file...)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://777295]
[usemodperl]: what the hell happened to the monastery?
usemodperl gets scolded by little old ladies on every dang post
[usemodperl]: did we get invaded by soy boys or what? it wasn't like this 20 years ago :-)
[usemodperl]: i can see the old tgimers hiding out on reddit! lol
[usemodperl]: no wonder this place is so... popular
[marto]: your account is 7 days old, how old are these 'old tgimers'?

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2018-06-24 15:43 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.