Changeset 229 for trunk/gsdl/perllib/plugins/ArcPlug.pm
- Timestamp:
- 1999-04-08T15:38:35+12:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/ArcPlug.pm
r87 r229 43 43 $archive_info->load_info ($archive_info_filename); 44 44 45 my $file_list = $archive_info->get_file_list();45 my $file_list [5~= $archive_info->get_file_list(); 46 46 47 47 # process each file … … 67 67 } 68 68 69 # sort files so they're built (and displayed) in alphabetical order70 sub alphabetically {71 open (A, &util::filename_cat($base_dir, $file, $a->[0])) ||72 die "couldn't open " . &util::filename_cat($base_dir, $file, $a->[0]) . "\n";73 open (B, &util::filename_cat($base_dir, $file, $b->[0])) ||74 die "couldn't open " . &util::filename_cat($base_dir, $file, $b->[0]) . "\n";75 my $atitle = "untitled";76 my $btitle = "untitled";77 my $line = "";78 my $text = "";79 while (defined ($line = <A>)) {80 $text .= $line;81 if ($text =~ /Title=\"([^\"]*)\"/) {$atitle = $1; last;}82 }83 $text = "";84 while (defined ($line = <B>)) {85 $text .= $line;86 if ($text =~ /Title=\"([^\"]*)\"/) {$btitle = $1; last;}87 }88 close A;89 close B;90 91 $atitle =~ tr/A-Z/a-z/;92 $atitle =~ s/[^a-z0-9 ]//g;93 $atitle =~ s/^\s+//;94 $atitle =~ s/^(the|a|an)\b//;95 $atitle =~ s/^\s+//;96 $atitle =~ s/^(.).*$/$1/;97 98 $btitle =~ tr/A-Z/a-z/;99 $btitle =~ s/[^a-z0-9 ]//g;100 $btitle =~ s/^\s+//;101 $btitle =~ s/^(the|a|an)\b//;102 $btitle =~ s/^\s+//;103 $btitle =~ s/^(.).*$/$1/;104 105 $atitle cmp $btitle;106 }107 108 69 1;
Note:
See TracChangeset
for help on using the changeset viewer.