http://www.perlmonks.org?node_id=177059

#!perl # package SMiTZ; BEGIN { until ($age > 19) { $self->freeload && $self->annoy_parents; } } sub new { my ($class, $self) = @_; unless (&work($self) || &sleep($self)) { $self->smoke; $self->cancer_probablity += rand(0.001); } bless ($self, undef); } END { $self->regret($self); $die; }


Dont worry, Im not suicidal or depressed, just wanted to do my Auto-Biography in perl golf.

SMiTZ
this is the first poem I ever wrote - thanks Perl

Replies are listed 'Best First'.
Re: Time to buy some pills
by jarich (Curate) on Jun 26, 2002 at 06:56 UTC
    sub new { my ($class, $self) = @_; unless (&work($self) || &sleep($self)) { $self->smoke; $self->cancer_probablity += rand(0.001); } bless ($self, undef); }
    Surely you meant:
    sub new { my ($class, $self) = @_; unless ($self->work() || $self->sleep()) { $self->smoke; $self->cancer_probablity += rand(0.001); } bless ($self, undef); }
    This reads better to me:
    unless I go to work, or I got to sleep....

    My auto-biography in perl poetry would be a lot longer:

    But that's because I'm a pedant, and insist on code that does stuff. :) (My own version has moved all the arrays out of the functions and into the object but that doesn't look as nice.)

    jarich

      Um the $self->work() won't work as the object hasn't been blessed.

      --

      Brother Frankus.

      ¤