harsha.reddy has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl package test; use strict; use warnings; use Switch; sub new { my $class = shift; my $self = { host => "127.0.0.1", server => "localhost", username => "user1", password => "passwd", name => undef, operation => undef }; bless $self, 'Person'; return $self; } sub echo { my $self = shift; print $self->host; } 1; use test; $eco = test->new(); $eco->echo();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: A Class inside a Perl script?
by Corion (Patriarch) on Jun 02, 2009 at 08:45 UTC | |
by harsha.reddy (Acolyte) on Jun 02, 2009 at 09:10 UTC | |
by Corion (Patriarch) on Jun 02, 2009 at 09:15 UTC | |
by Bloodnok (Vicar) on Jun 02, 2009 at 13:21 UTC | |
by kreetrapper (Scribe) on Jun 03, 2009 at 09:06 UTC | |
by LanX (Saint) on Jun 03, 2009 at 10:11 UTC | |
by vinoth.ree (Monsignor) on Jun 02, 2009 at 09:16 UTC | |
by targetsmart (Curate) on Jun 02, 2009 at 09:29 UTC | |
Re: A Class inside a Perl script?
by arc_of_descent (Hermit) on Jun 02, 2009 at 09:24 UTC | |
by GrandFather (Saint) on Jun 02, 2009 at 11:37 UTC | |
Re: A Class inside a Perl script?
by harsha.reddy (Acolyte) on Jun 02, 2009 at 10:28 UTC |