Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: i need help in subroutines

by Corion (Patriarch)
on Feb 07, 2006 at 12:21 UTC ( [id://528483]=note: print w/replies, xml ) Need Help??


in reply to Re^2: i need help in subroutines
in thread i need help in subroutines

The @INC array is for storing directories in which Perl looks for your modules. If you have a file UvaModule.pm in the directory D:\uva\code\, then you can load it with:

use lib 'D:/uva/code/'; use UvaModule;

Read the lib documentation.

Replies are listed 'Best First'.
Re^4: i need help in subroutines
by uva (Sexton) on Feb 07, 2006 at 12:37 UTC
    thanx Corion,,,, i am not sure whether the following code is write ======================================
    #file1 is in "d:/test.pm" sub uvaraj { $name='ramu'; print 'uvaraj is a good boy in nature but...'; }
    ===================================
    #file2 is in "d:/run.pl" use lib 'D:/'; use test; &uvaraj;
    ==================== i run the second file, it is giving error as "test.pm didnt return a true value"

      Put the following line near the top of your script:

      use diagnostics;

      Perl will then tell you the cause of the error. The diagnostics pragma has many helpfull hints. Please also read the Writeup Formatting Tips and use the Preview feature so your posts are readable to others. Perlmonks uses HTML for formatting.

        thanx Corion,,,, i am not sure whether the following code is write ======================================
        #file1 is in "d:/test.pm" sub uvaraj { $name='ramu'; print 'uvaraj is a good boy in nature but...'; }
        ===================================
        #file2 is in "d:/run.pl" use lib 'D:/'; use test; &uvaraj;
        ==================== i run the second file, it is giving error as "test.pm didnt return a true value"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://528483]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2025-02-18 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found