What is the difference between having a parenthesis after
module name and without parenthsis after module name??
i.e Package::Module();
and
Package::Module;
I have one question regarding to eval function.
I know eval function is use for error checking but I am not
able to understand below line.
eval \'exec perl -S $0 ${1+\"$@\"}\'
if 0;
$0 for script name
$@ set if error occur
how to create a flat file database as shown below
s.no name age city phone
0 hema 22 Calcutta 4312542
1 hema 21 Bangalore 2344345
2 ganesh 25 delhi 2445454
3 kartik 45 pune 4312121
4 santosh 25 Hyderabad 2254231
5 kumar 25 mysore 2344567
6 gita 34 mangalore 6532123
7 gita 32 pune 2213456
Q1.print the details of the person who r from bangalore
q2.Replace the city name managlore to pune
q3.prints no of person having name gita and hema
q4.print how many are of age 25.
How to disable the mod_perl from apache_server as i have
used perlfect search on the site and its pagination is not
working and the remedy is to disable the mod_perl.
my @array=('data1','data2'); my @array1=('data1','data2');
my ($i,$k);
$i=7;
$k=7;
while($i){
$array [++$#array] = 'ree';
$i--; print "@array";
}
while($k){
push(@array1,'ree');
$k--;
print "@array1";
}
Are these two while loop are doing the same functionality ?
What may be the difference?
88
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,
161
how to create a flat file database as shown below
s.no name age city phone
0 hema 22 Calcutta 4312542
1 hema 21 Bangalore 2344345
2 ganesh 25 delhi 2445454
3 kartik 45 pune 4312121
4 santosh 25 Hyderabad 2254231
5 kumar 25 mysore 2344567
6 gita 34 mangalore 6532123
7 gita 32 pune 2213456
Q1.print the details of the person who r from bangalore
q2.Replace the city name managlore to pune
q3.prints no of person having name gita and hema
q4.print how many are of age 25.
29
How can I implement the function overloading in Perl ? I
read about the operator overloading, I do not know how to
implement the function overloading. Thanks in advance ?
130
I have one question regarding to eval function.
I know eval function is use for error checking but I am not
able to understand below line.
eval \'exec perl -S $0 ${1+\"$@\"}\'
if 0;
$0 for script name
$@ set if error occur
20
write a Perl script to find a particular word in a paragraph???
48
what is the difference b/w coldfusion MX 6 and Coldfusion
MX 7?
250
how to extract pin_code,phone_number,year from text file using
regular expressions in perl
81
what are steps to do to lock the sony ericsson mobile with
password?
66
What is the difference between having a parenthesis after
module name and without parenthsis after module name??
i.e Package::Module();
and
Package::Module;
37
How to disable the mod_perl from apache_server as i have
used perlfect search on the site and its pagination is not
working and the remedy is to disable the mod_perl.
45
Why we use "use lib $path"?
77
write a perl script to find whether a given line of text is
starting and ending with same word or not ???
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.