!!!error is : Can't locate object method "new" via package "AFactory" at new.pl line 31.#!/bin/perl package first; use strict; use warnings; sub new{ my $class = shift; my $type = shift; return bless \$type, $class; } sub greet { my $type = shift; print "\n hello got something .. $$type \n"; } 1; package AFactory; use strict; use warnings; sub get_new { my $class = shift; my $type = shift; return $class->new(@_); } 1; my $greeter = AFactory->get_new("first","dow dow"); $greeter->greet(); print "hellow\n";
In reply to Re^5: Abstract Factory
by Khatri
in thread Abstract Factory
by Khatri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |