Win32::Clipboard

The Win32::Clipboard module allows you to manipulate the Windows clipboard. You can use the clipboard as an object with the following syntax:

$clip = Win32::Clipboard(  );

This functions as an implicit constructor. If you include a text string as an argument, that text will be placed on the clipboard. You can use the package-qualified method names instead of the object syntax, since the clipboard is a single entity:

$text = Win32::Clipboard::Get(  );
Win32::Clipboard::Set("blah blah blah");
Win32::Clipboard::Empty(  );

Alternatively, you can use the clipboard as an object with this syntax:

$Clip = Win32::Clipboard(  );
$text = $Clip->Get(  );
$Clip->Set("blah blah blah");
$Clip->Empty(  );

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.