CGI Perl Interview Questions

 
1.
Write an expression or Perl script to identify the entered IP address is valid or not?
2.
Packing and Unpacking.

Hi, I want to get output as 0x23400000345....
in the below example How to get?
i tried out, but unable to get the answer

$r=0x234;
$t=0x345;
$y=pack(L L,$t,$r);
$x1=unpack(L!,pack(P,$y));
printf("
The value is $x1");

I didnt get constant output?
3.
How to sort dates in Perl?
4.
Sort a word "system" in perl/shell without using built in functions output should be emssty?
5.
How to find a substring in a string without using substr built in functions, and print the substring found?
6.
Write a script to reverse a string without using Perls built in function?
7.
Try pattern matching for the following:
1) 10.111.23.11
2) /root/abc/cde/fgg/ac.xml --> Get file name without extention.
3) /root/abc/ac.xml/fgg/ac.xml --> Get file name without extention.
4) What does "DIE" meant in PERL?
5) chomp
6) "This is saturday" --> Print the weekday number.
7) 11-2-2009 --> Print the name of the month.
8) Reverse the string without using func in C.?
8.
Why do you use only Perl when there a lot of more languages available in market like C, Java?
9.
What is the meaning of rigging?
10.
What is the difference between having a parenthesis after module name and without parenthsis after module name?
i.e Package::Module();
and Package::Module;
11.
Write a Perl script to find a particular word in a paragraph?
12.
Write a perl script to find whether a given line of text is starting and ending with same word or not?
13.
What is caller function in perl?
14.
How to make the following assignment, as arrayreference assignment?

my $arr_ref=[1,2,3,4,4,elem];
15.
Difference between Perl and Mod_perl?
16.
Why we use "use lib $path"?
17.
Write a script to generate n prime no.s?
18.
Write a script to display mirror image of a entered value and also check whether Palindrome?
19.
Write an expression or Perl script to identify the entered IP address is valid or not?
20.
Packing and Unpacking.

Hi, I want to get output as 0x23400000345....
in the below example How to get?
i tried out, but unable to get the answer

$r=0x234;
$t=0x345;
$y=pack(L L,$t,$r);
$x1=unpack(L!,pack(P,$y));
printf("
The value is $x1");

I didnt get constant output?
21.
How to sort dates in Perl?
22.
Sort a word "system" in perl/shell without using built in functions output should be emssty?
23.
How to find a substring in a string without using substr built in functions, and print the substring found?
24.
Write a script to reverse a string without using Perls built in function?
25.
Try pattern matching for the following:
1) 10.111.23.11
2) /root/abc/cde/fgg/ac.xml --> Get file name without extention.
3) /root/abc/ac.xml/fgg/ac.xml --> Get file name without extention.
4) What does "DIE" meant in PERL?
5) chomp
6) "This is saturday" --> Print the weekday number.
7) 11-2-2009 --> Print the name of the month.
8) Reverse the string without using func in C.?
26.
Why do you use only Perl when there a lot of more languages available in market like C, Java?
27.
What is the meaning of rigging?
28.
What is the difference between having a parenthesis after module name and without parenthsis after module name?
i.e Package::Module();
and Package::Module;
29.
Write a Perl script to find a particular word in a paragraph?
30.
Write a perl script to find whether a given line of text is starting and ending with same word or not?
31.
What is caller function in perl?
32.
How to make the following assignment, as arrayreference assignment?

my $arr_ref=[1,2,3,4,4,elem];
33.
Difference between Perl and Mod_perl?
34.
Why we use "use lib $path"?
35.
Write a script to generate n prime no.s?
36.
Write a script to display mirror image of a entered value and also check whether Palindrome?