in reply to Re: Re: files
in thread Read and Combine Range of Two Files (was files)
WARNING!!! This example doesn't use taint in order to make it more readable. In a real script you should always use taint.
use CGI; my $q = new CGI; # Get a CGI object open (OUT, ">$q->param('outfile')") || die $!; # Open our output file my @files = grep{/^file\d+$/} $q->param(); # Grab a list of params for my $filename (@files){ open (IN, $q->param($filename)) || die $!; # Open each input file print OUT <IN>; # Print the input file to the output file close (IN); # Make sure you close the input file } close (OUT);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: files
by A_CAR11 (Initiate) on Jun 14, 2002 at 20:42 UTC |