sub get_file { my $name = shift; my $no_backup_flag = shift; unless ($no_backup_flag) { my $suffix = "aaa"; $suffix++ while -e "$name.$suffix"; local $^I = ".$suffix"; local $/ = \4096; local *ARGV; @ARGV = $name; print while <>; } local *ARGV; @ARGV = $name; local $/ = wantarray ? $/ : undef; # act like `` in scalar vs list context <>; }