projects
/
gitmo/MooseX-Daemonize.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
d652408
)
adding some overloading
Stevan Little [Tue, 18 Dec 2007 02:11:03 +0000 (
02:11
+0000)]
lib/MooseX/Daemonize/Pid.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/MooseX/Daemonize/Pid.pm
b/lib/MooseX/Daemonize/Pid.pm
index
bcfd3b5
..
7df8070
100644
(file)
--- a/
lib/MooseX/Daemonize/Pid.pm
+++ b/
lib/MooseX/Daemonize/Pid.pm
@@
-3,6
+3,10
@@
use strict; # because Kwalitee is pedantic
use Moose;
use Moose::Util::TypeConstraints;
+use overload '""' => sub { (shift)->pid },
+ '+0' => sub { (shift)->pid },
+ fallback => 1;
+
coerce 'MooseX::Daemonize::Pid'
=> from 'Int'
=> via { MooseX::Daemonize::Pid->new( pid => $_ ) };