develooper Front page | perl.beginners | Postings from May 2008

pushing errors to another sub

Thread Next
From:
Robert Hicks
Date:
May 14, 2008 17:25
Subject:
pushing errors to another sub
just "bad" pseudo code:

sub one {
   $process->name(\$html) || $errors_from_one( $process->error() );

   $process->name(\$text) || $errors_from_one( $process->error() );
}

sub errors_from_one {
     my $error = @_;

     push (my @errors, $error);

     # do stuff to make sure the errors are uniq

     return my @uniq_error_list;
}


I want to be able to get at those errors later. Will something like that 
work?

Robert



Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About