sub old_code { my $self = shift; my $file = shift; if (-e $file) { open(my $fh, "<", $file) or die "cannot open < $file: $!"; # Do something with the file return 1; } else { die "$file not found"; } };