Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Here's my script code:package myModule; sub new { my $this = {}; bless $this; return 1; } sub start_table { my $color = shift; my $width = shift; my $height = shift; print "<table border=0 cellspacing=0 cellpadding=0 width='$width'" +; if ($height) { print " height='$height'"; } if ($color ne 'i') { print " color='$color'"; } print "><tr><td>\n"; } 1;
The error I get is "Can't call method "start_table" without a package or object refrence at pmtest.pl line 4." What am I doing wrong and how can I fix it?#!/usr/bin/perl -w use strict; use myModule; my $sm = myModule->new; $sm->start_table('#000000',250);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) Re: Can't Call method error
by Ovid (Cardinal) on Dec 22, 2000 at 23:47 UTC | |
|
Re: Can't Call method error
by Albannach (Monsignor) on Dec 23, 2000 at 01:04 UTC | |
|
Re: Can't Call method error
by ichimunki (Priest) on Dec 22, 2000 at 23:47 UTC |