in reply to Re^6: Splitting a long row with multiple delimiters.
in thread Splitting a long row with multiple delimiters.

OK try

#!perl use strict; use Data::Dumper; my $str = 'eab12345 a b c id=00000 x= pgrp=abc=defgh groups=abcdefgh a +nd more roles='; my @f = split / (\w+=)/,$str; my @array = (); while (@f){ my $k = shift @f; if ($k =~ /=$/){ my $v = shift @f; push @array,"$k$v"; } else { # key no equal push @array,"$_=" for split /\s+/,$k; } } print Dumper \@array;