That was exactly what I was looking for! Thank you so much!

- Jeffrey Kevin Pry

-----Original Message-----
From: Gorrebeeck, Robert [mailto:gorrebeec...@cvty.com]
Sent: Thursday, March 25, 2010 10:01 AM
To: Pry, Jeffrey
Subject: RE: Subroutines With Multiple Parameters

Jeffery

When you call your subroutine make sure you have the '&' in front of
your subroutine name:

Like this

        &displayPage($servername, $password);

In addition you can pass in as many parameters as you like (see above)

Within your subroutine to get the parameters out you would do this -
declare another variable within your subroutine, (the variables you
declare will only be active within your subroutine) Like this:

sub displayPage
{
        my ($a_server) = $_[0];
        my ($a_pass) = $_[1];

}

Hope that helps

Robert Gorrebeeck
Sr. EDI Apps Dev Analyst
Coventry Workers' Comp Services
Solutions to Restore Health and Productivity
Office: (972) 725-1484
gorrebeec...@cvty.com
www.coventrywcs.com

-----Original Message-----
From: Pry, Jeffrey [mailto:jeffrey....@sig.com]
Sent: Thursday, March 25, 2010 8:54 AM
To: beginners@perl.org
Subject: Subroutines With Multiple Parameters

Hey,

I have a subroutine

sub displayPage($) {

            my($server) = shift;
            print $server;
}

Which I can call using displayPage("servername");

My question is lets say I wanted to pass a password as well. So I would
like to call it as displayPage("servername","mypassword");

How would I do this?

Thanks to everyone in advance for your help! It is much appreciated!

- Jeffrey Kevin Pry

________________________________
IMPORTANT: The information contained in this email and/or its
attachments is confidential. If you are not the intended recipient,
please notify the sender immediately by reply and immediately delete
this message and all its attachments. Any review, use, reproduction,
disclosure or dissemination of this message or any attachment by an
unintended recipient is strictly prohibited. Neither this message nor
any attachment is intended as or should be construed as an offer,
solicitation or recommendation to buy or sell any security or other
financial instrument. Neither the sender, his or her employer nor any of
their respective affiliates makes any warranties as to the completeness
or accuracy of any of the information contained herein or that this
message or any of its attachments is free of viruses.





Email Confidentiality Notice: The information contained in this transmission is 
confidential, proprietary or privileged and may be subject to protection under 
the law, including the Health Insurance Portability and Accountability Act 
(HIPAA).

The message is intended for the sole use of the individual or  entity to whom 
it is addressed.  If you are not the intended recipient, you are notified that 
any use, distribution or copying of the message is strictly prohibited and may 
subject you to criminal or civil penalties.  If you received this transmission 
in error, please contact the sender immediately by replying to this email and 
delete the material from any  computer.



IMPORTANT: The information contained in this email and/or its attachments is 
confidential. If you are not the intended recipient, please notify the sender 
immediately by reply and immediately delete this message and all its 
attachments. Any review, use, reproduction, disclosure or dissemination of this 
message or any attachment by an unintended recipient is strictly prohibited. 
Neither this message nor any attachment is intended as or should be construed 
as an offer, solicitation or recommendation to buy or sell any security or 
other financial instrument. Neither the sender, his or her employer nor any of 
their respective affiliates makes any warranties as to the completeness or 
accuracy of any of the information contained herein or that this message or any 
of its attachments is free of viruses.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to