in reply to Re: A Class inside a Perl script?
in thread A Class inside a Perl script?
#!/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; package main; $eco = test->new(); $eco->echo();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: A Class inside a Perl script?
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 | |
|
Re^3: A Class inside a Perl script?
by vinoth.ree (Monsignor) on Jun 02, 2009 at 09:16 UTC | |
|
Re^3: A Class inside a Perl script?
by targetsmart (Curate) on Jun 02, 2009 at 09:29 UTC |