in reply to Re: Call Subroutine with Variable
in thread Call Subroutine with Variable

I like this!!

Just one question, how would I call the sub with parameters? Like if I wanted it to say "AIX goes $what\n";, how would I send the $what to the subroutine... I hope that makes sense.

Replies are listed 'Best First'.
Re^3: Call Subroutine with Variable
by Anonymous Monk on Jul 31, 2009 at 07:04 UTC
    perlboot
    BEGIN { package Foo; sub new { return bless {}, shift } sub method { my( $self, $what ) = @_; print "AIX goes $what\n"; } } my $obj = Foo->new; $obj->method('the what'); __END__ AIX goes the what
    perlsub