in reply to Re^2: get array number
in thread get array number

You wrote:
I still need to know postcode or other value is in which array. Is there any way to do it?
Of course there is some way :) We know that postcode is consists of numbers only, name does not include any number, and adress is words & numbers.
So.. that is draft code for You.
my @file; $file[0]="Alexey;123456789;USA some state some street home # 12\n"; $file[1]="20102020;Nikola;Russian Federation some state some street ho +me # 13\n"; $file[2]="England some state some street home # 14;5545487987;Max\n"; my @sorted_values; foreach $file_string(@file){#like your while(<>) chomp $file_string; my @string_values=split/;/,$file_string; my $sorted; foreach (@string_values){ if (/\D/ && !/\W/ ){#This is name $sorted->{NAME}=$_; }elsif(/\D/ && /\W/){#This is adress $sorted->{ADRESS}=$_; }else{#This is postcode $sorted->{POSTCODE}=$_; } } push @sorted_values, $sorted; } foreach (@sorted_values){ print "NAME: $_->{NAME} ADRESS: $_->{ADRESS} POSTCODE: $_->{POSTCODE} +\n"; }