Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

muba's scratchpad

by muba (Priest)
on Jun 01, 2004 at 18:05 UTC ( #358330=scratchpad: print w/replies, xml ) Need Help??

# Line 20-24 my $year = $cgi->param('year') ? encode_entities($cgi->param('year +'), '<>"') : ''; my $media = $cgi->param('media') ? encode_entities($cgi->param('medi +a'), '<>"') : ''; my $genre = $cgi->param('genre') ? encode_entities($cgi->param('genr +e'), '<>"') : ''; my $source = $cgi->param('source') ? encode_entities($cgi->param('sour +ce'), '<>"') : ''; my $title = $cgi->param('title') ? encode_entities($cgi->param('titl +e'), '<>"') : '';
# How I'da dunnit: my %param = map { $cgi->param($_) ? ($_ => encode_entities($cgi->param($_), '')) : () } qw(year media genre source title);
# Line 33-39: if ( $year || $media || $genre || $source || $title ) { my @selections; push @selections, qq($title) if $title; push @selections, qq($year) if $year; push @selections, qq($media) if $media; push @selections, qq($genre) if $genre; push @selections, qq($source) if $source; ...
# How I'da dunnit: if (keys %param) { my @selections = values %param; ...

As for verything from line 82 onward, i.e. the whole page(...) thing, I'd look into a templating system. Template Toolkit follows the Perl philosophy (easy things easy, hard things possible) pretty neatly in my opinion.

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[Corion]: thezip: start "some title" path\to\that\ application, but that will open another console window
[Corion]: thezip: If you want to confuse your users, use system(1, "that\\command" );, which will make Perl launch it in the background
[Corion]: That will keep the console window open even though the user can't type into it anymore
[thezip]: So I have a script that generates a log file. After script completion, I want tohave VIM open this logfile.
[thezip]: i don't get the command line "back" until I close VIM. No what I want to happen...
[thezip]: I currently don't have access to CYGWIN, else I'd just do a tail -f on the logfile.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2017-03-27 18:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (321 votes). Check out past polls.