in reply to Multiple condition split
See perlre. The first question is answered by "character classes". For example, [/()] will match a forward slash, an opening parenthesis or a closing parenthesis.
my @words = split m![/()]!, $line;
The second question can be answered for example by using positive lookahead. For example, (?=Ghz) will make sure that there is the word Ghz following the current position.
if ($line =~ m!(.*)(?=Ghz)!) { print "Found $1 with a 'Ghz' specification\n"; };
Thinking about it, you don't even need the positive lookahead.
|
|---|