#!/usr/local/perl $test = " foo bar"; ($var1, $var2) = ($1, $2) if ($test =~ /\s+(\S+)\s+(\S+)/); print "Var1: $var1\nVar2: $var2"; exit;