http://qs321.pair.com?node_id=243048


in reply to regex needed

You have delimited data and want to extract one component. split is usually the correct way to deal with delimited data.

You don't like entering all those extra variables when you only want one of the values? Then assign to an array and extract the component you want from the array.

my @array = split /:/; # the $_ is implied my $foo = $array[1];

You can make this shorter by eliminating the temporary array.

my $foo = (split /:/)[1];
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';