Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Multiple Files, One Script Possible?

by Arif (Acolyte)
on Feb 28, 2008 at 18:22 UTC ( #670964=note: print w/replies, xml ) Need Help??


in reply to Multiple Files, One Script Possible?

Something like the following will work:
#!/usr/bin/perl use 5; use warnings; use strict; require "part1.pl"; require "part2.pl"; require "part3.pl"; require "part4.pl";
but I wouldn't use 'include' files in C like this either.

Replies are listed 'Best First'.
Re^2: Multiple Files, One Script Possible?
by ikegami (Pope) on Feb 28, 2008 at 22:39 UTC
    Without packgages, do is more appropriate than require. Either way, it's just bad code.
Re^2: Multiple Files, One Script Possible?
by alexm (Chaplain) on Feb 28, 2008 at 21:18 UTC
    TMTOWTDI, and this works but I wouldn't do it either... ;)
    $ cat part1.pl part2.pl part3.pl part4.pl | perl
    IMHO, refactoring a large, one file only program by using modules seems the best course of action in the long term.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2021-06-25 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (133 votes). Check out past polls.

    Notices?