By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,077 Members | 1,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,077 IT Pros & Developers. It's quick & easy.

How can I pass output of some perl subroutine to a subroutine?

shrek123
P: 23
How can I pass output of some perl subroutine to a subroutine?

I have Subroutine1 and wanna pass the return value of this subroutine as an argument to another subroutine.
I tried this;

&SubroutineA("test",&SubroutineB)
but it doest work.

Thanks in advance.
Oct 22 '07 #1
Share this Question
Share on Google+
3 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
How can I pass output of some perl subroutine to a subroutine?

I have Subroutine1 and wanna pass the return value of this subroutine as an argument to another subroutine.
I tried this;

&SubroutineA("test",&SubroutineB)
but it doest work.

Thanks in advance.
I doubt that will work either. A subroutine can return a value and that value can then be plugged into the second subroutines call.

Regards,

Jeff
Oct 22 '07 #2

eWish
Expert 100+
P: 971
In this example I am expecting a string to be returned.
Expand|Select|Wrap|Line Numbers
  1. my $var1 = &sub1(&sub2($another_Var));
Oct 22 '07 #3

shrek123
P: 23
In this example I am expecting a string to be returned.
Expand|Select|Wrap|Line Numbers
  1. my $var1 = &sub1(&sub1($another_Var));
Thanks, its working.
Oct 22 '07 #4

Post your reply

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