Re: Another problem (sorry ;-) )

[email protected] (Nik Gare) Fri, 17 Sep 1999 16:01:25 +0100
Newsgroups perl.riscos
Message-ID <[email protected]>
In article <[email protected]>,
   <[email protected]> wrote:

> 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

So how would I list a subdirectory defined by $soh, ie the hardware or
software directory?

> > 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

I sort of knew that using 4 chops in a row couldn't be good ;-)


> 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
I am!!

Nik Gare (from home)

-- 
[email protected]
http://www.cheddarcheese.webprovider.com
( http://www.cheddarcheese.de when my provider lets me use perl scripts )

-- 
[email protected]
http://www.cheddarcheese.webprovider.com
( http://www.cheddarcheese.de when my provider lets me use perl scripts )