/ Published in: Perl
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
@rem = '--*-Perl-*-- @perl -x -S %0 %* && exit /b && ' #!/usr/bin/perl -w #line 3 =head1 NAME clip.cmd - put/get Windows system clipboard. =head1 USAGE clip < text.txt type text.txt | clip put text to windows clipboard clip > file.bmp save bitmap from clipboard to file =head1 DEPENDENCIES Perl module Win32::Clipboard required. The script must be wrapped as windows cmd to proper handle input/output redirection. =head1 AUTHOR dMitry <[email protected]> =cut use Win32::Clipboard; my $clip=Win32::Clipboard(); if (-t STDIN ) { # Nothing on input, so print clipboard } else { # STDIN redirected, so put it in clipboard $clip->Set(<STDIN>); } __END__ :endofperl