Permalink
Browse files

Squatting::H resurrection

  • Loading branch information...
1 parent 79068f7 commit 79ca09264a175e70d8613f090340c416739e29ba @beppu committed Nov 25, 2008
Showing with 50 additions and 0 deletions.
  1. +1 −0 MANIFEST
  2. +49 −0 lib/Squatting/H.pm
View
@@ -20,6 +20,7 @@ eg/UniCodePoints.pm
lib/Squatting.pm
lib/Squatting/Controller.pm
lib/Squatting/Cookbook.pod
+lib/Squatting/H.pm
lib/Squatting/Mapper.pm
lib/Squatting/On/Catalyst.pm
lib/Squatting/On/CGI.pm
View
@@ -0,0 +1,49 @@
+package Squatting::H;
+use strict;
+use selfvars;
+use base 'Exporter';
+
+our $AUTOLOAD;
+our @EXPORT = qw(H);
+
+sub H {
+ Squatting::H->new(@_)
+}
+
+sub new {
+ bless { %opts } => $_[0];
+}
+
+sub clone {
+ bless { %$self, %opts } => ref($self);
+}
+
+sub AUTOLOAD {
+ my $attr = $AUTOLOAD;
+ $attr =~ s/.*://;
+ if (ref($self->{$attr}) eq 'CODE') {
+ $self->{$attr}->($self, @args)
+ } else {
+ if (@args) {
+ $self->{$attr} = $args[0];
+ } else {
+ $self->{$attr};
+ }
+ }
+}
+
+sub DESTROY {
+}
+
+1;
+__END__
+# Local Variables: ***
+# mode: cperl ***
+# indent-tabs-mode: f ***
+# cperl-close-paren-offset: -2 ***
+# cperl-continued-statement-offset: 2 ***
+# cperl-indent-level: 2 ***
+# cperl-indent-parens-as-block: t ***
+# cperl-tab-always-indent: f ***
+# End: ***
+# vim:tabstop=8 softtabstop=2 shiftwidth=2 shiftround expandtab

0 comments on commit 79ca092

Please sign in to comment.