Created
July 28, 2014 14:41
-
-
Save churib/90333672cf79421ceb6c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
package Foo; | |
sub new { | |
my( $class, $hash ) = @_; | |
return bless $hash, $class; | |
} | |
sub p { | |
my ($self) = @_; | |
print "$self->{test}\n"; | |
} | |
package main; | |
my $foo = Foo->new( { test => 'foo' } ); | |
$foo->p; | |
local $foo->{test} = 'bar'; | |
$foo->p; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment