in reply to Remove from character to end of line
my @lines = qw[ 9077/00:00///:8087 9079/00:00/////386/_]; my @erg; foreach (@lines){ s/([^\/]*)//; push @erg, $1; } # erg contains all segments you wanted
update: damn, whenever I wrote and tested my examples, there are a bunch of so much cooler solutions....way to go tomte, way to go...:-)
update_ii: s/$1 @erg/@erg, $1/
|
|---|