#! /usr/bin/perl use strict; my $input; while () { ($input) = /(\w+)/; print "\$input=$input\t\$1=$1\n"; } __DATA__ Hello World