• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

Perl Interview Questions Answers

Question - 41 : - How do I send e-mail from a Perl/CGI program on a Unix system?

Answer - 41 : - Sending e-mail from a Perl/CGI program on a Unix computer system is usually pretty simple. Most Perl programs directly invoke the Unix sendmail program. We'll go through a quick example here. Assuming that you've already have e-mail information you need, such as the send-to address and subject, you can use these next steps to generate and send the e-mail message:

Question - 42 : - How do you match one letter in the current locale?

Answer - 42 : - /[^\W_\d]/ We don't have full POSIX regexps, so you can't get at the isalpha() <ctype.h> macro save indirectly. You ask for one byte which is neither a non-alphanumunder, nor an under, nor a numeric. That leaves just the alphas, which is what you want.

Question - 43 : - How many ways can we express string in Perl?  

Answer - 43 : - Many. For example 'this is a string' can be expressed in: "this is a string" qq/this is a string like double-quoted string/ qq^this is a string like double-quoted string^ q/this is a string/ q&this is a string& q(this is a string)

Question - 44 : - What is the output of the following Perl program? 1 $p1 = "prog1.java"; 2 $p1 =~ s/(.*)\.java/$1.cpp/; 3 print "$p1\n";

Answer - 44 : - prog1.cpp

Computer Contributors

Rajeev Katiyar
Yes Baroda

Share your email for latest updates


Our partners