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

reading from directories => no values

Thread Previous | Thread Next
From:
Karsten Borgwaldt
Date:
January 9, 2002 07:29
Subject:
reading from directories => no values
Message ID:
200201091529.g09FTMC07392@mailgate5.cinetic.de
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, $_;}
}
..
..
..
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



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About