#!/usr/bin/perl -l use strict; use warnings; our $x = 3; foo(7); sub foo { local $x = shift; print $x; # is there any way to get the "3" value? }