Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Further to the comments already given, your program is a very naive implementation of a conjugation script. Of course, it will give the wrong answer for lots of more or less irregular verbs. So even when you correct all the syntax errors, it will still not run "correctly" in the sense that it will not give you the right answers.

And yet, no need to despair or re-invent the wheel when CPAN will provide you with such nice modules as Lingua::EN::Conjugate:

use Modern::Perl qw/2015/; use Lingua::EN::Conjugate qw/conjugate/; while ( my $verb = <DATA> ) { chomp $verb; for my $pronoun (qw/I you he we you they/) { say conjugate( verb => $verb, pronoun => $pronoun, allow_contractions => 1, tense => 'present', ); } say '---------------------'; } __DATA__ walk hear be have go try sing may
Output:
I walk you walk he walks we walk you walk they walk --------------------- I hear you hear he hears we hear you hear they hear --------------------- I'm you're he's we're you're they're --------------------- I've you've he's we've you've they've --------------------- I go you go he goes we go you go they go --------------------- I try you try he tries we try you try they try --------------------- I sing you sing he sings we sing you sing they sing --------------------- I may you may he may we may you may they may ---------------------

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

In reply to Re: perl experts .. plz by CountZero
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 meditating upon the Monastery: (7)
As of 2024-04-19 08:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found