Nice, however it is not the same as the code of the OP. Consider the following code:
my $description = "windows and linux and solaris";
$os = $1 if ( $description =~ /(windows)/i );
$os = $1 if ( $description =~ /(linux)/i );
$os = $1 if ( $description =~ /(solaris)/i );
print $os;
$os = $1 if $description =~ /(windows|linux|solaris)/i;
print " $os\n";
Rata (knowing that this special case is probably excluded by an unwritten part of the spec)
|