Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

CGI Perl Interview Questions
Questions Answers Views Company eMail

Why do you use only Perl when there a lot of more languages available in market like C, Java?

1 2932

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.

2 6176

Write a script to reverse a string without using Perl's built in function

Nokia,

8 23451

how to find a substring in a string without using substr built in functions, and print the substring found

Nokia,

3 12724

sort a word "system" in perl/shell without using built in functions output should be emssty

emc2,

2 5005

How to sort dates in Perl ?

1 4543

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("\nThe value is $x1"); I didn't get constant output

1 2640

while (my ($key, $value) = each(%ENV)) { print "$key - $value\n"; } What does the above sample code produce? What function do you use for reading a list of files within a directory? my %hash = ( 'hi' => {'hello' => 'all'}, 'bye' => {'later' => 'gone'} ); print $hash{'hi'}; What is printed when the above code is executed? sub new { my $pkg = shift; my $test = {'name' => shift;}; ???? return $test; } Which one of the following replaces "????" in the above code in order to cause the function new to return an object of type "Test"? while () { ???? print "$_\n"; } Which one of the following statements causes the above code to strip all whitespace from the end of all lines of input and to print the resulting lines to standard output while (my ($key,$value) = each(%hash)) { print "$key - $value\n"; delete $hash{$key}; } open(FILE,"; } close(FILE); my $foo = 21; $foo <<= 5; $foo >>= 4; print $foo; @arr = (1,2,3); {local $" = "\n"; print "@arr\n"; } my $line = "Hello World"; substr($line,5,2) = "abc"; print $line; Why is sprintf rarely used in perl in comparison to similar (or the same) functions in other languages? my $subRef = sub {print shift;}; How is the subroutine above called with one parameter? How can the values of an associative array be placed in sorted order in a new array? What function is often necessary for building data structures to be passed to low-level routines such as ioctl and fcntl? sub foo { if (shift(@_) > 0) { shift; } } print foo(10,5); print foo(-10,5); What does the above sample for (my $i = 1; $i <= 3; $i++) { print 1..$i; print "\n"; } my $data = 5**3 * 12,2+2; print $data; sub foo { my $value = shift; if ($value) { print 1; shift; } else { return shift(@_) + 3; } } print foo(10,20); What is printed as the result of executing the above code? $var = 20; sub s1 { print "$var "; } sub s2 { local $var = 10; s1;} sub s3 { my $var = 30; s1;} s3; s2; s1; On systems that record file ownership, how may the owner of a file be identified? Which one of the following sets $y to be a copy of $x with every occurrence of foo changed to bar? Which one of the following is an array literal that represents a 4-element array containing the numbers 1, 4, 2, and 6? sub foo {2*shift || 'x';} printf ("%s %s %s", foo(5),foo(0),foo(-5)); What does the above sample code print? Suppose $x contains a number. Which one of the following statements sets $y to be a string containing the octal value of $x?

2 9478

Write an expression or perl script to identify the entered ip address is valid or not?

HCL,

5 10346

Hi, I am a accountant. I am preparing a balance sheet but because of staff shortage and time pressures I cant complete it on time. There is lot of common data with last years which I need not retype and I can manage by editing last year’s balance sheet ? Is their any software on net where I can do this easily??

1482

Why we use CGI?

Wipro,

1750

We all know private variables exist in perl. But do private METHODS exist in perl ? Eg ?

AppLabs,

1725

how to get back up from private character editor which is saved in the format of .udf

1487

There is no strict data types in perl unlike in other high level languages like Java so wouldn't that be a problem if a code in perl is to be a written by a big team of 20+ members ?"

Cisco, Oracle,

1668

How to check the status of airplane mode (enable/disable) in perl for Android mobile?

2265


Post New CGI Perl Questions






Un-Answered Questions { CGI Perl }

What does `$result = f() .. g()' really return?

240


What does Perl do if you try to exploit the execve(2) race involving setuid scripts?

205


What is the difference between use and require in perl programming?

216


How to concatenate strings in perl?

216


What are the benefits of perl in using it as a web-based application?

185






Why aren't Perl's patterns regular expressions?

255


How can the user execute a long command repeatedly without typing it again and again?

200


You want to empty an array. How would you do that?

184


Show the use of sockets for the server and client side of a conversation?

186


What are the various uses of perl?

210


How to start perl in interactive mode?

230


What are the advantages and disadvantages of perl language?

186


How many types of variable in perl?

197


What is the use of command “use strict”?

246


What is epoch time in perl?

175