Well, thank you for your help. Another expert really helped me to solve this query without really knowing what is posts_for and all stuff. No offense, but I think stackoverflow is far better than and easy to handle. I posted the same question twice. I understand initially it was my mistake to put up the question as I am new to programing but the response I got here is not appreciable. Well, as perlmonks is to learn from others mistake as what I understood from the monks here. I would like to write that not only it matters if someone puts up the question in right way but it also matters how the person understands the easy question. Sometimes it may happen that the question is rather easy but the person makes it complicated and hard to understand for himself. For people who want to know the answer for my question, I have posted it down. I am all new to programing, I don't know how much this helps to rest of all, and so think each bit is important.

while (<IN0>) { my $currentURI = $_; chomp($currentURI); my @tags = eval { # Use eval to make this safe, $@ will con +tain any error $c->posts_for(uri =>"$currentURI"); } my $error = $@; if (defined($error)) { warn($error); # If eval failed, warn and skip to next l +ine next; } if (! @tags) { next; # Assuming no tags means go to next line +in input } ... do something ... }

In reply to Re^6: Error handling by smandape1
in thread Error handling by smandape1

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.