# Open a handle only if it's not opened. sub my_sub { open $_[0], '<', $_[1] if !$_[0]->opened; }