use Data::Dumper; my @test = qw/hello world/; print Dumper( map { s/o// } @test ), "\n"; print Dumper( map { s/o//; $_ } @test ), "\n";