$_=PDF::Core::PDFGetline ($fd,\$offset); die "Can't read cross-reference section, according to trailer\n" if ! /xref\r?\n?/ ; #### eval { PDF::whatever_method(); }; if( $@ ) { print "Ooops an error occurred processing that pdf file; } #### while( @FILES ) { $somevar = new PDF( $_ ); process( $somevar ); } #### while( @FILES ) { eval { $somevar = new PDF( $_ ); process( $somevar ); }; if( $@ ) { print "Ooops on $_\n"; } }