Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

If you could explain, line by line, what your rationale is for the code you wrote, then perhaps we could be of further assistance in facilitating your learning process. I could write the thing for you in a couple of minutes. I've already devoted more time than that to trying to guide you in the right direction instead -- I feel no compelling need to write five lines of code that you can turn in to your teacher. My motivation is to help a newcomer get the sort of start with Perl that he or she will be able to build upon, and just writing some code for you, though it would save you and I both time this time around, won't contribute toward you becoming proficient with Perl, won't prepare you for the next assignment, and won't start someone on the path toward becoming a Perl user as time goes by.

By you going through the process of explaining line by line why you made the choices you did in writing the code, we can better understand your thought-process, and we will be able to provide you useful insights. In particular, I'd like to know if it is dictated by the assignment itself that you use split, shift, pop, and a C-style for loop. If not, those are odd choices. Was it specified in the assignment that you use a single array to represent both the tenses and the suffixes? Again, a strange choice. But we really don't know which of your design choices are required elements in the assignment, and which are all yours. ...and if all yours, why.

The most immediate problem is that you left off a closing curly brace. Curly-braces are almost always supposed to match, a left needs a corresponding right. Same with parenthesis and square brackets. If you add that to the end of your script where it belongs, the script should compile but still won't work, for some of the other reasons I enumerated in an earlier post.

Have you read perlintro? You've spent more time fiddling with code and posting here than it takes to read perlintro, and it contains about 90% of what you would need to complete your assignment. After doing that, think it through; think to yourself, "How would I solve this with pencil and paper?" Your code doesn't demonstrate that thought process. Instead, it seems more like you pulled elements out of your lecture notes and inserted them into the code without understanding what they do. Once you have a concept of how it might be solved with pencil and paper, start writing code that does that, and add nothing that doesn't move you toward that goal... well nothing aside from strict and warnings.


Dave


In reply to Re^3: perl experts .. plz by davido
in thread perl experts .. plz by blueberry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-23 10:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found