Skip to content

Instantly share code, notes, and snippets.

@smujohnson
Created October 19, 2012 01:32
Show Gist options
  • Save smujohnson/3915767 to your computer and use it in GitHub Desktop.
Save smujohnson/3915767 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
my $delim = ":";
my $field = 4;
my $grep_string = "something";
while (<STDIN>) {
my @chunks = split(/\Q$delim/);
next if @chunks < $field + 1;
if (index($chunks[$field], $grep_string) != -1) { print }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment