perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael A. Capone" <mcap...@cablewholesale.com>
Subject Re: How to get a file listing
Date Thu, 18 Feb 2010 19:51:40 GMT
#!/usr/local/bin/perl

chdir("/path/to/my/directory");

while($filename=<*.gif>)
{
    print "$filename\n";
}

# Enjoy!

 
ceauke wrote:
> Hi guys
>
> I wanted to do a simple script to show all pictures in a specific folder.
> But I don't see any functions to read all files in a folder.
>
> The logic needs to go something like this:
> - Open directory to read file list
> - If file like *.gif then print  filename 
>
> Any tips?
>   

Mime
View raw message