Skip to content

Instantly share code, notes, and snippets.

@exodist
Created December 15, 2015 19:42
Show Gist options
  • Save exodist/85e25057504c4859e9a9 to your computer and use it in GitHub Desktop.
Save exodist/85e25057504c4859e9a9 to your computer and use it in GitHub Desktop.
uhg...
use strict;
use warnings;
local $! = 100;
print '$! == ' . int($!) . "\n";
{
local $! = $!;
print '$! == ' . int($!) . "\n";
open( my $out, ">&STDOUT" ) or die "Can't dup STDOUT: $!";
print '$! == ' . int($!) . "\n";
open( my $err, ">&STDERR" ) or die "Can't dup STDERR: $!";
print '$! == ' . int($!) . "\n";
}
print '$! == ' . int($!) . "\n";
__END__
$! == 100
$! == 0
$! == 29
$! == 29
$! == 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment