home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / perl / 5.10.0 / auto / Storable / file_magic.al < prev    next >
Encoding:
Text File  |  2009-06-26  |  603 b   |  22 lines

  1. # NOTE: Derived from ../../lib/Storable.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package Storable;
  5.  
  6. #line 118 "../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/file_magic.al)"
  7. sub file_magic {
  8.     my $file = shift;
  9.     my $fh = new FileHandle;
  10.     open($fh, "<". $file) || die "Can't open '$file': $!";
  11.     binmode($fh);
  12.     defined(sysread($fh, my $buf, 32)) || die "Can't read from '$file': $!";
  13.     close($fh);
  14.  
  15.     $file = "./$file" unless $file;  # ensure TRUE value
  16.  
  17.     return read_magic($buf, $file);
  18. }
  19.  
  20. # end of Storable::file_magic
  21. 1;
  22.