The stupid question is the question not asked | |
PerlMonks |
Re: CGI Directory Listerby snowcrash (Friar) |
on Jul 25, 2001 at 09:36 UTC ( [id://99574]=note: print w/replies, xml ) | Need Help?? |
hi! your main problem seems to be that the code in the while loop doesn't get executed: ($file == "." || "..") is not the same as ($file eq "." || $file eq ".."), as the string constant </code>".."</code> evaluates true all the time and the whole expression is true. you have to use eq if you compare strings, == is the operator to compare numerical values! always use the -w option in the shebang line (/path/to/perl -w) or use warnings; to to enable warnings, to notice nasty litte bugs! Change that line in your code to something like this: hope to help, snowcrash //////
In Section
Seekers of Perl Wisdom
|
|