rahul.pwav has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on executing a perl script into another perl script

Replies are listed 'Best First'.
Re: executing a perl script into another perl script
by moritz (Cardinal) on Mar 25, 2011 at 12:34 UTC
Re: executing a perl script into another perl script
by Ratazong (Monsignor) on Mar 25, 2011 at 12:36 UTC
Re: executing a perl script into another perl script
by fidesachates (Monk) on Mar 25, 2011 at 15:02 UTC
    "also same in background"

    Use the system command or backticks and append a & to the end of the command if you are in the *nix world. In the windows world start your command with "START" and end it with "/B"
Re: executing a perl script into another perl script
by locked_user sundialsvc4 (Abbot) on Mar 25, 2011 at 20:54 UTC

    Your question is rather ambiguous.   Perhaps you mean require?

    Otherwise... when you “execute a script | program,” no matter how exactly you do it (see above), it usually does not matter what programming language that script | program was written in.   The OS simply forks a shell to run the command, resolving the command in whatever is that OS’s usual way.

    Unfortunately, your comment about “in the background” can also mean one of several different things.

Re: executing a perl script into another perl script
by umasuresh (Hermit) on Mar 25, 2011 at 23:21 UTC
    Is this what you want?
    use strict; use warnings; # if the perl script takes input and output strings as arguments my $perl_script = "perl script_to_execute input output"; # print to see what is being executed print "$perl_script\n" my $script_exe = `$perl_script`; # To check for errors print "$script_exe\n";
    OR directly :
    my $script_exe = `perl perl_script_to_run input output`;
    NOTE: untested
    UPDATE As Ratazong suggests, you can also try:
    my $cmd = "perl script_to_execute input output"; print STDERR "$cmd\n"; system($cmd);