home *** CD-ROM | disk | FTP | other *** search
/ isnet Internet / Isnet Internet CD.iso / prog / hiz / 09 / 09.exe / adynware.exe / perl / lib / site / Win32 / Clipboard.pm < prev    next >
Encoding:
Perl POD Document  |  1999-12-28  |  1.2 KB  |  63 lines

  1. package Win32::Clipboard;
  2.  
  3. require Exporter;       # to export the constants to the main:: space
  4. require DynaLoader;     # to dynuhlode the module.
  5.  
  6. @ISA = qw( Exporter DynaLoader );
  7.  
  8.  
  9. sub AUTOLOAD {
  10.     my($constname);
  11.     ($constname = $AUTOLOAD) =~ s/.*:://;
  12.     $!=0;
  13.     my $val = constant($constname, @_ ? $_[0] : 0);
  14.     if ($! != 0) {
  15.     
  16.  
  17.  
  18.  
  19.             ($pack, $file, $line) = caller;
  20.             undef $pack; # [dada] and get rid of "used only once" warning...
  21.             die "Win32::Clipboard::$constname is not defined, used at $file line $line.";
  22.  
  23.     }
  24.     eval "sub $AUTOLOAD { $val }";
  25.     goto &$AUTOLOAD;
  26. }
  27.  
  28.  
  29. $VERSION = "0.03";
  30.  
  31.  
  32. sub new {
  33.     my($class, $value) = @_;
  34.     my $self = "I'm the Clipboard!";
  35.     Win32::Clipboard::Set($value) if defined($value);
  36.     return bless(\$self);
  37. }
  38.  
  39. sub DESTROY {
  40.     my($self) = @_;
  41.     undef $self;
  42. }
  43.  
  44. sub Version {
  45.     return $VERSION;
  46. }
  47.  
  48.  
  49. bootstrap Win32::Clipboard;
  50.  
  51.  
  52. sub main::Win32::Clipboard {
  53.     my($value) = @_;
  54.     my $self={};
  55.     my $result = Win32::Clipboard::Set($value) if defined($value);
  56.     return bless($self, "Win32::Clipboard");
  57. }
  58.  
  59.  
  60. 1;
  61. __END__
  62.  
  63.