in reply to large file issue?
You may also want to use system in a list context, as it is faster and more secure, for example:open(OUT,">outfile") || die; for($i=0;$i<=$#bigfile;$i++){ $bigfile[$i] =~ s/\0/ /g; print OUT "$bigfile[$i]"; } close(OUT); print "Compressing original file\n"; system("compress original.file") and die "Unable to compress data: $!\n"; print "Concatenating other data\n"; system("cat ./incoming/data.file ./static/data.file >> outfile") and die "Unable to cat data: $!\n"; print "Sorting Data File\n"; system("asort outfile clean.data 1 6 8 9") and die "Unable to sort data: $!\n"; print "Done.\n";
Lastly, your for loop isn't very perlish. You may want to try something like this:system("/path/to/asort","outfile","clean.data","1 6 8 9") and die "Unable to sort data: $!\n";
open(OUT,">outfile") || die "Unable to open outfile: $!\n"; foreach (@bigfile) { s/\0/ /g; print OUT "$_"; } close(OUT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: large file issue?
by merlyn (Sage) on Oct 26, 2000 at 01:45 UTC | |
|
RE: Re: large file issue?
by clearcache (Beadle) on Oct 25, 2000 at 22:13 UTC | |
by amelinda (Friar) on Oct 26, 2000 at 00:56 UTC | |
by Fastolfe (Vicar) on Oct 26, 2000 at 01:06 UTC | |
by and (Pilgrim) on Oct 26, 2000 at 04:09 UTC | |
by theorbtwo (Prior) on Jan 03, 2002 at 01:59 UTC |