PERL Interview Question
There are many things that you can do ahead of time to prepare for the interviewing process, and move yourself a step above of the competition. Updating your resume and reviewing frequently asked interview questions can be very effective, and goes a long way in getting the most out of your interview.
How to concatenate strings with Perl?
Method #1 - using Perl's dot operator:
$name = 'checkbook';
$filename = "/tmp/" . $name . ".tmp";
Method #2 - using Perl's join function
$name = "checkbook";
$filename = join "", "/tmp/", $name, ".tmp";
Method #3 - usual way of concatenating strings
$filename = "/tmp/${name}.tmp";
How do I read command-line arguments with Perl?
With Perl, command-line arguments are stored in the array named @ARGV.
$ARGV[0] contains the first argument, $ARGV[1] contains the second argument, etc.
$#ARGV is the subscript of the last element of the @ARGV array, so the number of arguments on the command line is $#ARGV + 1.
Here's a simple program:
#!/usr/bin/perl
$numArgs = $#ARGV + 1;
print "thanks, you gave me $numArgs command-line arguments.\n";
foreach $argnum (0 .. $#ARGV) {
print "$ARGV[$argnum]\n";
}
-
Technical Questions
- General Question (1017)
- HTML Question (500)
- XHTML Question (400)
- XML Question (652)
- CSS Question (400)
- CSS2 Question (358)
- AJAX Question (302)
- JavaScript Question (562)
- FLASH Question (622)
- Dot Net Technology Question (645)
- ASP Dot Net Question (242)
- Web Services Question (644)
- C # Question (754)
- C Question (302)
- C++ Question (622)
- JAVA Question (372)
- Testing Question (852)
- MySQL Server (322)
- Oracle Question (354)
- ASP Question (245)
- PHP Question (847)
- Visual Basic Question (748)
- MS Access Query Question (645)
- Linux Question (684)
- Unix Question (642)
- SAP Question (546)
- PERL Question (754)
- Python Question (984)
- Networking Question (372)
- Operting System Question (382)
All Information about Interview. Tips and Guideline. www.interviewGHOST.com
What Users Asked:
Advertisement Area :