in reply to Array as LHS on string match
my $line=' this or that '; my @patterns= ( $line =~ /\s*(\S*)\s*(\S*)\s*(\S*)/ ); print join('-',@patterns); # prints this-or-that [download]