Skip to content

Instantly share code, notes, and snippets.

@kulp
Created July 19, 2010 19:24
Show Gist options
  • Save kulp/481851 to your computer and use it in GitHub Desktop.
Save kulp/481851 to your computer and use it in GitHub Desktop.
findfield.pl
#!/usr/bin/env perl
use strict;
my @n = sort { $a <=> $b } @ARGV;
my %n = map { $_ => 1 } @n;
my $line = <STDIN>;
for my $i (0 .. $n[-1]) {
print 0 + pos $line, " " if $n{$i};
$line =~ /\G\s+X+/gc;
}
print "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment