in reply to Re: Custom Module question
in thread Custom Module question
scriptmodule package Printname; use strict; use warnings; use parent qw/ Exporter /; our @EXPORT_OK = qw/ print_name /; sub print_name { my($name) = @_; print "\nHello, $name\n"; } 1;
error C:\Scripts>perl testmodule.pl Undefined subroutine &main::print_name called at testmodule.pl line 11. line 11 is print_name("John"); I tried calling the subroutine from within the module itself but it didn't make a difference. Thanks#!/usr/bin/perl package main; use strict; use warnings; use lib "C:/Perl64/lib/printname"; use lib "C:/Perl64/site/lib/printname"; use PrintName qw/ print_name /; print_name("John");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Custom Module question
by davido (Cardinal) on Dec 04, 2014 at 19:20 UTC | |
by imfaus (Initiate) on Dec 04, 2014 at 20:03 UTC | |
by poj (Abbot) on Dec 04, 2014 at 20:31 UTC | |
by imfaus (Initiate) on Dec 04, 2014 at 20:52 UTC | |
by poj (Abbot) on Dec 04, 2014 at 21:03 UTC | |
|
Re^3: Custom Module question
by davido (Cardinal) on Dec 04, 2014 at 17:34 UTC | |
|
Re^3: Custom Module question
by poj (Abbot) on Dec 04, 2014 at 17:38 UTC |