Click here to get back home

[RFC] IO::Clipboard

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
[RFC] IO::Clipboard harryfmudd [AT] comcast [DOT] 02-10-2006
Posted by harryfmudd [AT] comcast [DOT] on February 10, 2006, 12:28 am
Please log in for more thread options


All,

It occurred to me that given Ryan King's Clipboard module, an
IO::Clipboard module wouldn't be too hard.

First cut: it's a subclass of IO::String. For input, just load the
string from the clipboard. For ouput, stash a string reference in one of
the unused slots of the glob IO::String returns; the DESTROY method
flushes the output to the clipboard.

Second cut: we only use IO::String for $] < 5.008. For 5.8, we generate
the glob reference directly. For input, we grab the contents of the
clipboard and use the 3-argument "open" syntax to open a reference to
the retrieved text. For output, we generate a reference to an empty
string, open that, and the rest of the logic is as for the IO::String
implementation.

Third cut: For history's sake, if it's MSWin32 we fall back to
Win32::Clipboard if Clipboard isn't available. Or maybe we implement
directly to Win32::Clipboard (since it looks like Clipboard just wraps
Win32::Clipboard under MSWin32 anyway). I seem to remember having to
massage "\n"-delimited text into "\r\n" before putting it on the MSWin32
clipboard, but have no way to check it right now. Ryan King's module
doesn't do this, but I don't know whether that means my memory is wrong,
or whether nobody's using this module under MSWin32.

Comments?

Tom Wyant

Similar ThreadsPosted
Set/Get X clipboard w/o Tk? November 29, 2004, 8:43 am
Math Clipboard Guitest versions questions Feb 26, 2008 February 26, 2008, 12:37 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap