$ perl -E 'use strict; use warnings; open my $fh, ">", "xxx"; close $fb; open my $fh, ">", "yyy"' "my" variable $fh masks earlier declaration in same scope at -e line 1. Global symbol "$fb" requires explicit package name (did you forget to declare "my $fb"?) at -e line 1. Execution of -e aborted due to compilation errors. ken@ganymede: ~/tmp $