predeclare module sub

Discussion in 'Perl Misc' started by star_night@my-deja.com, Mar 7, 2007.

  1. Guest

    Hi,

    How can I predeclare moule functions? I tried

    test.pm
    ---------------
    package test;
    use Exporter;
    @EXPORT = qw(foo);
    sub foo;

    sub foo {
    }


    main.pl
    -------------
    use test;
    sub foo;

    foo "args"; <------ this looks for &main::foo

    ---------------------------------------------------

    Thanks
    SN
     
    , Mar 7, 2007
    #1
    1. Advertising

  2. Guest

    On Mar 7, 4:01 am, wrote:
    > Hi,
    >
    > How can I predeclare moule functions? I tried
    >
    > test.pm
    > ---------------
    > package test;
    > use Exporter;
    > @EXPORT = qw(foo);
    > sub foo;
    >
    > sub foo {
    >
    > }
    >
    > main.pl
    > -------------
    > use test;
    > sub foo;
    >
    > foo "args"; <------ this looks for &main::foo
    >
    > ---------------------------------------------------
    >
    > Thanks
    > SN


    this is resolved. I wasn't gettong the module mechanics right.

    Thanks
     
    , Mar 7, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. THY
    Replies:
    1
    Views:
    402
    Steve C. Orr, MCSD
    Aug 19, 2003
  2. Kathy Burke
    Replies:
    3
    Views:
    405
    Kathy Burke
    Nov 24, 2003
  3. Tee
    Replies:
    2
    Views:
    826
  4. Ben
    Replies:
    2
    Views:
    919
  5. Lawrence D'Oliveiro

    Death To Sub-Sub-Sub-Directories!

    Lawrence D'Oliveiro, May 5, 2011, in forum: Java
    Replies:
    92
    Views:
    2,083
    Lawrence D'Oliveiro
    May 20, 2011
Loading...

Share This Page