A
AMT2K5
use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser set_message);
use CGI qwstandard);
use CGI:retty qwhtml3);
our $cgi = new CGI;
print $cgi->header(),
$cgi->start_html(-title=>'Aaron\'s MP3 Converter',
-background=>'1.gif',
-text=>"#A9A9A9"),
$cgi->h1({-align=>'center'},font({face=>"Verdana"},"Aaron\'s MP3
Converter")),
$cgi->p({-align=>'center'},"<font
face=\"Verdana\">Directory</font>",br),
$cgi->startform({-action=>"",-method=>"POST"}),
$cgi->p({-align=>'center'},
textfield({-name=>"directory",
-maxlength=>"72",
-default=>"",
-size=>"30"}),br,br,"<font face=\"Verdana\">Search
by</font>",br,
popup_menu({-name=>'search',
-values=>['Artist','Song','Album']}),br,br,"<font
face=\"Verdana\">Name</font>",br,
textfield({-name=>'name',
-maxlength=>'72',
-default=>'',
-size=>'30'}),br,br,
submit("Submit"),reset),
$cgi->endform(),
&search(),
$cgi->end_html();
sub search{
my $path = param('directory');
opendir(DIR, $path);
while (my $name = readdir(DIR)) {
h1("found file: $name"),
}
closedir(DIR);
}
What am I missing from this script, that simply reads in a directory
name on my unix account.
When I run the script and type in a real directory, I see a 1 in the
bottom left hand cornor of the screen, nothing if I dont. How can I
display the file contents? Or specifically all with the extension .mp3
use warnings;
use CGI::Carp qw(fatalsToBrowser set_message);
use CGI qwstandard);
use CGI:retty qwhtml3);
our $cgi = new CGI;
print $cgi->header(),
$cgi->start_html(-title=>'Aaron\'s MP3 Converter',
-background=>'1.gif',
-text=>"#A9A9A9"),
$cgi->h1({-align=>'center'},font({face=>"Verdana"},"Aaron\'s MP3
Converter")),
$cgi->p({-align=>'center'},"<font
face=\"Verdana\">Directory</font>",br),
$cgi->startform({-action=>"",-method=>"POST"}),
$cgi->p({-align=>'center'},
textfield({-name=>"directory",
-maxlength=>"72",
-default=>"",
-size=>"30"}),br,br,"<font face=\"Verdana\">Search
by</font>",br,
popup_menu({-name=>'search',
-values=>['Artist','Song','Album']}),br,br,"<font
face=\"Verdana\">Name</font>",br,
textfield({-name=>'name',
-maxlength=>'72',
-default=>'',
-size=>'30'}),br,br,
submit("Submit"),reset),
$cgi->endform(),
&search(),
$cgi->end_html();
sub search{
my $path = param('directory');
opendir(DIR, $path);
while (my $name = readdir(DIR)) {
h1("found file: $name"),
}
closedir(DIR);
}
What am I missing from this script, that simply reads in a directory
name on my unix account.
When I run the script and type in a real directory, I see a 1 in the
bottom left hand cornor of the screen, nothing if I dont. How can I
display the file contents? Or specifically all with the extension .mp3