Karsten Borgwaldt wrote:
>
> Hi all,
>
> can anybody tell me, why I can't push any read values into an array?
>
> my code is:
> ..
> ..
> ..
> opendir(IN, "some_path") || die "opendir: $!";
> rewinddir(IN);
> while (defined($_ = readdir(IN)))
> {unless (m/^\.{1,2}$/ or not m/'.foo'$/) # all files, that are not "." or ".." and
>that end ".foo"!
> {push(@my_array, $_;}
typo or copy problem that you don't close 'push (' ?
> }
did you try
opendir(IN, "the_dir") || die "opendir: $!";
rewinddir(IN);
while ($_ = readdir (IN))
{
if (m/^\.{1,2}$/ or m/'.foo'$/)
{
print STDERR "wrong file ($)\n";
}
else
{
print STDERR "here's a file ($_)\n";
}
}
to see if it ever finds any files?
/Jon
> ..
> ..
> ..
> I get no errors, but nothing happens.
> If I insert the line
>
> foreach $item (@my_array) {print "$item";}
>
> I get no errors, too, but no values are printed.
> Allthough I know there are files in that directory.
>
> Thank you for all suggestions.
>
> Karsten
> ________________________________________________________________
> Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr!
> Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]