Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- use feature 'say';
- exit unless @ARGV == 2;
- my ($path, $search) = @ARGV;
- open my $in, '<', $path or die;
- while (<$in>) {
- chomp;
- while (/$search/g) {
- say "$-[0] -- $+[0]";
- }
- }
- close $in;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement