in reply to Re: Re (tilly) 4: Quick Regex question
in thread Quick Regex question
(For the record I usually avoid writing CGI...don't laugh at what it looks like...)#! /usr/local/bin/perl -T use strict; use CGI qw(:standard upload); use HTML::Entities; print header(), start_html('Upload Test'), h1('Upload Test'), start_multipart_form(), "Enter how many files to upload: ", textfield("filecount"), br(); for my $i (1..param('filecount')) { print "File $i: ", filefield(-name => "file$i"), br(); } print submit(); for my $file (sort grep /file/, param()) { print p(); my $handle = upload($file); unless (defined($handle)) { if ($file =~ /(\d+)/) { print h3("File request $1 did not return a handle\n"); } next; } print p(), h3("Uploaded $handle"), br(), "<pre>"; print encode_entities($_) while <$handle>; print "</pre>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re (tilly) 6: Quick Regex question
by Stamp_Guy (Monk) on Jan 14, 2001 at 09:44 UTC | |
by tilly (Archbishop) on Jan 14, 2001 at 18:29 UTC | |
by Stamp_Guy (Monk) on Jan 14, 2001 at 21:25 UTC | |
by tilly (Archbishop) on Jan 14, 2001 at 23:22 UTC | |
by Stamp_Guy (Monk) on Jan 15, 2001 at 01:10 UTC | |
|