Re: problem about the perl code. thanks for any comments



yezi wrote:
Do not know why it can not open file (*.RD ) in the current directory.

<snip>

     34            open myRDfile, $sitename or die "Error:Could not
open $sitename ";

In addition to Sinan's observations, if you want to know why an open() statement fails, you should ask Perl about the reason.


    open myRDfile, $sitename or die "Could not open $sitename: $!";
---------------------------------------------------------------^^

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.



Relevant Pages

  • Re: OPEN( , Get , or slurping problem
    ... >> I figured out that the reason for my problems was that I run my ... > CGI et similia. ... Anyway, since most Perl things I do actually are CGI apps, I have ... Gunnar Hjalmarsson ...
    (comp.lang.perl.misc)
  • Re: Reading HTTP response body that is gzipd *and* in UTF-8
    ... The reason I'm not using PerlIO::gzip is mostly just ignorance. ... BM> anything that's visible at the Perl level. ... BM> meaningless to apply gzip to a stream of characters. ... BM> Encode the value of the charset MIME parameter). ...
    (comp.lang.perl.misc)
  • Re: Snowy ASCII roguelike demo video
    ... beginning stages of writing a Perl RL, but I want to use PNG tiles, ... both SDL and OpenGL in Perl, but had tons of issues -- I couldn't get ... but for whatever reason I ... What kind of roguelike are you writing? ...
    (rec.games.roguelike.development)
  • Re: Beautiful Python
    ... and I've stumbled across something that's sort of annoying and wanted to find out of there was a good reason behind it. ... In a Perl program when you're calling other modules you'll add "use" statements at the ... Is there a sound reason for putting the imports ... there are are developers just loading modules in as they need them. ...
    (comp.lang.python)
  • Re: Docs comprehensibility
    ... who started his programming 'career' a few years ago by modifying Matt ... to fix the Perl documentation. ... >> feel confident enough. ... Gunnar Hjalmarsson ...
    (comp.lang.perl.misc)