package Foo; our @ISA = qw(Exporter Phoo); our $Bar = 6; my $Whig = 5; sub new { my $count if 0; $count++; my $self = { }; $self->{baz} = 4; return bless($self, shift()); } sub foo { my $self = shift; my $arg = shift; local $Whig = 3; $self->my_Phoo_func($Whig, $arg, $/); } #### #include "Foo.h" // class Foo : public Phoo { ... }; static int Foo::Bar = 6; static int Whig = 5; Foo::Foo() { static int count = 0; count++; this->baz = 4; } void Foo::foo(int arg) { int save_Whig = Whig; Whig = 3; this->my_Phoo_func(Whig, arg, "\n"); Whig = save_Whig; }