|
| ||||||||||
| Tags: perl script |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Is it possible to execute Perl script within another script?
I don't have any Idea with PERL programming. Actually I use to work with perl program execution so my question is may be simple but I am not good at writing the code. What I want to ask is it possible to call a perl script from within another script? I want to call a perl script into another please let me know if it is possible? Is it possible to execute it? Thanks in advance. |
|
#2
| |||
| |||
| Re: Is it possible to execute Perl script within another script?
If you would like to make a call to, or reference, a Perl script from within a different Perl script, you can accomplish this a system(), exec() or the backtick operator to the path for Perl. For example: Code: system("/usr/bin/perl /path/to/my_script.pl "); Code: @myarray = `/usr/bin/perl mysecondperlscript.pl`; |
|
#3
| ||||
| ||||
| Re: Is it possible to execute Perl script within another script?
Try this: add.pl Code: my $sum = qx(perl addition.pl 10 -20); ## Remove double quotes from your code print "Result is $sum"; Code: $x, $y) = @ARGV;
if ( !defined($x) ) {
print STDERR"usage add <x> <y>\n";
exit;
}
else
{
$n = 0;
$n = $x + $y;
}
print $n; |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Is it possible to execute Perl script within another script?" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to run Perl script on Mozilla Firefox? | Grayson | Software Development | 5 | 02-11-2011 02:35 PM |
| Firefox problem with perl script | Gajendra1 | Software Development | 6 | 09-09-2010 04:44 PM |
| How to call perl script from Python? | Jhonwho | Software Development | 3 | 23-07-2009 09:59 PM |
| Need Perl script to execute from another. | beelow | Software Development | 2 | 20-06-2009 09:17 AM |
| Title of a Perl CGI script | !const | Software Development | 2 | 26-03-2009 11:43 PM |