Created
November 6, 2010 06:29
-
-
Save aklaswad/665236 to your computer and use it in GitHub Desktop.
This file contains 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/perl | |
# Sample for using MT registry | |
use strict; | |
use warnings; | |
use lib qw( lib extlib ); | |
use MT; | |
use MT::Component; | |
use Data::Dumper; | |
my $c1 = MT::Component->new; | |
$c1->registry({ | |
foo => { bar => 1 }, | |
}); | |
my $c2 = MT::Component->new; | |
$c2->registry({ | |
foo => { buz => 1 }, | |
}); | |
push @MT::Components, ( $c1, $c2 ); | |
print Dumper( MT->registry('foo') ); | |
# prints this. | |
#$VAR1 = { | |
# 'bar' => 1, | |
# 'buz' => 1 | |
# }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment