$index =~ m"(.*?): (.*)"; my $key = $1; my $val = $2; #### my $key=''; my $value=''; if ($index =~ m"(.*?): (.*)") { $key = $1; $val = $2; } #### 'boo!' =~ /(.*)/; $test_string = "this is a test sentence."; $test_string =~ /(\w+)$/; my $last_word=$1; print "$last_word\n";