Perl Test Guidance Needed

June 11, 2013 at 19:57:10
Specs: Windows XP, 1.6/1 Gig
I am an experienced VBA programmer. I have an opportunity to work with programming outside of my experience. The employer knows that I have no prior Perl experience. However, they need someone that can come up to speed rather quickly. They would like to test me and have given me one week to prepare for the test.

My questions are as follows. What are the basic Perl constructs that I should understand? What are the most important ideas/concepts that I should understand? What are the most important syntax rules? What are the most important things you think I should understand for this test? What are your study suggestions? What are important questions that I have not asked?

My argument is that novice programmers struggle with building logical statements. An experienced programmer has the skills to learn a new language with minimal effort. I would like to prove that with a Perl test score that exceeds expectations.

See More: Perl Test Guidance Needed

Report •

June 11, 2013 at 23:25:37
In your place I would spend at least some of the time ensuring that I was completely comfortable with regular expressions and thier use in Perl. Much of the rest is merely syntax which is easily learnt.

Report •

June 12, 2013 at 07:52:47
Are those your questions, or ones that they gave you to use in your preparation for the test?

Those questions are generic enough that the answers could apply to most languages.

Knowing how to use regular expressions as ijack recommends is very important, but is insufficient prep work for a test like you'll be given.

Since they already know that you're not a Perl programmer, my recommendation would be to read over some of the perl documentation to get a good overview of the language.

If you haven't already done so, you should install perl on your system. It comes with lots of documentation, which is accessed with the perldoc utility.

For example:
D:\>perldoc perldoc

    perldoc - Look up Perl documentation in Pod format.

        B<perldoc> [B<-h>] [B<-D>] [B<-t>] [B<-u>] [B<-m>] [B<-l>] [B<-F>]
            [B<-i>] [B<-V>] [B<-T>] [B<-r>]
            [B<-L> I<language_code>]

D:\>perldoc perl

    perl - The Perl 5 language interpreter

    perl [ -sTtuUWX ] [ -hv ] [ -V[:*configvar*] ]
    [ -cw ] [ -d[t][:*debugger*] ] [ -D[*number/list*] ]
    [ -pna ] [ -F*pattern* ] [ -l[*octal*] ] [ -0[*octal/hexadecimal*] ]
    [ -I*dir* ] [ -m[-]*module* ] [ -M[-]*'module...'* ] [ -f ]
    [ -C [*number/list*] ] [ -S ] [ -x[*dir*] ] [ -i[*extension*] ]
    [ [-e|-E] *'command'* ] [ -- ] [ *programfile* ] [ *argument* ]...

    The perldoc program gives you access to all the documentation that comes
    with Perl. You can get more documentation, tutorials and community
    support online at <>.

    If you're new to Perl, you should start by running "perldoc perlintro",
    which is a general intro for beginners and provides some background to
    help you navigate the rest of Perl's extensive documentation. Run
    "perldoc perldoc" to learn more things you can do with perldoc.

    For ease of access, the Perl manual has been split up into several


Report •

June 16, 2013 at 18:25:33
Thank you ijack and FishMonger. I bought the book Perl Programming by Tom Christiansen (and others.) I am feeling rather stupid, but I am afraid that I am stuck on some of these regular expressions and I am finding it difficult to advance given my lack of understanding here. I am hoping you can provide me with some insight.

I thought that I was following along fairly well until I hit these couple of snags. From the book:
...suppose you’re using the substitution command (s///) on the default string (variable $_, that is), and you want to remove a string of x’s from the middle of the string. If you say:

$_ = “fred xxxxxx barney”;


it will have absolutely no effect. That is because the x* (meaning zero or more x characters) will be able to match “nothing” at the beginning of the string since the null string happens to be zero characters wide and there’s a null string just sitting there plain as day before the “f” of “fred”

My question: if “plain as day?” means “clear as mud”, then I would agree. Is this saying that you need something like “ fred …” or “wilmafred…” in order for x* to apply to this situation? Why does it matter what is in front of fred when all x’s follow fred? Am I misunderstanding the meaning of “in front of”?

And another area of confusion the author writes:
Often someone will have a string like:

larry:JYHtPh0./NJTU:100:10:Larry Wall:/home/larry:/bin/bash

and will try to match “larry:” with /.+:/. However the + quantifier is greedy and will match everything up to and including “home/larry:”…Sometimes you can avoid this by using a negated character class; that is, by saying /[^:]+1/, which says to match one or more noncolon character (as many as possible), up to the first colon.

My question: how does /[^:]+1/ match larry: I feel like there is something left out here or maybe that was supposed to be obvious. It feels like it is looking for the colon and not larry

Report •

Related Solutions

June 16, 2013 at 20:53:46
I doubt that you're correctly quoting the text/code from the book.

The are no null characters in the string you posted and the posted regex is not anchored, so it will strip out the x's from that string.

Report •

Ask Question