in reply to Multiple condition split
A. Use split with a regex that uses a character class (see Regular Expressions).
B. Use the match operator m// to capture (see perlretut and perlre) the bit you're interested in.
my $str_A = q{Camedia C-730 UltraZoom\UZoom/UZ (White)}; my @words_A = split m{[-\\)\(/ ]+}, $str_A; print "$_\n" for @words_A; my $str_B = q{Acer Laptop XXYYY00MM 2.0 Ghz is an amazing piece}; my ( $words_B ) = $str_B =~ m{(.*Ghz)}; print "\n$words_B\n";
Outputs:
Camedia C 730 UltraZoom UZoom UZ White Acer Laptop XXYYY00MM 2.0 Ghz
|
|---|