Title: Win32/Unix File differences
Now *I* may not be making any sense, but it seems to me that Example 1 is globbing as well, but it's only going to get file/directory entries that start with <anything> and end in "test.pl".  It's certainly not code that I would use to walk a directory tree.
-----Original Message-----
From: John Drabinowicz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 08, 2002 10:37 AM
To: [EMAIL PROTECTED]
Subject: Win32/Unix File differences

Hi Gang,

I'm curious,

I just got the O'Reilly "Learning Perl on Win32 Systems" book and have a question about
using the directory/file structure.

This book says that I can walk the directory as shown is example 1, but I have been using example 2.

Now I have Cygwin installed on my computer and was wondering if example 2 works because of that,
or if it just works on Win32 systems. I'm trying to keep the code as generic as possable, and would
like the code to work on both platforms.

I hope I'm making some sense ;->

===Example 1====================================
foreach $file ( <*test.pl> )
{
    print "$file\n";
}

===Example 2====================================
foreach $file ( glob "*.*" )
{
    print "$file\n";
}

Thanks,

John D.

Reply via email to