[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-AnyPerl] How to test if a file is a directory?



Dear MacPerl Gods & Goddesses:

I want to write the following piece of code:

##############################################

$dir = " # Some Mac Directory # ";
chdir("$dir");
@files = <*>;

foreach $file (@files)
{
    if ( # is it a directory? # )
    {
        print "$file is a directory\n";
    }

    else 
    {
        print "$file is a file\n";
    }
}

#############################################

Would you please clue me in on what to put in my "if" statement?
--
Robert Terwilliger, M.S.
raterwil@ucla.edu



==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org