Getting error while using Perl Module

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rammohan
    New Member
    • Feb 2014
    • 4

    Getting error while using Perl Module

    Code:
    package ExampleModule;
    
    use strict;
    use base "Exporter";
    our @EXPORT = qw(hello_world);
    
    sub hello_world {
        print "Hello,world";
    }
    1;
    
    #!/usr/bin/perl -w
    use strict;
    use lib '/home/Admin/Desktop/Perl_Work_Space/ExampleModule.pm/';
    use ExampleModule qw(hello_world);
    hell_world('ram');
    exit;
    error:
    Undefined subroutine &main::hell_wor ld called at module.pl line 5.
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    You have a typo.

    Code:
    hell_world('ram');
    should be
    Code:
    hello_world('ram');

    Comment

    • rammohan
      New Member
      • Feb 2014
      • 4

      #3
      ya thank you for your replay . Before you answering this question i got it what's the wrong in my code.

      Comment

      Working...