Hello afoken,

Thank you for your time and effort reading and replying to my query.

Well after a lot of experimentation I have concluded that the problem lies with the directories. I am using Net::SNTP::Client.pm which I have install it locally. I assume since the moment that I install it locally since then any modification I am applying on the module is ignored because I can see the installed directory Net-SNTP-Client.

So I assume that I first need to uninstall the module and then find a way to experiment with the module before installing it.

I have tried almost 100 different combinations with the use lib '/home/username/ModuleFolder/'; but I keep getting the same error:

Can't locate Net/SNTP/Client.pm in @INC (you may need to install the N +et::SNTP::Client module) (@INC contains: /home/tinyos/Desktop/Test /h +ome/tinyos/Desktop/Test/ /etc/perl /usr/local/lib/perl/5.18.2 /usr/lo +cal/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5 +.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at client.pl lin +e 8. BEGIN failed--compilation aborted at client.pl line 8.

I have unistalled my module since I think this is the root of all problems before I move to the next step I need to find a way to make it work.

Sample of Module Net::SNTP::Client.pm:

#!/usr/bin/perl use strict; use warnings; use Exporter; package Net::SNTP::Client; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 1.00; @ISA = qw(Exporter); @EXPORT = (); @EXPORT_OK = qw(func1 func2); %EXPORT_TAGS = ( DEFAULT => [qw(&func1)], Both => [qw(&func1 &func2)] ); sub func1 { return reverse @_ } sub func2 { return map{ uc }@_ } 1;

Sample of code for script client.pl:

#!/usr/bin/perl use strict; use warnings; my @list = qw (J u s t ~ A n o t h e r ~ P e r l ~ H a c k e r !); use lib '/home/username/Desktop/Test'; use Net::SNTP::Client qw(func1); print func1(@list),"\n";
Seeking for Perl wisdom...on the process of learning...not there...yet!

In reply to Re^3: Undefined subroutine &main::func1 by thanos1983
in thread Undefined subroutine &main::func1 [SOLVED] by thanos1983

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.