Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] still problems opening new file

Expand Messages
  • Octavian Rasnita
    Hmm, are you running it under Windows? Is your Perl interpreter in the path /usr/bin/perl ? The .doc files are binary files, not text only, so you need to use
    Message 1 of 4 , Jan 6, 2003
    • 0 Attachment
      Hmm, are you running it under Windows?
      Is your Perl interpreter in the path /usr/bin/perl ?

      The .doc files are binary files, not text only, so you need to use another
      method for reading them.

      Teddy,
      Teddy's Center: http://teddy.fcc.ro/
      Email: orasnita@...

      ----- Original Message -----
      From: <diheptal@...>
      To: <perl-beginner@yahoogroups.com>
      Sent: Monday, January 06, 2003 12:21 PM
      Subject: [PBML] still problems opening new file


      chris,

      thanks for your help! but the problem persists. that's to say the
      code runs, but i cannot see the new file [just as you said].

      i followed your advice. here's the code i wrote:


      #!/usr/bin/perl -w

      open(MYFILE, "C:\\Windows\\Desktop\\Wayne\\mope.doc") || die;

      @stuff=<MYFILE>;

      close MYFILE;

      open(NEWFILE, ">C:\\Windows\\Desktop\\Wayne\\mope100.doc") || die;

      foreach (@stuff) {
      print NEWFILE $_;
      }
      close NEWFILE;

      but i still get the error message from Word: "incorrect path or file
      name" and can't open it...

      thanks again

      wayne






      Unsubscribing info is here:
      http://help.yahoo.com/help/us/groups/groups-32.html

      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    • Jenda Krynicky
      From: Octavian Rasnita ... Not necessarily. The fact that MS Word uses the .doc extension doesn t mean all .doc files have to be binary.
      Message 2 of 4 , Jan 7, 2003
      • 0 Attachment
        From: "Octavian Rasnita" <orasnita@...>
        > Hmm, are you running it under Windows?
        > Is your Perl interpreter in the path /usr/bin/perl ?
        >
        > The .doc files are binary files, not text only, so you need to use
        > another method for reading them.

        Not necessarily. The fact that MS Word uses the .doc extension
        doesn't mean all .doc files have to be binary.
        They may very well be plain text. I've seen quite a lot of these.

        Or RTF. Actually one version of Word saved files in RTF even if you
        selected that you want them saved in the binary Word format. Don't
        remember the details though.

        Anyway Wayne should probably look into the file to make sure it IS
        plain text.

        Jenda
        ===== Jenda@... === http://Jenda.Krynicky.cz =====
        When it comes to wine, women and song, wizards are allowed
        to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery
      Your message has been successfully submitted and would be delivered to recipients shortly.