Skip to content

Instantly share code, notes, and snippets.

@churib
Created July 28, 2014 14:41
Show Gist options
  • Save churib/90333672cf79421ceb6c to your computer and use it in GitHub Desktop.
Save churib/90333672cf79421ceb6c to your computer and use it in GitHub Desktop.
#!/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