Skip to content

Instantly share code, notes, and snippets.

@cou929
Created December 18, 2012 07:41
Show Gist options
  • Save cou929/4325883 to your computer and use it in GitHub Desktop.
Save cou929/4325883 to your computer and use it in GitHub Desktop.
同一ファイルで複数 namespace のテスト
#!/usr/bin/env perl
package TestPack;
use strict;
use warnings;
sub new {
my ($class) = @_;
return bless {}, $class;
}
sub sub_on_testpack {
my $self = shift;
'in the same file but other namespace'
}
1;
package main;
use strict;
use warnings;
print TestPack->new->sub_on_testpack() . "\n";
@cou929
Copy link
Author

cou929 commented Dec 18, 2012

実行結果

$ perl ~/namespace.sample.pl
in the same file but other namespace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment