Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open(DAT, "<$annotation_scheme_filepath") 1

Status
Not open for further replies.

noyk

MIS
Feb 20, 2009
23
MY
open(DAT, "<$annotation_scheme_filepath")
|| die ("Cannot read file $annotation_scheme_filepath");

what does this line means?

i've been getting errors from this line
 
any obvious reason for the errors?

the program terminates here saying "Cannot read file $annotscheme at C:/Perl/site/lib/PP/PP_Engine.pm line155"

I already had the file annotscheme at C:/Perl/site/lib/PP.
 
Code:
Cannot read file [red]$annotscheme[/red] at C:/Perl/site/lib/PP/PP_Engine.pm line155"
Is that the actual error you are getting because that var should be a file name and not a scalar?

Keith
 
no, that's my typing mistake

the errors should read

"Cannot read file annotscheme at C:/Perl/site/lib/PP/PP_Engine.pm line155"
 
Code:
Cannot read file [red]annotscheme[/red] at C:/Perl/site/lib/PP/PP_Engine.pm line155
Again, that is not a file name should be at least a name and extension ie. myfile.txt

Keith
 
Do this:

open(DAT, "<$annotation_scheme_filepath")
|| die ("Cannot read file $annotation_scheme_filepath: [red]$![/red]");

$! will return the operating systems error message, like "file not found".

On Windows you don't need a file extension although that is the general case. The extension just lets Windows know which application to use to open a file. If there is no extension a dialog box pops up asking the user to pick an application. But in this case perl is opening the file so there is no problem with the lack of an extension.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
this is so embarassing, but i think that solve my problem

<quote>
Again, that is not a file name should be at least a name and extension ie. myfile.txt
</quote>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top