#! perl use strict; use warnings; use v5.14; sub make_add { my $addpiece = shift; sub add { my $c = shift; return ($c + $addpiece); } return \&add; } my $f1 = make_add(20); my $f2 = make_add(35); say $f1->(10); say $f2->(10); #### 2:40 >perl 1102_SoPW.pl Variable "$addpiece" will not stay shared at 1102_SoPW.pl line 9. 30 30 2:40 >