Home > Archive > PERL Beginners > September 2006 > Problem with Tie::File
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problem with Tie::File
|
|
| HAMISH 2006-09-26, 7:57 am |
| I am trying to mess around with Tie::File
for some reason which is probably really silly i get the following
error.
"Can't locate object method "TIEARRAY" via package "Tie::File""
I have tried many things. Can someone please guide me in the right
direction of fixing this simple problem.
My code that produced that error was
#!/usr/bin/perl
use Tie::File;
use strict;
use warnings;
my $data_file = "variables.txt";
my $file = "variables.txt";
tie my @data_file, 'Tie:File', $data_file or die "Could not tie the
array to the data file:$data_file $!";
Thanks
| |
| HAMISH 2006-09-26, 7:57 am |
|
HAMISH wrote:
> I am trying to mess around with Tie::File
>
> for some reason which is probably really silly i get the following
> error.
>
> "Can't locate object method "TIEARRAY" via package "Tie::File""
>
> I have tried many things. Can someone please guide me in the right
> direction of fixing this simple problem.
>
> My code that produced that error was
>
> #!/usr/bin/perl
>
> use Tie::File;
> use strict;
> use warnings;
>
> my $data_file = "variables.txt";
> my $file = "variables.txt";
>
> tie my @data_file, 'Tie:File', $data_file or die "Could not tie the
> array to the data file:$data_file $!";
>
>
> Thanks
I knew it was silly 'Tie:File', should be Tie::File
|
|
|
|
|