Re: Another problem (sorry ;-) )

[email protected] Fri, 17 Sep 1999 14:24:07 +0100
Newsgroups perl.riscos
Message-ID <[email protected]>


Edits applied...

>  # lets list the directory called by $soh - (hardware or software)
> opendir('soh', "$soh") ;

opendir (SOH,"."); # you do not need the 's around the soh, and "." is "here" on
unix

> while (defined($menuitem = <$soh/*>)) {
 foreach $menuitem (<SOH>) {                  #simpler
> $menuitem =~ s#.*/##;                              # Does nothing

next if ($menuitem =~ /^\./);                        # skip "." and ".."

> # The next four lines gets rid of the .csv extension
> chop $menuitem ;
> chop $menuitem ;
> chop $menuitem ;
> chop $menuitem ;
# replace these with :

$menuitem =~ s/\..*//;               # removes all extensions whatever the
length

print  "<tr><td align=right>\n";
print  "<a href=\"mainscript.pl?soh=$soh&type=" . $menuitem . "\">\n";
print  "<font size=\"-1\">$menuitem<font>\n";
print  "</a></td></tr>\n";
}
closedir ('soh') ;

Have Fun

Richard Proctor (From Work)