I find this as a great irony, because not two weeks ago I was looking for some sort of telnet solution to write my own mud client in Perl, but I wasn't sure of how to do the sockets etc. I found a simple solution of sorts in the Perl Cookbook, but it forks, and so I've had some cross-platform issues, mainly trying some of the stuff in Windows. Sometimes it works, sometimes it doesn't.

I managed to get a basic client up and running right away, but yours seems to run a bit better than mine, at least when dealing with incomplete lines. I tried reading byte-by-byte at one point, but it did goofy stuff.

The only pieces of advice or thoughts I have about your code is documentation - I'm a big fan of using things like Pod::Usage and Getopt::Long to add things like a -h option for usage, including more documentation on things like the trigger and untrigger commands. See The Dynamic Duo --or-- Holy Getopt::Long, Pod::UsageMan! for more info. Also, it seems like having things a bit more organized into sections would be useful, such as grouping all config variables into one chunk of code, putting all of the subs together, etc.

I think it's a great piece of code, and I'd like to use a good deal of it to revamp my custom client (the only reason I'm not using something like tintin++ is because this Mud has all kinds of funky elements such as requiring a very specific string right at connection or I lose connection, and using a color encoding scheme that is nonstandard, so I have to use Perl to change it to ANSI)

Thanks for sharing this awesome piece of code! =)

~Brian

In reply to Re: Non-threading Telnet/Mud client by brianarn
in thread Non-threading Telnet/Mud client by Preceptor

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.