home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / zkuste / Perl / ActivePerl-5.6.0.613.msi / 䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥 / _90743809a5104b24f73470d39e3327a3 < prev    next >
Encoding:
Text File  |  2000-03-15  |  431 b   |  16 lines

  1. #!/usr/bin/perl
  2. while (<>) {
  3.     next unless ($mode,$file) = /^begin\s*(\d*)\s*(\S*)/;
  4.     open(OUT,"> $file") || die "Can't create $file: $!\n";
  5.     while (<>) {
  6.         last if /^end/;
  7.         next if /[a-z]/;
  8.         next unless int((((ord() - 32) & 077) + 2) / 3) ==
  9.             int(length() / 4);
  10.         print OUT unpack("u", $_);
  11.     }
  12.     chmod oct($mode), $file;
  13.     eof() && die "Missing end: $file may be truncated.\n";
  14. }
  15.  
  16.