home *** CD-ROM | disk | FTP | other *** search
- #!/home2/rrzc1/fh/c9020/bin/perl -- #-*- perl -*-
-
- if($#ARGV==-1){
- print "Usage: $0 file\n";
- exit 1;
- }
-
- $file="$ARGV[0]";
-
- open(IN,"<$file") || die;
-
- while(<IN>){
- if(($out)=/@comment %\*\*start cutout (.+)\n/){
- print "Extracting '$out'... ";
- $in=<IN>;
- if(!open(OUT,">$out")){
- print "failed!\n";
- }else{
- while($in!~/@comment %\*\*end cutout/){
- print OUT $in if($in!~/^@/);
- $in=<IN>;
- }
- print "done.\n";
-
- close(OUT);
- }
- }
- }
-
- close(IN);
-
-