LFonseca has asked for the wisdom of the Perl Monks concerning the following question:
The problem here is the glob:sub dvdr1_readvarsfromfile { my($filename, $fn); &dvdr1_initblankvars; $filename=$numerodaficha; if (length($filename)<6){ if ($filename<10) {$filename="00000".$filename} elsif ($filename<100) {$filename="0000".$filename} elsif ($filename<1000) {$filename="000".$filename} elsif ($filename<10000) {$filename="00".$filename} elsif ($filename<100000) {$filename="0".$filename} } $codnum=$filename; if ($_[0] eq ""){ $filename=glob("$dvdr1orderdb_path\/$codnum.*"); } else{ $filename="$_[0]"; } open (DB, "$filename") || (&erro("$!") && die); $fn=$filename; ...
when I call:
&dvdr1_readvarsfromfile the first time, the glob always finds the correct file.
When I call it the second time, even though I'm looking for a different file, and the value of $numerodaficha is different, glob always returns blank. Why and how can I solve it?
Thanks!
Edit kudra, 2001-10-02 Moved plaintext out of code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: glob problem...
by jeroenes (Priest) on Oct 01, 2001 at 13:00 UTC | |
|
Re: glob problem...
by snowcrash (Friar) on Oct 01, 2001 at 13:09 UTC | |
|
Re: glob problem...
by LFonseca (Initiate) on Oct 01, 2001 at 15:10 UTC |