473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to import and define subroutines

Hello,

Could someone please help me define and imported a subroutine. I will try to make this simple.

Script-A contains all of the processes for script-B. Script-A uses script-B as a 'use base'.
Script-A (containing the processes) has subroutine-1 which is used by subroutine-2

How do I import/define script-A subroutine-2 to script-B.

On Script-A subroutine-2
This
Expand|Select|Wrap|Line Numbers
  1. sub hellos1{
  2. my $self = shift;
  3. &say_hello_to('Dan');
  4. $hello1 = $hellos{'Dan'}
  5. print $hello1;
  6. }
OR this
Expand|Select|Wrap|Line Numbers
  1. sub hellos1{
  2. my $self = shift;
  3. &say_hello_to('Dan');
  4. $hello1 = $hellos{'Dan'}
  5. print $hello1;
  6. }
How do I import/define subroutine-2 ($hello1) to script-B.
If you need to see more, I am willing show you both scripts--but they are l-o-n-g.
Sep 20 '10 #1
1 1893
toolic
70 Expert
The conventional way to include subroutines is to use Perl modules (packages):
Sep 20 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Andreas Sheriff | last post by:
Please evaluate the following snippet: int a=5; int b; b = a++ + a; Edit1->Text = b; a = 5; b = a++ + ++a; Edit2->Text = b;
5
by: reezaali | last post by:
Hi All I keep getting back VINET and not Lilas...can someone point me in the right direction? Thanks a lot DECLARE @idoc int DECLARE @doc varchar(1000)
2
by: sparks | last post by:
ok I was trying to do something real simple I thought Me.Clinic.DefaultValue = Me.Clinic.Value I got error either ! or . misused or not found...something like that I thought ok how can you not...
21
by: MLH | last post by:
A97 procedure to open http://www.arch.com/message/ enter an 800 number, press "Continue", enter a text msg string from a memo field and press "Send" This is a calendaring and appointment A97...
2
by: Alpha | last post by:
Hi, Where is a good place on the internet for me to learn about how to use the datagrid. My grid's datasource is a dataset with one table from a DB. I need to know how to perform Edit, Delete and...
4
by: Jan | last post by:
This is my problem: When i have more than 3 lines of text in de tempArray. Iget the following message: An unhandled exception of type 'System.NullReferenceException' occurred in Allen's...
2
by: Just Me | last post by:
Dim iData As IDataObject = Clipboard.GetDataObject() Dim img As System.Drawing.Bitmap img = img.FromFile(ofd.FileName, True) Clipboard.SetDataObject(img) TextControl1.Paste() img.Dispose() : img...
1
by: Richard Sloan | last post by:
I need to implement this in C, but PERL I do not know and have tried to figure this out without sucess. Can someone take a look at the arabjoin script and the arabjoin.pdf and give me some insight,...
6
by: rlueneberg | last post by:
Can someone tell if Sitemap always require a starting root? Can it have more than one root? I am having a problem trying to hide a root node without hiding its children using a Treeview component....
2
by: ppuniversal | last post by:
Hello, Can someone tell a good Tutorial on Network Programming in C++, except Beej's Guide and Vijay Mukhi's tutorials. I want to make a Client Server application in C++ which will involve...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.