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

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Homework -- How Do I Read A Regex?
by Tanktalus (Canon) on Jul 27, 2005 at 00:15 UTC

    1 - it's trying to match the regular expression on the line starting $string =~ ... against the string found on the previous line.

    2 - I'd start with #include <stdio.h> and #include <stdlib.h>. Maybe I'd also have #include <sys/types.h> and #include <regex.h>. I wouldn't start with #! /usr/local/bin/perl, and I definitely wouldn't start with #! /usr/local/bin/perl5.003 -w. I think the C preprocessor would take deep offense at either of those.

    Finally, I'd get on to reading my course material. Most of my professors asked questions right out of the course material. When I finally figured that trick out, it was my last year, and my GPA shot way up.

      I think the C preprocessor would take deep offense at either of those.
      lol. Tanktalus++


      holli, /regexed monk/
Re: Homework -- How Do I Read A Regex?
by Caron (Friar) on Jul 27, 2005 at 07:28 UTC
Re: Homework -- How Do I Read A Regex?
by GrandFather (Saint) on Jul 27, 2005 at 01:00 UTC

    I wouldn't prototype in Perl. By the time you've typed enough characters in Perl to look like you've done some work you have completed the task. That's not prototyping, that's implementing.

    Were I you I'd take a look at perlretut


    Perl is Huffman encoded by design.
Re: Homework -- How Do I Read A Regex?
by davorg (Chancellor) on Jul 27, 2005 at 13:09 UTC

    If your problem was that urgent then reading the Perl manual pages or the textbook for your course would probably be far more effective than posting a request on a web site. We don't tend to respond well to urgent requests for homework help around here.

    Perhaps you'll find YAPE::Regex::Explain to be interesting and/or useful.

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: Homework -- How Do I Read A Regex?
by Nkuvu (Priest) on Jul 26, 2005 at 23:44 UTC
    Wow, this smells a lot like homework. Or worse, a test question.

    Retitled by holli from 'Re: Quick reply needed'.

Re: Homework -- How Do I Read A Regex?
by xorl (Deacon) on Jul 27, 2005 at 12:51 UTC
    Yep clearly a homework or test question. However from the questions, I think the professor is an idiot.

    Q1 - Google it: perl regex

    As for Q2...What kind of #$@#$!@# idiot would prototype in perl. As noted above just implement it and you're done. This is a good example of why I don't think school is worth the money you pay for it. With dumb profs teaching you to do stupid things you'd be better off getting a job.

Re: Homework -- How Do I Read A Regex?
by Fang (Pilgrim) on Jul 27, 2005 at 07:27 UTC

    Homework duplicate? And without any formatting mind you.