8 my $dir = dirname
(abs_path
($0));
13 open my $input, "<", $file or die "Couldn't open '$file':$!";
22 if( /^\s*$/s ) { $_ = qq{"\\n"\n}; next; }
23 if( /^\s*#/ ) { $_ = qq{"\\n"\n}; next; }
24 s/\\/\\\\/g; # double the number of \'s
34 $dir . "/xchat.pm.h", # output file
35 $dir . "/lib/Xchat.pm", # input files
36 $dir . "/lib/Xchat/Embed.pm",
37 $dir . "/lib/Xchat/List/Network.pm",
38 $dir . "/lib/Xchat/List/Network/Entry.pm",
39 $dir . "/lib/Xchat/List/Network/AutoJoin.pm",
42 $dir . "/irc.pm.h", # output file
43 $dir . "/lib/IRC.pm" # input file
46 my ($output,@inputs) = @
$files;
48 open my $header, ">", $output or die "Couldn't open '$output': $!";
50 print $header qq["BEGIN {\\n"\n];
51 for my $input ( @inputs ) {
52 (my $trimmed = $input) =~ s{^lib/}{};
53 print $header qq["\$INC{'$trimmed'} = 'Compiled into the plugin.';\\n"\n];
55 print $header qq["}\\n"\n];
57 for my $input ( @inputs ) {
58 print $header qq["{\\n"\n];
59 print $header qq{"#line 1 \\"$input\\"\\n"\n};
60 print $header header
( $input );
61 print $header qq["}\\n"\n];