#!/usr/bin/perl -- use strict; use warnings; my $str = "foo"; my $copy = $str; print "$copy $str\n"; nocopy($str); yescopy($str); print "$copy $str\n"; # now $str is foobar sub nocopy { $_[0] .= 'bar'; '...' } sub yescopy { my ($copy) = $_[0]; $copy = shift; $copy .= 'bar' } __END__ foo foo foo foobar