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

Basic tips on using Perl progs?

Expand Messages
  • Ian Rastall
    Needing a way to practice, I thought I d use NoteTab Pro to brush up on my Perl skills (which are fairly light anyway). Does anyone here use Perl in thier
    Message 1 of 2 , Jul 5, 2005
    • 0 Attachment
      Needing a way to practice, I thought I'd use NoteTab Pro to brush up
      on my Perl skills (which are fairly light anyway). Does anyone here
      use Perl in thier clips, and if so, are there some basic things to
      keep in mind, or basic concepts behind it?

      For instance, if I were trying to simply rewrite a clip I've already
      got, like:

      ^!InsertHtml <p>^$GetSelection$</p>

      even that is a challenge to re-do in Perl, as I'm a newbie. How to do
      ^$GetSelection$, for instance ... I imagine you have to get the
      highlighted selection into $_ somehow, or some variable, and write it
      back with appended text.

      The clip commands to run Perl programs are interacting with the
      console? Questions like this. Any pointers would be well appreciated.
      I just signed back up, but I'm not new to the group. I pop in from
      time to time, and think you have a nice list here.

      TIA,

      Ian
      --
      Was it not a comedy, a strange and stupid
      matter, this repetition, this running around
      in a fateful circle? (Hermann Hesse)
      http://www.bookstacks.org/
    • Alan C
      Ian Rastall wrote:[ . . ] ... It s not a challenge. In fact, it s rather easy. The ^!RunPerl command operates on the currently focused doc. And, if there s
      Message 2 of 2 , Jul 6, 2005
      • 0 Attachment
        Ian Rastall wrote:[ . . ]

        >For instance, if I were trying to simply rewrite a clip I've already
        >got, like:
        >
        >^!InsertHtml <p>^$GetSelection$</p>
        >
        >even that is a challenge to re-do in Perl, as I'm a newbie. How to do
        >^$GetSelection$, for instance ... I imagine you have to get the
        >highlighted selection into $_ somehow, or some variable, and write it
        >back with appended text.
        >
        >
        It's not a challenge. In fact, it's rather easy. The

        ^!RunPerl

        command operates on the currently focused doc. And, if there's no
        selection then it acts like as if the entire doc is selected (processes
        whole doc). And, If there is a selection then it operates only on the
        selection. Easy.

        >The clip commands to run Perl programs are interacting with the
        >console?
        >
        Notetab acts as the command director (top administrator) so to speak.
        Merely what happens is Notetab passes the commands to the command line.
        At that point your sys has the commands which then hand off to Perl.
        Perl works (insert image of mule (or tractor etc.) hauling cargo),
        processes ON THE current Notetab doc. Such doc in Notetab is merely a
        buffer (memory buffer on a file that may or may not yet exist on disk)

        > Questions like this. Any pointers would be well appreciated.
        >
        >
        samplecode clip library it's Perl NumLines clip as an example.

        ntb-scripts@yahoogroups.com

        those archives have plenty. Also, Perl is appropriate topic there, more
        so than here at ntb-clips.

        Alan.
      Your message has been successfully submitted and would be delivered to recipients shortly.