Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Perl Interview Questions: Perl Programming FAQ
Perl Interview Questions: Perl Programming FAQ
Perl Interview Questions: Perl Programming FAQ
Ebook170 pages1 hour

Perl Interview Questions: Perl Programming FAQ

Rating: 0 out of 5 stars

()

Read preview

About this ebook

The Ultimate Reference & Learning Guide for the Perl Developer!

In depth and current overview of common challenges with Perl!

Fluency with Perl is essential for a career as a developer, and having a firm grasp on Perl basics can impress during a job interview. From helping you assess your current skill level to preparing for the interview, this guide will get you where you need to be. With Perl’s versatility, a true understanding is the only way to go, so set yourself apart from other candidates and show you have what it takes to land the job. More than just a rehash of the basics, more than just documentation and sales presentations, each section is based on project knowledge and experience gained on successful high-profile Perl implementations so you can set yourself apart from other candidates!

Key topics include:

• Perl for text manipulation, system administration, and web development
• Features new to Perl 5
• Data munging
• Challenges with implementation and configurations
• Unique aspects of coding with Perl

LanguageEnglish
PublisherEquity Press
Release dateJun 3, 2011
ISBN9781603322072
Perl Interview Questions: Perl Programming FAQ

Read more from Equity Press

Related to Perl Interview Questions

Related ebooks

Certification Guides For You

View More

Related articles

Related categories

Reviews for Perl Interview Questions

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Perl Interview Questions - Equity Press

    Question 01: SQL Server Database from PERL

    How do I connect with SQL Server from PERL and how do I display database table info?

    A: There is a module in PERL named DBI (Database Independent Interface) which can be used to connect to any database by using the same code You should use database specific module along with DBI, here it is:

    For MSaccess it is DBD::ODBC

    For MySQL it is DBD::mysql driver

    For integrating oracle with PERL, DBD::oracle driver is used

    For SQL server, there are many available custom defined ppm (perl package manager) like Win32::ODBC, mssql::oleDB, etc

    Together with DBI mssql::oleDB, we can access SQL server database from PERL The commands to access the database are the same for any database

    Question 02: Significance of @ISA, @EXPORT, @EXPORT_OK

    What's the significance of @ISA, @EXPORT @EXPORT_OK,

    %EXPORT_TAGS list and hashes in a PERL package?

    A: @ISA -> each package has its own @ISA array This array keeps track of classes it is inheriting

    Ex:

    Package child;

    @ISA= (parentclass);

    @EXPORT this array stores the subroutines to be exported from a module

    @EXPORT_OK this array stores the subroutines to be exported only on request

    Question 03: Setting the Location of DBIpm Manually

    I'm getting the Can't locate DBIpm errorI know where the DBIpm is located but how do I tell the Makefilepl the location of it?

    Can't locate DBIpm in @INC (@INC contains:

    /exlibris/aleph/a16_1/product/perl-582/lib/582/aix /exlibris/aleph/a16_1/product/perl-582/lib/582 /exlibris/aleph/a16_1/product/perl-582/lib/site_perl/582/aix /exlibris/aleph/a16_1/product/perl-582/lib/site_perl/582 /exlibris/aleph/a16_1/product/perl-582/lib/site_perl) at MakefilePL line 23

    A: I think this will work

    Put this in the top of the makefilepl

    use lib C:/something/something

    Question 04: Use and Require

    What is the difference between Use and Require?In which case should Use be used and not Require?

    A: Use:

    1 This method is used only for the modules (only to include pm type file)

    2 The included objects are verified at the time of compilation

    3 There is no need to give a file extension

    Require:

    1 This method is used for both libraries and modules

    2 The included objects are verified at the run time

    3 There is no need to give a file extension

    Question 05: My and Local

    What is the difference between my and local variable scope declarations?

    A: The variables declared with my() are visible only within the scope of the block which names them They are not visible outside of this block, not even in routines or blocks that it calls On the other hand, local() variables are visible to routines that are called from the block where they are declared Neither is visible after the end (the final closing curly brace) of the block at all

    Question 06: PERL as a Scripting or a Programming Language

    I've been using PERL primarily as a scripting language Mostly, I use it for extraction and reporting With the recent developments in PERL, however, there seems to be the trend that PERL is able to do much, much more while retaining compatibility to be just a scripting language

    What do you think about the way people are using PERL today? Are you satisfied that most people use it for simple tasks like log parsing? Would you like to see more advanced applications being built with PERL versus a compiled language?

    A: I am perfectly happy for PERL to continue parsing logfiles PERL has always been and will always be a humble language When I am 80 years old, even if everyone in the whole world puts me on a pedestal and thinks I'm the most Renaissance man that ever lived, I still intend to take out the trash when my wife asks me to Just because I'm learning Japanese doesn't mean I have to stop speaking English

    But just as people grow (and are stretched), PERL continues to grow (and be stretched) PERL has acquired new skills over the years, and people have been using PERL to do all sorts of things that are arguably at the limits of its capabilities The solution to this is not to stop people from doing it, but to increase PERL's dynamic range

    People are already building more advanced applications with PERL There are some aspects of that process that aren't as easy as they could be They're difficult In times past, we were proud of the fact that the hard things were even possible with Perl5 We often chant the slogan: Easy things should be easy, and hard things should be possible

    But as with any slogan, there are some questionable assumptions hidden behind the sentiment We assume that it's obvious which things should be easy or hard, and that the things that are currently easy are the things that ought to be easy We assume that making the hard things easy will necessarily cause the easy things to become hard But sometimes it's not obvious what should be easy or hard Sometimes the wrong things are easy And sometimes there are ways to make the hard things easier without making the easy things harder

    Some of the complexity in a Perl5 program is necessary to the solution, and some of it isn't We can't eliminate the necessary complexity, but we can hope to get rid of some of the needless complexity That will make everything easier

    I'm really under no illusions that we can make everything easier at once There's no such thing as a perfect language Merely making a more expressive language means it's in some sense more difficult to learn to express yourself responsibly in it

    Question 07: Query String

    I have a query string and I'm trying to send it off to a script that only accepts posts, so my get QS scheme doesn't work

    How do I work around with this query?

    A: Look in the lwpcook docs, under the heading POST There's a 7 line script there, at the top, that's very easy to adapt into a little command line script

    Question 08: Image::Magick—Changing Quality

    I decided to use Image::Magick to create thumbnails for images uploaded by an end user

    I'm not sure what I'm missing here, but my purpose for creating a thumbnail is to save bandwidth in the future I thought it would be logical if the thumbnail is almost 70% smaller than the original size, then the image size should be dramatically smaller

    Here is

    Enjoying the preview?
    Page 1 of 1