Re: [Clip] Basic tips on using Perl progs?
- Ian Rastall wrote:[ . . ]
>For instance, if I were trying to simply rewrite a clip I've alreadyIt's not a challenge. In fact, it's rather easy. The
>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.
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
>The clip commands to run Perl programs are interacting with theNotetab 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.
those archives have plenty. Also, Perl is appropriate topic there, more
so than here at ntb-clips.
- Hi all. I'm not sure if you saw the cross-posted email from before,
but I'm practising my perl skills with clips, and would like a few
pointers just to get started. (Of course, further confusion will
probably follow.) :-)
This is a simple clip I had in my clip library:
To try to duplicate it in perl, I've written, as a .pl file:
$_ = <STDIN>;
$_ = "<p>".$_."</p>";
and call it with the following clip:
Now, I'm sure the perl script represents a fundamental
misunderstanding both of how perl works, and how NoteTab sends
information to the interpreter. But if anyone could steer me in the
right direction, I would sure appreciate it!
Was it not a comedy, a strange and stupid
matter, this repetition, this running around
in a fateful circle? (Hermann Hesse)