"If you're OO, why are you exporting?"
I export the $errstr (and/or an alter-ego errstr() function) on demand. For no other reason than to give the user something to look for when new() fails. Maybe this is a sign I haven't properly thought through the OO creation/use.
I've been crawling the fence for some time on the OO issue.
Should I do so much in new() or should I simply create the object and make another method (say "connect") to do the rest of the work? Seems rather pointless to make 2 steps out of one. On the other hand, if someone were to use this in a long running script, they may want to get updates of the modem status. In which case the only option is to "new()" again, which doesn't quite seem right either. Or maybe the real answer is to break new into "new()" and "connect()" with a fall through from new -> connect.
Should I make a non-OO interface available? No reason why it can't swing both ways. The methods can be teased into using either the blessed object or a static variable. Especially if I break up new.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.