Interview questions

Cgi Perl interview questions – page 4

141 questions. Tap “Show answer” to check yourself.

  1. How to extract pin_code,phone_number,year from text file using regular expressions in perl

  2. What is caller function in perl?

  3. 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.

  4. Write a script to generate n prime no.s?

  5. Why we use "use lib $path"?

  6. Difference between Perl and Mod_perl?

  7. Write a script to check whether user enter a value is a leap year or not?

  8. Write a script to display mirror image of a entered value and also check whether Palindrome

  9. 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?

  10. 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 "$an$bn$cn$dn"; 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.

  11. 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,

  12. What is the difference between $array[1] and @array[1]?

  13. 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 ?

  14. What is the difference between require and use in perl?

  15. What is the difference b/w coldfusion MX 6 and Coldfusion MX 7?

  16. Which web site will help the student to download the Java mini Project ?

  17. while(my($key, $value) = each(%hash) ) { print "$key => $valuen"; } my($key, $value); while(($key, $value) = each(%hash) ) { print "$key => $valuen"; } What is the different between these two code in case of "my" usage ?

  18. How to install a package in perl ?

  19. How to count no of occurrence of a unique patterns in perl?

  20. How do you debug a Perl scripting ( at the compile time error or run time error) in Unix environment ?

  21. How to search a unique pattern in a file by using perl hash map function ? plz answer me

  22. What r the different type of function in perl ?

  23. How can you create an object of a class in a package?

  24. What is the procedure to define a user define module in your perl application?

  25. How would you trap error occurred in the perl program/file?

  26. Can any1 tell me 2 write the script using perl script 2 looking at a log file 2 see wheather the test has passed or not.

  27. What is the difference between module and package?

  28. Write a script for 'count the no.of digits using regular expressions in perl..

  29. i have a folder called 'error' and in that, i have error log files which are generated by the build, now i want to findout the string 'error' from each log file and that error has to be copied into the another file called 'analysis'. how do you do this in perl?

  30. What is the difference between chop & chomp functions in perl?

Companies that ask Cgi Perl questions