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