#! /usr/bin/perl use strict; use warnings; my @array = qw( a b c ); print "@array\n"; for my $elem ( @array ) { # overwrite element in @array $elem = 1; } print "@array\n";