in reply to regex question
You say you're use split later so I'll assume you want an array as a result:
my %convert = ( A => 1000, B => 2000, C => 3000, ); my @data = map $convert{ $_ }, $input =~ /[ABC]/g; [download]