Wednesday, 30 April 2014

PERL interview questions


1. What is PERL?
PERL - Practical Extraction Report Language

It is high level, General Purpose Programming Language.
It is used for text processing, web development.
2. What arguments do you frequently use for the Perl interpreter and what do they mean?

•-w Which show warning
•-d Which debug
•-c Which compile only not run
•-e Which executes
• -e for Execute, -c to compile, -d to call the debugger on the file specified, -T for
train t mode for security/input checking -W for show all warning mode (or -w to show
less warning)
•-strict = to get information about error msg.
3. How will you declare constants in PERL?

•Use cpan module Readonly for declaring constants in a perl program so that variables which are used as constants will not be reassigned by other part of the code.

use Readonly;
•Readonly my %ATOMIC_NUMBER =>
• ( NITROGEN => 7, NIOBIUM => 41, NEODYNIUM => 60, NOBELIUM => 102, );

•use Readonly;
Readonly my $MOLYBDENUM_ATOMIC_NUMBER => 42;

No comments:

Post a Comment