473,978 Members | 3,132 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

shrek123
23 New Member
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("t est",&Subroutin eB)
but it doest work.

Thanks in advance.
Oct 22 '07 #1
3 1458
numberwhun
3,509 Recognized Expert Moderator Specialist
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("t est",&Subroutin eB)
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
971 Recognized Expert Contributor
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
23 New Member
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

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

Similar topics

4
8146
by: Mark Wilson CPU | last post by:
This must be easy, but I'm missing something... I want to execute a Perl script, and capture ALL its output into a PHP variable. Here are my 2 files: ------------------------------------- test3.pl ------------------------------------- print "PERL Hello from Perl! (plain print)<br>\n"; print STDERR "PERL This is text sent to STDERR<br>\n"; $output="PERL Some output:<br>\n"; for ($i=0; $i<5; $i++) {
3
1544
by: Wayne Folta | last post by:
I hadn't really followed the state of perl for quite a few years. When Irecently found python, it just suited me and now I've switched. (And am contributing to an open-source python project. Great fun!) Someone here mentioned perl 6, so I decided to look in on it and all I can say is it looks like every concept from every computer course, article, and book is now included. I usually like enormous languages, but it looks to me like...
4
3247
by: Sherman Willden | last post by:
I am trying to use Perl's XML::Twig to modify a version number in an XML document. At the very end of this posting is an excerpt from the xml document. Just before the xml excerpt is the Perl code I am trying to use. The Xpath part of the script functions well. I think I need help determining the @field entry. I have tried //property/string, version/string, and string. I get a "Can't modify non-lvalue subroutine call at C:\business...
6
1876
by: raghu | last post by:
#include<stdio.h> int *f1() { int a=20; return &a; } f2() { int b=10; return b;
0
2417
by: Bob | last post by:
I'm updating a fairly old Perl script. Before I change what seems to be a strange practice, I want to be sure the original author wasn't exploiting some efficiency trick. The hash %foo is used only within a subroutine, but rather than declare it in the subroutine, he declares it in the global context and passes a reference to it into the subroutine: #!/youwouldnotbelievethispath/perl
10
13699
by: Robert Dailey | last post by:
Hi, I noticed in Python all function parameters seem to be passed by reference. This means that when I modify the value of a variable of a function, the value of the variable externally from the function is also modified. Sometimes I wish to work with "copies", in that when I pass in an integer variable into a function, I want the function to be modifying a COPY, not the reference. Is this possible?
0
1403
by: Rebles | last post by:
I'm writing a PERL script to access and insert rows into a Microsoft SQL. i'm using MS SQL Server Management Studio Express (2005) to architect tables and queries. I've inserted two records into my "Pools" table One from MS SQL Manager as a test, and another from my PERL script. The one inserted by MS SQL Manager shows up everytime. The row from my PERL script doesn't show up on MS SQL Manager and ONLY shows up on my PERL script and...
1
2291
by: Rebles | last post by:
Hi, I just posted this in the MS SQL Section, but maybe my problem is rooted in Perl, so it's more appropriate to post here instead (sorry for the double post) I'm writing a PERL script to access and insert rows into a Microsoft SQL. i'm using MS SQL Server Management Studio Express (2005) to architect tables and queries. I've inserted two records into my "Pools" table One from MS SQL Manager as a test, and another from my PERL script....
2
1994
by: IvanIV | last post by:
Hi All, I have trouble with embedding a Perl interpreter into a C program. I would like to replace some subroutine in a Perl script without changing this script from my C program. I need replace (override build-in function): print() and exit() functions. I know that in Perl script I can’t override print(), but for exit() function I can: use subs ‘exit’; sub exit { CORE::print “Overriding exit”; } exit(1);
0
10175
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
11591
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10920
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10087
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8465
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6562
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5162
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3773
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.