in reply to Re^2: Checking status of implicit open (diamond operator)
in thread Checking status of implicit open (diamond operator)
You're localising $^I and @ARGV, localise $SIG{__WARN__} also:
sub inplace{ my @files = @_; local($^I, @ARGV)=(".bak", $file); # Now i can use <> local $SIG{__WARN__} = sub{ ## Handle open errors here }; while(<>){ local $SIG{__WARN__}; # disable it for loop body # do stuff on $_ print; } }
|
|---|