Getting the data in the buffer

Discussion in 'Perl Misc' started by beartiger@gmail.com, Oct 8, 2005.

  1. Guest

    Suppose I've just selected and copied (<Ctrl>-c) some string.

    Say I'd like to run a Perl script that acts on this data in the buffer.
    How would I load that data into a variable?


    Many thanks in advance,
    John
     
    , Oct 8, 2005
    #1
    1. Advertising

  2. <> wrote in message
    news:...
    > Suppose I've just selected and copied (<Ctrl>-c) some string.
    >
    > Say I'd like to run a Perl script that acts on this data in the buffer.
    > How would I load that data into a variable?
    >
    >
    > Many thanks in advance,
    > John
    >


    John,

    Assuming that you are running Perl on Windows, try this URL:

    http://www.xav.com/perl/site/lib/Win32/Clipboard.html

    Yours truly,

    Kevin Sproule
     
    Kevin Sproule, Oct 8, 2005
    #2
    1. Advertising

  3. Matt Garrish Guest

    <> wrote in message
    news:...
    > Suppose I've just selected and copied (<Ctrl>-c) some string.
    >
    > Say I'd like to run a Perl script that acts on this data in the buffer.
    > How would I load that data into a variable?
    >


    Take a look at the Clipboard module:

    http://search.cpan.org/~king/Clipboard-0.08/lib/Clipboard.pm

    Matt
     
    Matt Garrish, Oct 8, 2005
    #3
  4. Guest

    Matt Garrish wrote:
    > <> wrote in message
    > news:...
    > > Suppose I've just selected and copied (<Ctrl>-c) some string.
    > >
    > > Say I'd like to run a Perl script that acts on this data in the buffer.
    > > How would I load that data into a variable?
    > >

    >
    > Take a look at the Clipboard module:
    >
    > http://search.cpan.org/~king/Clipboard-0.08/lib/Clipboard.pm
    >
    > Matt


    Thanks, Matt and Kevin.


    J
     
    , Oct 8, 2005
    #4
  5. Guest

    wrote:
    > Suppose I've just selected and copied (<Ctrl>-c) some string.
    >
    > Say I'd like to run a Perl script that acts on this data in the buffer.
    > How would I load that data into a variable?


    Assuming STDIN isn't used for anything else, you could to this:

    my $variable = <STDIN>;

    And then when the program is run and starts waiting for input, hit ctrl-v
    (or whatever it is you do to paste.)

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
     
    , Oct 8, 2005
    #5
  6. Guest

    wrote:
    > wrote:
    > > Suppose I've just selected and copied (<Ctrl>-c) some string.
    > >
    > > Say I'd like to run a Perl script that acts on this data in the buffer.
    > > How would I load that data into a variable?

    >
    > Assuming STDIN isn't used for anything else, you could to this:
    >
    > my $variable = <STDIN>;
    >
    > And then when the program is run and starts waiting for input, hit ctrl-v
    > (or whatever it is you do to paste.)


    True, but it would execute prematurely if the copied stuff had a
    carriage return in it, no?


    J
     
    , Oct 9, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raja
    Replies:
    12
    Views:
    24,711
    John Harrison
    Jun 21, 2004
  2. Replies:
    2
    Views:
    634
    sergejusz
    Mar 26, 2007
  3. Neal Becker

    buffer creates only read-only buffer?

    Neal Becker, Jan 8, 2009, in forum: Python
    Replies:
    0
    Views:
    429
    Neal Becker
    Jan 8, 2009
  4. Replies:
    20
    Views:
    802
    RedGrittyBrick
    Jul 23, 2009
  5. xingye
    Replies:
    9
    Views:
    299
    Michael Lu
    Apr 19, 2004
Loading...

Share This Page