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

[MacPerl] Getting file list Unix/Mac



I'm trying to adapt an existing Unix Perl script to run under MacPerl
-- it's part of a file upload CGI that creates a pop-up menu of the
files in the folder to which the user has uploaded files. Everything
works but the snippet of code below. I'm trying to make as few
changes in the Mac version as I can -- but I'm assuming that the
problem here is the use of * as a wildcard for all files??  Is there
a cross-platform method of getting this list?

$i = 0; 
while ($name = <$upload_dir:*>) {
  $name =~ s#.*:##;
  $uploads{$i} = $name;
  $i++;
} 
@upload_names = sort values(%uploads);
@upload_names = ("Select file or type in URL
below...",@upload_names);

-- 
Bob Godwin-Jones   rgjones@vcu.edu
 Virginia Commonwealth University