Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I thought it would be good if I have separate file for each part of my code like to get a link list of the categories one code and for getting a link list of the products one and so on

That almost sounds like modules. I think I'd recommend creating your functions to do those things you describe in one or more .pm files ("modules"), placing them in one of the site-perl directories listed in @INC, and then loading them with use from any program that wants to use them.

Modules you're only going to use locally don't have to be held up to the same exacting standards you would do if you were going to publish them to the CPAN for the world to use. A module that's only going to be used by just one app is not really significantly harder to create than any other Perl script. You don't have to mess with package namespaces, for instance, especially for a small application: you can just define your functions in the normal way and let them live in the main namespace. You don't need any more POD for a module of this kind than you would for any other code. I do recommend the use strict pragma, but I'd recommend that even for files you were going to require.

-- 
We're working on a six-year set of freely redistributable Vacation Bible School materials.

In reply to Re: calling a perl file from a perl script by jonadab
in thread calling a perl file from a perl script by hodashirzad

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-25 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found