Solved

file

Posted on 2001-06-25
6
151 Views
Last Modified: 2010-03-05
I've got 2 scripts, 1 smaller script with a lot of subs in it and 1 really large script.

Now I want to perform this:

From the smaller script I want to run 3 subs and then the large script should be executed (I have no idea how to call that script from within the smaller script), after executing the large script it should continue with another 4 subs from the smaller script.

You can quess my question: How to call the large script from within the smaller script and when the large script has executed the smaller script continues.
0
Comment
Question by:saskia
  • 2
  • 2
  • 2
6 Comments
 

Accepted Solution

by:
shayb022800 earned 50 total points
Comment Utility
Hi,
You can do one of two things:
1.
If you do not need the "big" scripts output within the "small" script you can call it with the "system" command or with back quotes like this:
system "big_script.pl";
or
$return_val = `big_script.pl';

2.
you can transform one of your scripts into a package and then include that package in the other script like this:

small_script.pm #end the file name with .pm
func1()
func2()
1;#important at the end of the package


big_script.pl
use "path/small_script.pm";  #include the above file

func1() # call a function from the package
big_func() # this scripts func
func2() # call a function from the package


Enjoy!
0
 

Author Comment

by:saskia
Comment Utility
Please don't propose an answer, maybe other people have a better solution for me.

- The big script does give output.
- I don't want to call functions from the small script from within the bigger script, because the big script will become 'unreadable' due to it's size.

0
 

Expert Comment

by:shayb022800
Comment Utility
You can do the opposite , call the big script from the small one!
Or you can prepare a third script which calls them both!
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 8

Expert Comment

by:bebonham
Comment Utility
shayb has covered all the bases
0
 

Author Comment

by:saskia
Comment Utility
ok, quess i've got to do it with this... thanks
0
 
LVL 8

Expert Comment

by:bebonham
Comment Utility
just to stick my nose in again, I think making the second script (the one that contains multiple sub-routines) a module would make the most sense:

that way, if any of those subroutines proved to be useful, you could reuses them in later code.


Bob
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now