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

^!RunPerl scipt behaviour

Expand Messages
  • Tim P
    When I print $_; in a Perl clip, the Document s text is removed. How do you process an opened (perhaps unsaved) document in a Perl clip? I know the work
    Message 1 of 4 , Feb 15, 2011
    • 0 Attachment
      When I "print $_;" in a Perl clip, the Document's text is removed.

      How do you process an opened (perhaps unsaved) document in a Perl clip?

      I know the work around is to save the file, then ^!Shell the perl.exe to work on the ^** . BUT I want to use ^!RunPerl .

      I think I just need a clue. Badly.

      TIA
    • Alec Burgess
      ... Its actually pretty easy :-) In Library [SampleCode] find the scripts: Perl script and _Perl NumLines as delivered with normal install [Perl Script]
      Message 2 of 4 , Feb 15, 2011
      • 0 Attachment
        On 2011-02-15 22:38, Tim P wrote:
        > When I "print $_;" in a Perl clip, the Document's text is removed.
        >
        > How do you process an opened (perhaps unsaved) document in a Perl clip?
        >
        > I know the work around is to save the file, then ^!Shell the perl.exe
        > to work on the ^** . BUT I want to use ^!RunPerl .
        >
        > I think I just need a clue. Badly.
        Its actually pretty easy :-)

        In Library [SampleCode] find the scripts:
        Perl script and _Perl NumLines
        as delivered with normal install [Perl Script] (containing normal clip
        code) is set up to invoke [_Perl NumLines] (containing the actual Perl
        script) which is run against the currently focused document.

        Modify the two as desired for your use case. You could also put a wizard
        (or other selection code) to determine which of several perl scripts
        will be run.

        --
        Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)
      • Sheri
        ... Been a really long time since I used perl in notetab. But try selecting the text before running the clip.
        Message 3 of 4 , Feb 15, 2011
        • 0 Attachment
          On 2/15/2011 10:38 PM, Tim P wrote:
          > When I "print $_;" in a Perl clip, the Document's text is removed.
          >
          > How do you process an opened (perhaps unsaved) document in a Perl clip?
          >
          > I know the work around is to save the file, then ^!Shell the perl.exe to work on the ^** . BUT I want to use ^!RunPerl .
          >
          > I think I just need a clue. Badly.
          >
          > TIA

          Been a really long time since I used perl in notetab. But try selecting
          the text before running the clip.
        • Sheri
          ... If the document is empty before running the clip, type a space and select it and then run the clip. Regards, Sheri
          Message 4 of 4 , Feb 15, 2011
          • 0 Attachment
            On 2/15/2011 11:43 PM, Sheri wrote:
            > On 2/15/2011 10:38 PM, Tim P wrote:
            >> When I "print $_;" in a Perl clip, the Document's text is removed.
            >>
            >> How do you process an opened (perhaps unsaved) document in a Perl clip?
            >>
            >> I know the work around is to save the file, then ^!Shell the perl.exe to work on the ^** . BUT I want to use ^!RunPerl .
            >>
            >> I think I just need a clue. Badly.
            >>
            >> TIA
            > Been a really long time since I used perl in notetab. But try selecting
            > the text before running the clip.

            If the document is empty before running the clip, type a space and
            select it and then run the clip.

            Regards,
            Sheri
          Your message has been successfully submitted and would be delivered to recipients shortly.