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

[MacPerl] IO:: problems



Hi!

Replaced by IO::Handle & Co.? Just tried to change my FileHandle code to
IO::Handle, but it doesn't act according to the documentation. The
documentation says I can open a file by adding the file name as a parameter
to the new method, but examining the code shows that the new method only
accepts one parameter, the class name. It doesn't have a open method either,
again contradicting the documentation.

Next I tried the IO::File module. It opened my files which are in the current
directory easily, but any file names that have paths embedded in them are not
opened. The error message is "# No such file or directory". If I change the
":" in the path to "/", it complains that the "# File name too long" for
files inside folders in the HD but "# No such file or directory" for files in
the root level of the HD.

Here's my test code:

#!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;

I made this code a droplet in my testing. Just change IO::File to IO::Handle
to test the IO::Handle code.

I'm running MacPerl 5.1.3r2. I hope <shudder> I'm not running an old version
of the library.

Best regards,
Ramesh

_______________________________________________________________________________
I'd have to look at the details. FileHandle does not really
exist anymore, it is now replaced with IO::Handle & Co., but
some backwards compatibility should exist.

What is the message you get?


Matthias

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