in reply to Re^3: Easiest way to filter a file based on user input (updated)
in thread Easiest way to filter a file based on user input
I tried to implement the special number regex as such:
#!/usr/bin/env perl use strict; use warnings; use Regexp::Common; print "Enter limit: "; chomp( my $limit = <STDIN> ); $limit = abs($limit); open my $IN, '<', "xt_spacer_results.hairpin" or die $!; open my $SIFTED, '>', "new_xt_spacer_results.hairpin" or die $!; while (<$IN>){ next if /^None/; next if /^( $RE{num}{real}{-places=>2})/ && $1 > $limit; print $SIFTED $_; } close $IN; close $SIFTED;
But it aborts the program due to use Regexp::Common; and it states:
Can't locate Regexp/Common.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at energy_sifter2.pl line 4. BEGIN failed--compilation aborted at energy_sifter2.pl line 4.I'm not quite sure how to use modules. Do I download the module somehow and save it in the same file I'm working in?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Easiest way to filter a file based on user input (updated)
by hippo (Archbishop) on Jul 07, 2017 at 16:44 UTC | |
by Peter Keystrokes (Beadle) on Jul 10, 2017 at 12:55 UTC | |
by hippo (Archbishop) on Jul 10, 2017 at 13:05 UTC | |
by Peter Keystrokes (Beadle) on Jul 16, 2017 at 09:14 UTC | |
by haukex (Archbishop) on Jul 16, 2017 at 09:29 UTC | |
|