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

200Re: [NTS] Perl 5.8 vs. Notetab

Expand Messages
  • Sheri
    Apr 3, 2003
      At 11:38 PM 4/2/03 -0500, Alec wrote:
      >Not recently. I've got Perl 5.8.1 (I needed it for latest version of
      >PopFile.)

      Hi Alec,

      5.8.1? Maybe you're mistaken, what does

      perl -v

      report?

      I got the latest one on the ActiveState as of yesterday, and mine says:

      This is perl, v5.8.0 built for MSWin32-x86-multi-thread
      (with 1 registered patch, see perl -V for more detail)

      Copyright 1987-2002, Larry Wall

      Binary build 805 provided by ActiveState Corp. http://www.ActiveState.com
      Built 18:08:02 Feb 4 2003


      >I just ran the line-number demo (in Sample clips) and got a block character
      >added at the end of the last line:
      >
      >>>00001 one
      >00002 two
      >00003 three
      >00004 four
      >00005 five
      >00006 six<<
      >
      >Is that what you're talking about?

      Yes that's it. If you select the character and run this clip command on it, it reports it is a decimal character 26.

      ^!Info ^$ChartoDec(^$GetSelection$)$

      I did some research and found out this is the same character MS-DOS uses as an end-of-file mark (Ctrl-Z).

      It doesn't necessarily come back as the last character printed to Notetab, e.g., a reverse sort in Perl will put it at the top. So its a character that really needs to be removed from Perl's standard input buffer. I don't know how to do that.

      Also Notetab Replace clip commands won't remove it from the output (although the Replace dialog will).

      The best I've come up with so far is to add this inside to the "while (<>)" loop of each of my Perl scripts that are fed by ^!RunPerl or ^!RunScript:

      if ($] > 5.006) {
      $badchar = chr(26);
      s/($badchar)$//;
      }

      But that way it runs on each input unit (e.g., line or paragraph) instead of just the last one (which would be more appropriate). I guess it doesn't matter, but I would like to know how to apply it to the last unit only.

      Or if there is some better way to approach it that wouldn't require changing each script or clip.

      Any ideas?

      Regards,
      Sheri
    • Show all 4 messages in this topic