my @files = glob( '2005*@*.log' ); die "No files found\n" unless @files; open(OUTPUT, ">output" ) or die "Unable to open output\n$!\n"; foreach my $file (@files) { open( MYFILE, $file ) or die "Unable to open $file\n$!\n"; while (<MYFILE>) { # parse print OUTPUT $parsed_output; } close (MYFILE) or die "Unable to properly close $file\n$!\n"; } close(OUTPUT);
In reply to Re: how do i parse multiple files and write all of the results into single file
by Transient
in thread how do i parse multiple files and write all of the results into single file
by my_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |