10 $PROGRAM_DIR =~ s/[^\/\\]+$//;
11 $PROGRAM_DIR = "./" unless($PROGRAM_DIR);
13 map "$PROGRAM_DIR$_",qw{modules lib
../modules
..lib
};
17 my @OPTIONS = qw
/help|h|? version|ver edit-me manual|man size|s=i/;
22 require MyPlace
::Usage
;
23 Getopt
::Long
::GetOptions
(\
%OPTS,@OPTIONS);
24 MyPlace
::Usage
::Process
(\
%OPTS,$VERSION);
28 require MyPlace
::Usage
;
29 MyPlace
::Usage
::PrintHelp
();
32 my $max_size = $OPTS{size
} ?
$OPTS{size
} * 1000 : 256000;
33 my @target_files = @ARGV;
35 die("No target files.\n") unless(@target_files);
38 foreach my $filename(@target_files)
42 print STDERR
"File not accesable : \"$filename\"\n";
45 my $stat = stat($filename);
46 if($stat->size <= $max_size) {
47 print STDERR
"File size does not exceed $max_size.\n \"$filename\" [Ignored]\n";
50 print STDERR
"Spliting $filename...";
51 print STDERR
"\n",&split_file
($max_size,$filename);
55 my($max_size,$filename) = @_;
56 $filename =~ m/^(.+)\.([^\.]+)$/;
57 my $basename = $1 or $filename;
58 my $ext = $2 ?
".$2" : "";
63 open FI
,"<",$filename or return("$!\n");
67 return "Nothing to do\n" unless($data);
69 if($data =~ m/^([.\n]+)<body>([.\n]+)<\/body
>([.\n]+)$/) {
73 die("Not implemented.");
76 return "Nothing to do\n";
88 epub_split_xhtml - PERL script
92 epub_split_xhtml [options] ...
100 Print version infomation.
102 =item B<-h>,B<--help>
104 Print a brief help message and exits.
106 =item B<--manual>,B<--man>
108 View application manual
112 Invoke 'editor' against the source
122 2010-06-06 xiaoranzzz <xiaoranzzz@myplace.hell>
128 xiaoranzzz <xiaoranzzz@myplace.hell>