in reply to Not my first program, but the first I'll share...
can be written in one line as follows:my $request=$ENV{'QUERY_STRING'}; $request=~/([-\w_]+\.($ext))/g; my $file=$1;
And also the in code -my ($file) = $ENV{'QUERY_STRING'} =~ /([-\w_]+\.($ext))/g;
You can drop the $_ =~ part as it is not necessary (to save a few keystrokes)foreach(@code){ $_=~s/</</g; $_=~s/>/>/g; }
If you want to improve your Perl programming skills, you should learn to use CGI and HTML::Template as these powerful modules can make CGI programming really easy.foreach(@code){ s/</</g; s/>/>/g; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Not my first program, but the first I'll share...
by pekkhum (Sexton) on Oct 28, 2003 at 00:48 UTC |