#!/usr/local/bin/perl -w

$pattern = shift @ARGV;
while (<>) {
  if (m/($pattern)/) {
    print "$1\n";
    }
}
