1

I have a code

use Tie::File::AsHash;
tie %sets, 'Tie::File::AsHash', '.\\main\\old_names.txt',  split => '\+' or die "Problem trying to %hash: $!";

and I get the error:

Can't locate Tie/File/AsHash.pm in @INC <@INC contains: C:/strawberry/perl/site/lib C:/strawberry/perl/vendor/lib C:/strawberry/perl/lib .> at C:\Users\user\Desktop\test.pl line 97 (which is the second line I posted)

BEGIN failed--compilation aborted at line 97.
Grigor
  • 4,139
  • 10
  • 41
  • 79
  • 1
    From the [Stack Overflow Perl FAQ](http://stackoverflow.com/questions/tagged/perl?sort=faq): [What's the easiest way to install a missing Perl module?](http://stackoverflow.com/questions/65865/whats-the-easiest-way-to-install-a-missing-perl-module) – daxim Jun 13 '12 at 08:49
  • when you're new to a language, it's hard to know the terms to search them dear critics – Grigor Jun 13 '12 at 14:34

1 Answers1

4

That usually indicates that the module isn't installed. One normally installs a module as follows:

cpan Tie::File::AsHash
ikegami
  • 367,544
  • 15
  • 269
  • 518
  • 1
    how would I install the module? – Grigor Jun 13 '12 at 04:52
  • 1
    On Fedora, [this syntax](https://developer.fedoraproject.org/tech/languages/perl/perl-modules.html) worked for me. E.g. `sudo dnf install 'perl(Tie::File::AsHash)'` – jozxyqk May 25 '22 at 06:54