CGI Perl Question:
Download Questions PDF

Try pattern matching for the following:
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.?


my $str="This is testing of string reverse";
print scalar reverse $s

chomp is used to remove the trailing new line.
If we give chomp list then it will remove the trailing new
line in all the elements of the list.

die function is used for handling the errors in Perl.
It terminates the program immediately after printing the
message passed to the die function.
die("testing of die");
It will print the message "testing of die" on screen and
terminates the program.

Pattern Matching

my $str="";
my $file="/root/abc/cde/fgg/ac.xml";
my $file1="/root/abc/ac.xml/fgg/ac.xml";
print "Pattern $& get matched\n";
print "File Name is $file1\n";
print strftime("%B",0,0,0,11,2-1,2009);


Download CGI Perl Interview Questions And Answers PDF

Previous QuestionNext Question
Write a script to reverse a string without using Perls built in function?Why do you use only Perl when there a lot of more languages available in market like C, Java?