• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

very basic perl question

RichieZ

Diamond Member
Let me begin by saying I have never programmed in Perl before, so forgive me if I use incorrect terminology

So lets say I have a function defined in a perl module:
##
# Selector for title.
#
sub title {
my ($this) = @_;

return $this->{TITLE};
}

So in my Perl script(?) I tell it to use the module (ie: use Document😉

when I try and call the function i get the following error:
Can't call method "title" on unblessed reference at ~\indexer.pl line 72.

heres the snippet of code I wrote that causes this error:
sub test{
my (@docs) = @_;

my $newdoc = $docs[0];
my $newtitle = $newdoc->title();
print->title();
}

I'm a perl newbie and I can't figure out why this would cause an error, the way i wrote this was exactly like an example that was give to me
 
Back
Top