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

Why won't this Perl script run in NTP?

Expand Messages
  • jelkscabaniss@yahoo.com
    I downloaded the Perl script at http://daringfireball.net/projects/markdown/ and ran it at the command line without problem. For example: perl Markdown.pl
    Message 1 of 7 , Mar 21, 2004
    • 0 Attachment
      I downloaded the Perl script at

      http://daringfireball.net/projects/markdown/

      and ran it at the command line without problem. For example:

      perl Markdown.pl --htmltags whatever.txt

      Works great -- it takes "whatever.txt" and converts it to XHTML,
      using the text-based pseudo markup as a guide. It dumps the output
      to stdout.

      So I tried a clip to run it on a document in NTP:

      ^!RunPerl "^$GetScriptPath$Markdown.pl" --htmltags

      but nothing happens.

      Any idea how to make Markdown.pl run on the open document from
      within Notetab?


      /Jelks
    • Sheri
      Hi Jelks, You can t pass parameters to Perl using ^!RunPerl. You have to use ^!RunScript. Try it this way (untested): ^!RunScript ^$GetPerlExe$ ^1 --htmltags
      Message 2 of 7 , Mar 21, 2004
      • 0 Attachment
        Hi Jelks,

        You can't pass parameters to Perl using ^!RunPerl. You have to use ^!RunScript. Try it this way (untested):

        ^!RunScript "^$GetPerlExe$ ^1 --htmltags" "^$GetScriptPath$Markdown.pl"

        Regards,
        Sheri
      • jelkscabaniss@yahoo.com
        ... htmltags ^$GetScriptPath$Markdown.pl Perfect! Thank you very much, Sheri! (I had assumed from the help description that ^!Runscript was for running
        Message 3 of 7 , Mar 21, 2004
        • 0 Attachment
          Sheri wrote:
          > You can't pass parameters to Perl using ^!RunPerl.
          > You have to use ^!RunScript. Try it this way (untested):
          >
          > ^!RunScript "^$GetPerlExe$ ^1 --
          htmltags" "^$GetScriptPath$Markdown.pl"

          Perfect! Thank you very much, Sheri!

          (I had assumed from the help description that ^!Runscript was for
          running Gawk programs!)


          /Jelks
        • jelkscabaniss@yahoo.com
          BTW, I noticed this script embeds a CTRL+Z (visible in NTP as a little right-pointing arrow) right before the final inserted . I don t know enough about
          Message 4 of 7 , Mar 22, 2004
          • 0 Attachment
            BTW, I noticed this script embeds a CTRL+Z (visible in NTP as a
            little right-pointing arrow) right before the final
            inserted "</p>". I don't know enough about Perl (or its interaction
            with NTP) to know what might cause it -- it doesn't happen when run
            from the command line. Has anyone seen this before with running
            Perl scripts on documents in NTP?

            Currently I'm just doing a

            ^!Replace "" >> "" WAST

            to get rid of it (don't know if the literal CTRL+Z will show up in
            the posted email or not), but it would be nice more about what's
            causing it.

            thanks,

            /Jelks
          • Sheri
            I believe you are describing the infamous Ansi 26 problem that arises when you use Perl 8 with Notetab. I guess it might depend on what font you re using, but
            Message 5 of 7 , Mar 22, 2004
            • 0 Attachment
              I believe you are describing the infamous Ansi 26 problem that
              arises when you use Perl 8 with Notetab. I guess it might depend on
              what font you're using, but to me they look like little box
              characters in Notetab. This is the workaround I use. I add the
              following processing into the while <> loop to scripts I use in
              Notetab:

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

              If you copy this from email, make sure no no-breaking spaces are
              masquerading as spaces in the above code. It's happened before.

              Regards,
              Sheri
            • jelkscabaniss@yahoo.com
              ... Ah, I had seen the fairly recent ANSI 26 Character thread in the archives and didn t make the connection. ANSI (or more lowest common denominator,
              Message 6 of 7 , Mar 23, 2004
              • 0 Attachment
                "Sheri" wrote:
                > I believe you are describing the infamous Ansi 26 problem that
                > arises when you use Perl 8 with Notetab.

                Ah, I had seen the fairly recent "ANSI 26 Character" thread in the
                archives and didn't make the connection. ANSI (or more lowest
                common denominator, ASCII) 26 is indeed CTRL+Z.

                > I guess it might depend on what font you're using, but to me
                > they look like little box characters in Notetab.

                I see other people are seeing a little box too. That's curious.
                I'm using Courier New, which shows it on my system as a little right-
                pointing arrow. (I didn't know at the time what that was, so I
                looked at the file in a hex editor.)

                > This is the workaround I use. I add the
                > following processing into the while <> loop to scripts I use in
                > Notetab:
                >
                > if (eof && $] > 5.006) {
                > $badchar = chr(26);
                > s/($badchar)$//;
                > }

                Ah, that's good to know, thank you.

                For this case, I think I'll just keep the ^!Replace following the
                script, since the script is updated fairly frequently and a simple ^!
                Replace will save me editing the script each time with that
                modification.

                /Jelks
              • Larry Thomas
                ... I looked it up in my references. ASCIIcat shows it as: Dec Hex Oct Binary Chr NAME 26 1A 32 00011010 ® SUB - Substitute; End of file And it appears as
                Message 7 of 7 , Mar 23, 2004
                • 0 Attachment
                  At 04:33 PM 3/23/04 -0000, you wrote:
                  >"Sheri" wrote:
                  >> I believe you are describing the infamous Ansi 26 problem that
                  >> arises when you use Perl 8 with Notetab.
                  >
                  >Ah, I had seen the fairly recent "ANSI 26 Character" thread in the
                  >archives and didn't make the connection. ANSI (or more lowest
                  >common denominator, ASCII) 26 is indeed CTRL+Z.
                  >
                  >> I guess it might depend on what font you're using, but to me
                  >> they look like little box characters in Notetab.
                  >
                  >I see other people are seeing a little box too. That's curious.
                  >I'm using Courier New, which shows it on my system as a little right-
                  >pointing arrow. (I didn't know at the time what that was, so I
                  >looked at the file in a hex editor.)

                  >/Jelks

                  I looked it up in my references. ASCIIcat shows it as:

                  Dec Hex Oct Binary Chr NAME

                  26 1A 32 00011010 ® SUB - Substitute; End of file

                  And it appears as a right arrow in ASCIIcat. You can get it to display as
                  a right arrow by selecting the original DOS TERMINAL font.

                  Regards,

                  Larry
                  lrt@... e¿ê
                Your message has been successfully submitted and would be delivered to recipients shortly.