$outfilename =~ s/\s/\_/g;
# open output file
-open ( TEX, ">$outfilename.tex" ) || die "cannot open output file";
+open ( TEX, '>', "$outfilename.tex" ) || die "cannot open output file";
# LaTeX-Header ausgeben
latex_header();
$chaptercount = 0;
@titlecount = (0);
- open ( CHORDPRO, "$dirname/$outfilename.tmp" ) || die "cannot open input file";
+ open ( CHORDPRO, '<', "$dirname/$outfilename.tmp" ) || die "cannot open input file";
# read the whole document for settings
while ( <CHORDPRO> ){
chop $geometry; #delete last comma
close ( CHORDPRO );
-
-
#open temporary file
- open ( CHORDPRO, "$dirname/$outfilename.tmp" ) || die "cannot open input file";
+ open ( CHORDPRO, '<', "$dirname/$outfilename.tmp" ) || die "cannot open input file";
#print preamble into LaTeX file
if ( $output eq "pdf" ) { print TEX "\\pdfoutput=1
#-------------------------------------------------------------------------------
sub includes{
- open ( TMP, ">$dirname/$outfilename.tmp" ) || die "cannot open temporary output file";
+ open ( TMP, '>', "$dirname/$outfilename.tmp" ) || die "cannot open temporary output file";
+
# open input file
- open ( CHORDPRO, "$filename" ) || die "cannot open input file";
+ open ( CHORDPRO, '<', "$filename" ) || die "cannot open input file";
+
while ( <CHORDPRO> ){
if ( /{include:/ ) { #read only lines with an include directive
s/({.*:)(.+)(})/\2/;
print TMP "#$_\n#\n";
- open ( INSERT, "$dirname/$_" ) || die "cannot open file to insert: $_";
+
+ open ( INSERT, '<', "$dirname/$_" ) || die "cannot open include file: $_";
+
while ( <INSERT> ){ #insert file to include
print TMP;
}