#! /usr/bin/env perl use strict; use warnings; use 5.020; # Prototype defines, we expect ONE argument and we pass it by reference # (the user doesn't need to reference it herself) sub function (\$) { my ( $ref ) = @_; $$ref = "Hallo Welt"; } my $foo = "Hello World"; say "VORHER: $foo"; # see, no reference by user here (\$foo)! function($foo); say "NACHHER: $foo"; __END__;