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

Interfacing w/ Perl; arguments

Expand Messages
  • thedarknesscalling
    Hey guys, i know there s probably -something- in the list of messages which i m currently digging through, but since i was having no success, i thought i d
    Message 1 of 3 , Sep 4, 2003
    • 0 Attachment
      Hey guys, i know there's probably -something- in the list of messages
      which i'm currently digging through, but since i was having no
      success, i thought i'd post an inquiry whether someone had a
      quicklink that would give me the solution to my problem:

      I'm new to notetab's scripting lang, and i'm trying to figure out how
      to pass stuff from notetab to a perl script that is fired up from a
      clip.

      my basic question is not so much syntactic (though a syntactic
      solution would suffice), but rather, how can i pass information from
      notetab to a perl script.

      In specific my script when run, prompts the user for a file name to
      read from. Thus my intention had been to try to get the file name
      from notepad and then toss it to the perl script, then refresh the
      document once it had been modified by the perl script.

      So, while syntactic help will of course be useful, i'm curious if i'm
      barking up the correct algorithm here for mucking with perl scripts
      in notetab.

      Any suggestions?
    • Alan C.
      On Thu, 04 Sep 2003 15:27:54 -0000, thedarknesscalling wrote: [ . . ] ... This is material for the ntb-scripts list on yahoo groups. NoteTab, Perl, and the
      Message 2 of 3 , Sep 4, 2003
      • 0 Attachment
        On Thu, 04 Sep 2003 15:27:54 -0000, thedarknesscalling wrote:
        [ . . ]
        > [ . . ] how can i pass information from
        > notetab to a perl script.

        This is material for the ntb-scripts list on yahoo groups.

        NoteTab, Perl, and the commandline integrate rather well.

        As easy as you can pass something from NoteTab to the commandline, you can pass something from NoteTab to Perl *via the commandline.

        @ARGV (a certain perl array) is perl's container, holds whatever had been passed to perl as arguement(s)

        perl myperlscript.pl file2beactedon

        notice above 3 paramters, each of the three separated by a space. That's a commandline. At runtime, the third or last parameter (your desired file to be processed by perl) will be in @ARGV and your desired file will get acted upon according to whatever your code is in your myperlscript.pl file (perl code in that script file tells the Perl interpreter what to do to your desired to be acted upon file).

        1 caveat: since space is the delimiter for @ARGV, no space allowed in a file path/name. A regex easy workaround can get around this though easily enough; I've done so myself. To do so, In ntb just replace file path/name space with tilde then very first thing in perl script do a perl regex upon @ARGV substitute tilde with space. It works.

        In addition to Notetab's several help files, look in samplecode and utilities each a native clip library. Also search this clips list the archives for: clipclass

        That's Jody Adair's clipclass

        There's several or more ntb to perl interface clips already made look on the notetab clip repository web pages. Might also be some more in the files area of the ntb-scripts group on yahoo groups.

        basics of perl somewhere (google search for perl basics?): commandline; pass arguements; @ARGV

        --
        Alan
      • thedarknesscalling
        Ah Hah, So Notetab interfaces with the commandline. I was unaware of this fact. That makes life much simpler. Thanks for the help. :) ... you can pass
        Message 3 of 3 , Oct 6, 2003
        • 0 Attachment
          Ah Hah,

          So Notetab interfaces with the commandline. I was unaware of this
          fact. That makes life much simpler.

          Thanks for the help. :)

          --- In ntb-clips@yahoogroups.com, "Alan C." <acumming@c...> wrote:
          > On Thu, 04 Sep 2003 15:27:54 -0000, thedarknesscalling wrote:
          > [ . . ]
          > > [ . . ] how can i pass information from
          > > notetab to a perl script.
          >
          > This is material for the ntb-scripts list on yahoo groups.
          >
          > NoteTab, Perl, and the commandline integrate rather well.
          >
          > As easy as you can pass something from NoteTab to the commandline,
          you can pass something from NoteTab to Perl *via the commandline.
          >
          > @ARGV (a certain perl array) is perl's container, holds whatever
          had been passed to perl as arguement(s)
          >
          > perl myperlscript.pl file2beactedon
          >
          > notice above 3 paramters, each of the three separated by a space.
          That's a commandline. At runtime, the third or last parameter (your
          desired file to be processed by perl) will be in @ARGV and your
          desired file will get acted upon according to whatever your code is
          in your myperlscript.pl file (perl code in that script file tells the
          Perl interpreter what to do to your desired to be acted upon file).
          >
          > 1 caveat: since space is the delimiter for @ARGV, no space allowed
          in a file path/name. A regex easy workaround can get around this
          though easily enough; I've done so myself. To do so, In ntb just
          replace file path/name space with tilde then very first thing in perl
          script do a perl regex upon @ARGV substitute tilde with space. It
          works.
          >
          > In addition to Notetab's several help files, look in samplecode and
          utilities each a native clip library. Also search this clips list
          the archives for: clipclass
          >
          > That's Jody Adair's clipclass
          >
          > There's several or more ntb to perl interface clips already made
          look on the notetab clip repository web pages. Might also be some
          more in the files area of the ntb-scripts group on yahoo groups.
          >
          > basics of perl somewhere (google search for perl basics?):
          commandline; pass arguements; @ARGV
          >
          > --
          > Alan
        Your message has been successfully submitted and would be delivered to recipients shortly.