Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: print to clipboard

by Chady (Priest)
on Aug 24, 2004 at 08:23 UTC ( #385352=note: print w/replies, xml ) Need Help??


in reply to print to clipboard

You can tie a filehandle:

#!perl -w use Win32::Clipboard; my $CLIP = Win32::Clipboard(); print "This gets printed to STDOUT\n"; tie *STDOUT, 'clippy', \$CLIP; print "This will end up into the clipboard."; untie *STDOUT; package clippy; use Tie::Handle; use vars qw(@ISA); @ISA = qw(Tie::Handle); sub TIEHANDLE { my $class = shift; my $clip = shift; return bless({clip => $clip}, $class); } sub PRINT { my $self = shift; ${$self->{clip}}->Set(@_); }

He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://385352]
help
Chatterbox?
[Corion]: Mhmm. I'm writing a database export, and two supposedly identical files compress to different sizes... So either the order of rows is different (which would be OK) or something else is bad (which wouldn't be OK). I guess I have to test with smaller tables

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2018-04-25 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?