i was thinking about new() constructor. As we know that we can give any name. Generally we do like this..
package PP;
sub new
{
my $class = shift;
my $self = {
_first => shift,
_last => shift,
_st => shift,
};
print "First Name is $self->{_first}\n";
print "Last Name is $self->{_last}\n";
print "ST is $self->{_st}\n";
bless $self, $class;
return $self;
}
and at the time of calling we do as below:
$object = new PP( "Mohan", "Sohan", 223345);
So here we are using new
because we have constructor name 'new()'
but how we will handle that if constructor name is few() (instead of new()). is that like below?
$object = few PP( "Mohan", "Sohan", 223345);