#!perl use strict; use warnings; $|++; my ($comp,$first,@sec); $comp = "descr is ".(defined $first ? q{$first} : 'null').' and list is '.( @sec ? q{join ' ', @sec} : 'empty'); print "Oringinal:$comp\n"; &modify_first('UNO'); &modify_second (1);&modify_second (2); &modify_first ('DUE'); &reset_second; sub modify_first{$first = shift; print "$comp\n";} sub modify_second {push @sec, shift; print "$comp\n";} sub reset_second {@sec=qw(); print "$comp\n";} __OUTPUT__ Oringinal:descr is null and list is empty descr is null and list is empty descr is null and list is empty descr is null and list is empty descr is null and list is empty descr is null and list is empty