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

[MacPerl] Bugs in StandardFile.pl? GET/PUT file dialogs



(crossposted to both TOOLBOX,and MACPERL lists)
I've been working on a couple of scripts that needed more flexibility than
hard coded paths. I dug a couple of examples out of the "mac" folder in the
MacPerl folder of a GETFILE and  a PUTFILE dialog which I adapted for my
needs.

However as soon as the script starts up, I get some odd errors thrown up
before the GETFILE dialog (the first to be called) appears . Aside from
this the script does as it's expected it opens the requested file, and
saves the file according to the choices made in the PUTFILE dialog - with
the exception that I can't seem to catch the "CANCEL" event from the PUTFILE

Is this a bug in  StandardFile.pl ?

##--the offending dialogs:

      #!/usr/bin/perl -w

      use strict;
      use Mac::Files;
      require "StandardFile.pl";
      $|=1; #tells $| to let rip and spew stuff as fast as it can be
politely received
      my($text,$path,$output );


#getfile dialog
      $text= &StandardFile::GetFile("TEXT");
      print"$text\n";

#putfile dialog
      $path=`pwd`;
      $output = &StandardFile::PutFile("what shall we call it?", "::new.file");
      print "$output\n";


##--the error messages:

# Use of uninitialized value.
File 'HD:MacPerl Ÿ:lib:StandardFile.pl'; Line 42
# Use of uninitialized value.
File 'HD:MacPerl Ÿ:lib:StandardFile.pl'; Line 48
 (generated at before the GETFILE window is opened)



# Use of uninitialized value.
File '<AppleEvent>'; Line 18
(generated by pressing the CANCEL button on the PUTFILE dialog)

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