#! /usr/bin/perl -w $file = "/var/spool/mail/mohadib"; open(MAIL, "$file") || die "cant open spool\n"; @array = ; close (MAIL); foreach $array (@array){ if($array !~ /[A-Za-z0-9]/){ @num = (1 .. 3); foreach $num (@num){ $current = $new + $num; print "$array[\"$current\"]"; } } $new++; }