in reply to how to split a string at [ ?
Maybe a better approach instead of split is to match the things you want?
$temp =~ /BCInletTemperature = ([\d.]+)\[C\]/ or die "Invalid temperature format in '$temp'"; my( $inletTemperature ) = $1;
In general, both, split and the matching deal with regular expressions. See perlre on how to use them and on how to escape meta-characters.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to split a string at [ ?
by blaui (Initiate) on Jul 06, 2018 at 12:29 UTC | |
by Corion (Patriarch) on Jul 06, 2018 at 13:44 UTC |