in reply to Split criteria

Which comma inside ! ! do you wish to retain? There is a comma inside !,! too. You need to disambiguate the comma somehow.

Perhaps:
my $line = q(!A001ST!,!AD,CD!,!1!,!20/05/2004!,!ANDORRA!,!0!,!EUR,USD! +,!6!,!7!,!0!,!AD!,!1!); # assume fields begin and end with ! ! my @data = $line =~ /^!(.*)!$/ && split(/!,!/, $1);