Hope you are trying the above#!/usr/bin/perl -w use strict; sub new() { my $self={}; $self->{FORM_VAR}=undef; bless($self); return $self; } sub name() { my $self=shift; $self->{FORM_VAR}=shift; print "Using the constructor\n\n\n"; return $self->{FORM_VAR}; } my $obj = main::new(); my $var=$obj->name("KALAI"); print "Here ::: $var\n"; Output :- Using the constructor Here ::: KALAI
In reply to Re: Regarding Perl Class Object
by jesuashok
in thread Regarding Perl Class Object
by editi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |