Getting the data in the buffer

B

beartiger

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
 
X

xhoster

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
 
B

beartiger

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top