Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Think about Loose Coupling
 
PerlMonks  

Re: i need help in subroutines

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to i need help in subroutines

Hello and welcome to the monastery, uva!
Perl itself comes with extensive documentation, but I think you are better helped by learning Perl through an introductory book like merlyn's Learning Perl or Programming Perl (the "Camel Book"). Especially if you already know another programming language (for example C or C++), that book should help you.

Replies are listed 'Best First'.
Re^2: i need help in subroutines
by uva (Sexton) on Feb 07, 2006 at 07:09 UTC
    thanx for the reply Corion.... i read "the subroutines are written and store in the file with extension .pm and we can use that subroutine in someother file using -use module;- i tried to implement it is giving error as -cannot locate module in @INC- i also tried using push(@INC,"d:\\module.pm") but still it is giving error,,,,, thats why i asked one code..."

      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.

        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://528471]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.