X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fwebchord.cgi;h=c9bb1e37aa350620e10bbeab3017a7b1d18fe929;hb=b672e9dd8ce43fb4c96b42fe448f10e88a9b72fa;hp=15a318667775e8459d0da66c6b1f2394e481b6c1;hpb=6ccc008640029eca058691a3ee1a1dcce508e291;p=songbook.git
diff --git a/web/webchord.cgi b/web/webchord.cgi
index 15a3186..c9bb1e3 100755
--- a/web/webchord.cgi
+++ b/web/webchord.cgi
@@ -12,7 +12,6 @@
# 2003-08-03 Version 1.1 Uses stylesheets
# 2014-02-05 Added things particular to my implementation of Songbook at
# http://defaria.com/songbook
-
use strict;
use warnings;
@@ -41,31 +40,31 @@ unless (-f $infile) {
sub debug ($) {
my ($msg) = @_;
-
+
return unless $debug;
-
+
print "Debug: $msg
";
-
+
return;
} # debug
-sub warning ($) {
+sub warning ($) {
my ($msg) = @_;
debug "warning";
print "Warning $msg
";
- return;
+ return;
} # warning
sub error {
my ($msg) = @_;
-
+
print "
\n$msg\n
" . ""; - + exit; } # error @@ -73,17 +72,17 @@ sub musicFileExists ($) { my ($song) = @_; debug "ENTER musicFileExists ($song)"; - + my $title = fileparse ($song, qr/\.pro/); my $musicfile = "/opt/media/$title.mp3"; if (-r $musicfile) { debug "Exists!"; - + return $title; } else { debug "Could not find $musicfile"; - + return undef; } # if } # musicFileExists @@ -92,10 +91,10 @@ sub updateMusicpath ($$) { my ($chopro, $song) = @_; my $title = musicFileExists $song; - + # If there's no corresponding music file then do nothing return unless $title; - + # If the .pro file already has musicpath then do nothing if ($chopro =~ /\{musicpath:.*\}/) { debug "$song already has musicpath"; @@ -105,26 +104,26 @@ sub updateMusicpath ($$) { # Otherwise append the musicpath my $songfile; - + open $songfile, '>>', $song or undef $songfile; - + unless (defined $songfile) { my $msg = "Unable to open $song for append - $!