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

Perl: in-line clip? (was Re: Three monitors (was Re: [NH] multiple heads and NoteTab))

Expand Messages
  • Alec Burgess
    Ron, (all) ... will remove, modify and replace _one_ line? I do a lot of little editing bits at a time and it is handy to have a keyboard macro/script that
    Message 1 of 2 , Nov 9, 2001
    • 0 Attachment
      Ron, (all)
      >> Next, is it possible to put together a quick perl script that
      will
      remove, modify and replace _one_ line? I do a lot of little editing bits at
      a time and it is handy to have a keyboard macro/script that will do this.
      Since I'm learning perl and working with it periodically, it would be handy
      to have this capability.<<

      Related to Ron's question (maybe this should be on ntb-clips?)
      Is there some way to create an in-line Perl-clip where all the code required
      (whether clip-code or Perl-code) is contained in just ONE clip. Every
      example I've seen (specifically the ones in Sample Clips - Scripts) requires
      an exterior control module. As I learn a little more Perl (and/or Gawk) it
      would be handy to have a single "shell" that I can call up to go into and
      "quickly" put in one-timers.

      If there is necessary control code at the top and the bottom, that would be
      preferable (at least for the way I tend to work) to having the controlling
      elements in an external clip so that I have to tweak in one and execute a
      different one to test.

      On rereading what Ron said, I'm not sure whether this is EXACTLY what he's
      after or not - I think it may be???

      Regards ... Alec
      ----- Original Message -----
      From: "Ron Woodall" <nor@...>
      To: <ntb-html@yahoogroups.com>
      Sent: 09 November, 2001 15:15
      Subject: Re: Three monitors (was Re: [NH] multiple heads and NoteTab)
    • Piotr Bienkowski
      On 9 Nov 2001 at 18:28, Alec Burgess wrote: Hi Alec, ... First you select one line in NoteTab, and then only the selected text goes to your Perl script s STDIN
      Message 2 of 2 , Nov 9, 2001
      • 0 Attachment
        On 9 Nov 2001 at 18:28, Alec Burgess wrote:

        Hi Alec,

        > Next, is it possible to put together a quick perl script that
        > will
        > remove, modify and replace _one_ line? I do a lot of little editing
        > bits at a time and it is handy to have a keyboard macro/script that
        > will do this. Since I'm learning perl and working with it
        > periodically, it would be handy to have this capability.<<

        First you select one line in NoteTab, and then only the selected text
        goes to your Perl script's STDIN or <>

        Usually the while loop goes through the document line by line (line
        being a string that ends with CRLF), unless you change the $/ variable,
        e.g.:

        while (<>) {
        # your code here
        }

        > Related to Ron's question (maybe this should be on ntb-clips?)
        > Is there some way to create an in-line Perl-clip where all the code
        > required (whether clip-code or Perl-code) is contained in just ONE
        > clip.

        If having Clip and Perl code in one 'clip' is what you're after, I don't
        think it's possible.

        Regards,

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