Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

comment on

( [id://3333] : superdoc . print w/replies, xml ) Need Help??
Hey all! It's been a while since I last really worked with Perl - with my school completely moving to Java, and with my classes taking up nearly 100% of my time, I haven't had a chance to dive into a big 'ol project lately - well, now I going to.

Basically, I am fiddling around with Filesys::SmbClientParser (sorry, I forgot the PM syntax for linking to modules - any help?), which parses the output of the smbclient binary. My problem is that sometimes I get error messages that are of no importance, but that are sent to STDERR - I want to be able to catch these error messages before they get to the screen and send them somewhere more useful (a log, maybe).

As I have been working with Java a lot lately, I am hooked on Exception Handling in Java, and it seems like this would be a similar situation - however, I have never worked with any of Perl's error handling (is there any?) capabilites, so I am lost with what to do here.

Thanks for the help!

r. j o s e p h
"Violence is a last resort of the incompetent" - Salvor Hardin, Foundation by Issac Asimov

In reply to "Exception" handling and more... by r.joseph

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.