What is the purpose of _package_ literal?
No Answer is Posted For this Question
Be the First to Post Answer
What is the function of cgiwrap in cgi programming?
What does the qq{ } operator do?
Mention the difference between die and exit in Perl?
How to copy a file in perl?
What are the advantages of programming in perl?
Why is it hard to call this function: sub y { "because" } ?
You want to connect to sql server through perl. How would you do that?
What is the purpose of redo statement?
Consider the following example #! /bin/perl use strict; sub sample { my @arr=(1,2,3,4); return @arr; } my ($a,$b,$c,$d) = &sample; print "$a\n$b\n$c\n$d\n"; In the above code, How can I get the $c without using the arguments such as $a,$b. I don't want to use any array to get the return values.
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,
Define say() function in perl?
When would you not use Perl for a project?