use strict; use warnings; use v5.10.1; my @arr= qw (10 10 20 0x47 1 30 45 45); my @converted = grep $_ !~ /'/, @arr; foreach my $element (@converted) { my $num = sprintf "%d", $element; print "$num\n"; }