What is the difference between exec and system?
Answer / Prashant Kumar Sharma
"system()" forks a child process to run an external command, but the Perl script continues executing. On the other hand, "exec()" replaces the current Perl script with the specified command, effectively ending the Perl script.
| Is This Answer Correct ? | 0 Yes | 0 No |
Write syntax to use grep function?
What are the various uses of perl?
What are perl strings?
Explain subroutine in perl?
Is there any way to add two arrays together?
What do you mean by context of a subroutine?
package MYCALC; use Exporter; our @EXPORT = (); our @ISA = qw(Exporter); our @EXPORT_OK = qw(addition multi); our %EXPORT_TAGS = (DEFAULT => [qw(&addition)],Both => [qw(&addition & +multi)]); sub addition { return $_[0] + $_[1]; } sub multi { return $_[0] * $_[1]; } 1; Program: use strict; use warnings; my @list = qw (2 2); use Module qw(:DEFAULT); print addition(@list),"\n"; Above coding is my module MYCALC and the program which using this module, I have not exported any function using @EXPORT, but I have used the DEFAULT in %EXPORT_TAGS with the function addition, when I call this function from the main it says the error as,
what is CPAN?
how to install a package in perl ????
What are the different types of perl operators?
What elements of the Perl language could you use to structure your code to allow for maximum re-use and maximum readability?
Why do you use Perl?