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

Re: [MacPerl] Newbie question ....



On 10/22/96 Drew Linsalata wrote:

>If I want to parse a tab
>delimited text file by dropping that file on a Perl app, how do I get my
>script to take its input from the file we drop on it?  Discussion of STDIN
>abounds, but I have to admit I'm a bit stumped on how to do this using drag
>and drop.

Here is some minimal code that works for me:

  while (@ARGV > 0) {              # drag and drop file(s) on Mac droplet
                                 # or from command line under MSDOS, UNIX
    local $infile = shift(@ARGV);

    if (-d $infile)
    { &climb_dir($infile); }       # climb if directory
    else
    { &read_file($infile); }       # read if file
  }

__________________________________________________________________________
  Richard Rathe, MD                              rrathe@dean.med.ufl.edu
  University of Florida                  http://www.med.ufl.edu/medinfo/