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

[MacPerl] IO:: problems



According to Ramesh-CRR026 Ramakrishnan:
> #!perl -w
> 
> use IO::File;
> 
> print "Droped @ARGV\n";
> $FileName = $ARGV[0];
> # Uncomment the following to change ":" to "/"
> #$FileName =~ s/:/\//g;
> print "FileName = " . $FileName . "\n";
> $File = new IO::File "$FileName", "r" or die $!;
> print "FileRef = " . ref($File) . "\n";
> print $File->getline . "\n";
> $File->close;

After just glancing at this code I came up with a question:

You can't open the file you are executing at the same time
you are attempting to execute the file can you?  Wouldn't
that give you an error?  If so, then try making the
$FileName line look like this:

$FileName = "myfile.dat";

and then (of course) actually making myfile.dat.  (I'm not
on my Mac at home so I can't try this out right now.)

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch