my $re = shift or die "re expected\n"; while (<>) { chomp; my ($field, $value) = ($_ =~ $re); print "'$_' -> ('$field', '$value')\n"; }