#!/usr/bin/perl -w use strict; my $temp = "Firstword and then the rest of the string"; $temp =~ /^(\w+)/i; my $firstword = $1; #### my $temp = "Firstword and then the rest of the string"; $temp =~ /^(\w+)([ \w]*)/i; my $firstword = $1; my $restofstring = $2;