Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Need crash course in PERL!

by cbrackin (Initiate)
on Aug 26, 2008 at 23:26 UTC ( [id://707014]=perlquestion: print w/replies, xml ) Need Help??

cbrackin has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Need crash course in PERL!
by oko1 (Deacon) on Aug 27, 2008 at 02:07 UTC
    > Part of the test is to see how I use resources to obtain the data/knowledge needed to simply 
    > get the job done - not that I even have to do it myself!So that's where you guys come in!
    
    
    FATAL ERROR in social_interaction.h:
        Invalid use of shared resources
        Access denied
        This attempt has been logged and will be reported
    

    Err... we're not that kind of resource.

    We're always happy to help someone who is having a problem with Perl. You, however, are not having a problem with Perl: you're having a problem with misleading your potential employer. That's not something we're going to help you with - except, perhaps, in a larger context (i.e., fixing yourself) and longer term (assuming you're smart enough to take the advice that's already been given to you.)

    Have a little self-respect. A little dignity, perhaps. Instead of scrambling in a panic, learn to say "I don't know." Have a little spine, and say "why am I being tested on something I've never claimed to know and that I won't be using?" You may not get that specific job (or you might - if your potential employer was testing you for the very qualities I'm describing; a test you are currently failing), but you'll have the tools to let you get a job where you'll be valued and respected... instead of being a dishrag.

    
    -- 
    Human history becomes more and more a race between education and catastrophe. -- HG Wells
    

      ++ Very nice reply (not that any were bad, per se), but I really like the way you worded it. Hopefully he gained some type of insight from it. Regardless of whether or not he did, kudos for such a nicely worded insightful reply :)

Re: Need crash course in PERL!
by chromatic (Archbishop) on Aug 26, 2008 at 23:33 UTC

    I'll write it for you under two conditions. First, I want you to spell the language "Perl", because that's its name. Second, I want 20% of your salary for the first year, 15% for the second year, and 10% for the third year.

    In return, you can claim that your code was written by an author of multiple highly-regarded books on Perl. (You can even imply that you wrote it, as that doesn't seem to be a problem.)

      Wow 45K for 2 lines of code. That beats my record of 2K for 10 lines ;)

      #!/usr/local/bin/perl -w `sqlplus_script $argv[0]`

        We got quoted $15K from a support contractor for what ended up one line of Perl: in-place edit preserving file modification times. I unfortunately made my hourly wage for 30 minutes. Though it was really more than fair since another hacker gave me the one-liner. :) So I was essentially paid for knowing who to ask.

Re: Need crash course in PERL!
by Joost (Canon) on Aug 26, 2008 at 23:39 UTC
    As part of an upcoming interview, I've been asked to create a PERL script to import a csv file and create two output files. WHY couldn't they have asked for the script to be built in SQL Plus? I've developed in SQL Plus and dabbled in other languages. I've never even seen PERL! I won't be developing in PERL...this is just a test!
    It's quite easy: this job (I'm assuming it's a job interview) is not for you. It's not worth faking it. Find another job/interview.

    update/also: http://plzsendmethecode.blogspot.com/

Re: Need crash course in PERL!
by Zenshai (Sexton) on Aug 26, 2008 at 23:59 UTC
    I've never even seen PERL! I won't be developing in PERL...this is just a test!

    Why don't you try Perl before you rule it out?

    Here's a module you might find useful if you do decide to do this yourself. Text::CSV

    P.S. I think this is a great interview test/question.
Re: Need crash course in PERL!
by Cody Pendant (Prior) on Aug 27, 2008 at 01:48 UTC
    Here's a question -- are you sure your interviewers aren't reading this right now?


    Nobody says perl looks like line-noise any more
    kids today don't know what line-noise IS ...
Re: Need crash course in PERL!
by GrandFather (Saint) on Aug 26, 2008 at 23:44 UTC

    Here's a hint for any job interview, test or presentation: read the instructions and check your work.

    At PerlMonks "the instructions" are linked below the edit field for the node you are entering (How do I post a question effectively?) and you can preview your work once you have entered it by clicking the "preview" button.


    Perl reduces RSI - it saves typing
Re: Need crash course in PERL!
by talexb (Chancellor) on Aug 27, 2008 at 14:19 UTC
      As part of an upcoming interview, I've been asked to create a PERL script to import a csv file and create two output files. WHY couldn't they have asked for the script to be built in SQL Plus? I've developed in SQL Plus and dabbled in other languages. I've never even seen PERL! I won't be developing in PERL...this is just a test! Part of the test is to see how I use resources to obtain the data/knowledge needed to simply get the job done - not that I even have to do it myself! So that's where you guys come in! Can you help? PLEASE???

    Instead of complaining about how unfair the test is, consider it a challenge (although judged on this post, it looks like you've failed already). Give it your best shot. Approach it with humour.

    Ten years ago, when I was hiring C/Pascal developers, I used the company-supplied programming test to winnow out the candidates. One of the questions asked the applicant to write a bubble sort in C.

    I know, I can hear you saying "But the bubble sort's the least efficient!" and you can tell me it's O(n^2) in the worst case. Yes, I know that.

    But that's not the point. Nor is it pertinent to point out that Linux/Unix has a sort command. I specifically asked for a bubble sort.

    I really liked one applicant, but he'd coded up a quicksort solution. I was impressed, and I typed it in and it compiled and ran flawlessly. But I didn't hire him, because I'd specifically asked for a bubble sort.

    An interview is a contrived social situation: when you're asked to do something in a particular way, my strong advice is to just do it the way the interviewer asks. Follow up with clever alternatives later.

    Sometimes they're interested in your answer, and sometimes they just want to see how you react. Like asking how many golf balls fit into a station wagon. Of course it's a ridiculous question. Do you complain about it, or do you start with a joke about what a great prank that would be, then come up with some rough approximation?

    So why the bubble sort? Because I can describe the algorithim quickly, and the code (two nested for loops) can be dashed off in about five minutes.

    And the candidate who wrote that great quicksort routine? I didn't hire him - I knew that if I hired him and then gave him specific instructions to do something a particular way, he'd probably do it 'more efficiently' and therefore incorrectly for the required task, then he'd have to do it again, making us both unhappy with the outcome.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      One of the questions asked the applicant to write a bubble sort in C.
      I don't know Bubble Sort. I have seen it some time, years ago, but I don't care much about learning algorithms by heart, so I don't remember how it goes. I wouldn't recognize a Bubble Sort if it hit me in the face. Neither would I recognize a Quicksort.

      Does that make me a bad programmer? According to your test, I am.

      Perhaps your candidate was not being a smartass. Maybe he was like me, doesn't know any sorting algorithms by name, but he does know enough to write a program that works. So maybe he was just trying to make the best of a poor situation, trying to write any sorting function that works. And he succeeded.

      And you threw away a likely very fine candidate, just because he doesn't think like you. Instead, you think you have him all figured out. Shame on you.

      But I could be wrong, thinking he might have been thinking like me.

          I don't know Bubble Sort. .. Does that make me a bad programmer? According to your test, I am.

        Nope -- you never saw my carefully defined paragraph describing the bubble sort. I won't try to replicate it here, but I can assure you would have been able to read and understand it.

          Perhaps your candidate was not being a smartass. Maybe he was like me, doesn't know any sorting algorithms by name, but he does know enough to write a program that works. So maybe he was just trying to make the best of a poor situation, trying to write any sorting function that works. And he succeeded.

        I guess we'll have to agree to disagree on that one.

          And you threw away a likely very fine candidate, just because he doesn't think like you. Instead, you think you have him all figured out. Shame on you.

        I had to make a decision based on the limited amount of information I had, and in a limited amount of time. I was constrained by a number of other items -- the pay wasn't that great, yet I was trying to fill a position that required decent C and Pascal, knowledge of data communications, as well as the ability to perform second line customer support and occasionally carry a pager. It was hard to find candidates that met all of those criteria.

        Alex / talexb / Toronto

        "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      And the candidate who wrote that great quicksort routine? I didn't hire him - I knew that if I hired him and then gave him specific instructions to do something a particular way, he'd probably do it 'more efficiently' and therefore incorrectly for the required task, then he'd have to do it again, making us both unhappy with the outcome.

      That sounds like a whole lot of manure.

Re: Need crash course in PERL!
by ysth (Canon) on Aug 27, 2008 at 02:29 UTC

      From the OP:

      Part of the test is to see how I use resources to obtain the data/knowledge needed to simply get the job done - not that I even have to do it myself! So that's where you guys come in!

      The emphasis is mine; those are the lines I read between. The nearest and simplest antecedent to "it" in "do it myself" is "the job".

        cbrackin I’m a bit confused with your interpretation of your task, you say that you are asked to :-

        “create a Perl script” to do a certain task, you also say

        "that the test is to see how I use resources to obtain the data/knowledge needed to simply get the job done"

        Yet in the task spec it specifically says “Write a Perl script” any interpretation of that would be that

        you have to write it and "not that I even have to do it myself"!

      I think they all guessed his intentions by his spelling of 'Perl' and the way he posted his node. That is, finding a site that specializes in Perl, registering, copy/paste his request, and wait. He did not bother to read the instructions to the monastery.

      Of course, you may be right. He may be simply asking for a crash course in Perl.

      The post has a bad 'aura', if you will.

      I'm so adjective, I verb nouns!

      chomp; # nom nom nom

        He may be simply asking for a crash course in Perl.

        perlintro?

      That's not the plain meaning of the post, but perhaps your read-between-the-lines skills are better than mine.
      First step to reading between the lines is reading the lines :) Try it :)
Re: Need crash course in PERL!
by Pancho (Pilgrim) on Aug 27, 2008 at 12:50 UTC
    The good news is that the test program is not that advanced... so depending on how much time you have an how fast you learn, I recommend a couple of books 'Learning Perl' by Schwartz, et al... and 'Perl Cookbook' by Christiansen and Torkington as a reference to answer the how would I do this type of questions... Good luck...
    Pancho
Re: Need crash course in PERL!
by TGI (Parson) on Aug 27, 2008 at 18:20 UTC

    Others have pointed out Learning Perl and The Perl Cookbook as good sources. You ought to be able to cobble something together in a few hours if you know how to skim effectively. You might want to look at Picking Up Perl, as it's online and free.

    Some people have suggested CPAN, and generally I agree that CPAN is the way to go when you need to do something. However, for a complete newb and for this task, I'd suggest sticking with straight forward DIY parsing code. The CPAN options will all require understanding data structures and references and such--not to mention module installation. Skip that crap, it's more work than it's worth at this point. At first you take baby steps. Learning to use CPAN will allow you to run, but you are definitely not ready yet.

    Post your code when you get stuck.


    TGI says moo

Re: Need crash course in PERL!
by gone2015 (Deacon) on Aug 27, 2008 at 16:54 UTC

    Of course, this may be a test of whether you can read a specification.

    • CSV doesn't really do fixed length fields... or do the field widths given imply that some data validation is required ? If so, how should errors be dealt with ?
    • The Date/Time fields don't specify the form of the time-stamp -- which makes this part deeply tricky.
    • The length of call calculation: if the time-stamps give fractional seconds, what rounding should this perform ?

    Beyond that... as a programming language Perl is a little odd, but not that difficult to get to grips with. Some experience with a scripting language will help. You've been offered a number of pointers.

    However, a key thing about Perl is the free availability of a shed-load of useful stuff you can use. In this case, parsing CSV can be trickier than it looks. But a quick poke at CPAN http://search.cpan.org/ throws up lots of possible helper modules. Now, the tricky bit is deciding which to use... there you might find the excellent monks more inclined to share experience -- assuming you checked the FAQ, Tutorials and searched for earlier discussion(s).

Re: Need crash course in PERL!
by mr_mischief (Monsignor) on Aug 29, 2008 at 21:19 UTC
    If what you really want is a crash course in Perl, may I suggest contacting the fine folks at Stonehenge Consulting?

    They do Perl training and consulting. They even write books on Perl. If anyone really needs a crash course, these guys could deliver for the right price.

    I don't work there (and probably never will be qualified to do so) and I've yet to be a client. I don't get any consideration for this recommendation. I do own copies of a few books by their people, read lots of what they write online and in magazines, and respect them very much. I've also contributed a bit to a fund when one of them needed a hand, as I'm sure many here did. If I was going to pay for a crash course in learning about Perl, Stonehenge is probably where my money would go.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://707014]
Approved by Joost
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-19 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found