Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > read() and IO:File->read() error

Reply
Thread Tools

read() and IO:File->read() error

 
 
Mark H. Siffer
Guest
Posts: n/a
 
      08-28-2003
I have a file I am reading and when I get to a certain point read() and
IO::File->read() return undef. I know I have not reached EOF. Is there
anywhere I can find out why it can't read() or trap an error?

Thanks in advance
MS

 
Reply With Quote
 
 
 
 
Uri Guttman
Guest
Posts: n/a
 
      08-28-2003
>>>>> "MHS" == Mark H Siffer <(E-Mail Removed)> writes:

MHS> I have a file I am reading and when I get to a certain point read() and
MHS> IO::File->read() return undef. I know I have not reached EOF. Is there
MHS> anywhere I can find out why it can't read() or trap an error?

how do you know (better than read()) that you have not reached EOF?

and actually if you rtfm carefully, EOF is marked with a 0 return, undef
means an error. so if you really get undef (check with defined) print $!
and see what the error is.

uri

--
Uri Guttman ------ http://www.velocityreviews.com/forums/(E-Mail Removed) -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
Damian Conway Class in Boston - Sept 2003 -- http://www.stemsystems.com/class
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Emacs VHDL-mode Next-Error, Previous-Error, and First-Error are not working...? BlackHelicopter VHDL 2 02-12-2013 01:12 AM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xffc Thread 0x228 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-30-2006 03:16 PM
Error connecting to SQLExpress 2005 locally (error: 26 - Error Locating Server/Instance Specified) hfk0 ASP .Net 2 03-27-2006 08:43 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 1 03-24-2006 04:20 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-24-2006 02:22 PM



Advertisments