develooper Front page | perl.beginners | Postings from January 2002

reading from directories => no values

Thread Previous | Thread Next
Karsten Borgwaldt
January 9, 2002 07:29
reading from directories => no values
Message ID:
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: $!";
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, $_;}
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.

Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr! 
Beim WEB.DE Lottoservice:

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About