kalkisong has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -T # Set variables ###################################################################### +####### $output_file = "../../cgi/generator/source-output.html"; #Chmod 766 ###################################################################### +####### #Pages to Scan ###################################################################### +####### my @files= qw| ../../page1.html ../../page2.html |; my @allfiles; for my $filename(@files){ open FILE, $filename || die "Cannot open $filename for reading: $!\n"; push @allfiles, $_ while (<FILE>); @lines = @allfiles; $line = @allfiles; close FILE; } #output generator ###################################################################### +####### open (OUTPUT,">$output_file") || die "Can't Open $output_file: $!\n"; printf OUTPUT "Generator CGI Tester\n\n"; s/\<[^\<]+\>//; foreach $line (@lines) { $print_flag = 0; s/\<[^\<]+\>//; #generator variables ###################################################################### +####### ###Image if ($line =~ m/<img src/) { $img = $line; printf OUTPUT "$img"; $print_flag = 1; } ###Form action if ($line =~ m/<input type=\"hidden\" name=\"description\"/) { $hidden = $line; printf OUTPUT "$hidden"; $print_flag = 1; } } close (OUTPUT); # Redirect browser to generated page print "Location: $output_file\n\n"; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: getting and printing form values etc from html stripping out all else
by pemungkah (Priest) on Feb 24, 2010 at 21:18 UTC | |
by kalkisong (Initiate) on Feb 24, 2010 at 22:17 UTC | |
|
Re: getting and printing form values etc from html stripping out all else
by ww (Archbishop) on Feb 25, 2010 at 02:13 UTC | |
|
Re: getting and printing form values etc from html stripping out all else
by Anonymous Monk on Feb 25, 2010 at 02:54 UTC |