my @x = map {sprintf("%02x",$_)} 45..48; # --becomes--> my @y; for (45..48) { push @y, sprintf("%02x",$_); } # --becomes--> my @z; for my $val ( 45 .. 48 ) { push @z, sprintf "%02x", $val; }