Module::Name->method

| No Comments | No TrackBacks
package Module::Name;

use Moose;
use Scalar::Util 'blessed';

has 'verbose' => ( is => 'rw', isa => 'Int', default => 1 );

sub method {
    my $self = shift;
    $self = $self->new()
        if not blessed $self;

    print "hell world\n"
        if $self->verbose;

    return;
}

1;

This allows "method" to be called in two ways:

Module::Name->method;
Module::Name->new(verbose => 0)->method;

No TrackBacks

TrackBack URL: http://blog.meon.eu/admin/tb/108

Leave a comment

Updates

Subscribe to the blog updates with an email:

If you like it, share it.

Pages

About this Entry

This page contains a single entry by Jozef Kutej published on February 25, 2010 9:29 AM.

commit diff to the file with patch... was the previous entry in this blog.

print out all dependencies of an unpacked distributions that are (not) packaged for Debian is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.