GaijinPunch has asked for the wisdom of the Perl Monks concerning the following question:
So, I know the file is there, and that it's readable. I even tried Tie::File in another smaller, simpler script and it worked fine, so I know the module works. It works on 2 other machines I've tried it on. So... I'm stuck pulling my hair out.#/usr/bin/perl # use strict; use warnings; my $file = "file.txt"; my @lines; tie @lines, 'Tie::File', $file || die $!; open ( IN, "$file" ) || die "can't read file $!"; #See if tie worked foreach ( @lines ) { print "$_\n"; # prints nothing } print "$#lines\n"; # prints -1 while ( <IN> ) { print "$_\n"; #prints out each line }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tie::File is sucking the life out of me
by davido (Cardinal) on Apr 27, 2004 at 05:01 UTC | |
by GaijinPunch (Pilgrim) on Apr 27, 2004 at 07:09 UTC | |
by davido (Cardinal) on Apr 27, 2004 at 07:24 UTC | |
by GaijinPunch (Pilgrim) on Apr 27, 2004 at 08:20 UTC | |
by davido (Cardinal) on Apr 27, 2004 at 08:32 UTC | |
| |
|
Re: Tie::File is sucking the life out of me
by jeffa (Bishop) on Apr 27, 2004 at 05:05 UTC |