in reply to Re^5: Error handling
in thread Error handling
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 ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Error handling
by ikegami (Patriarch) on Jul 19, 2011 at 01:22 UTC |