From: Stevan Little Date: Tue, 18 Dec 2007 02:11:03 +0000 (+0000) Subject: adding some overloading X-Git-Tag: 0_06~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eaf252a6da8a9b8b1e70c2d491302872df5f71eb;p=gitmo%2FMooseX-Daemonize.git adding some overloading --- diff --git a/lib/MooseX/Daemonize/Pid.pm b/lib/MooseX/Daemonize/Pid.pm index bcfd3b5..7df8070 100644 --- 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 => $_ ) };