in reply to Re: Trouble with path syntax
in thread Trouble with path syntax

You may be onto something here. A better shot of the code is:
sub LoadTemplate { my($file) = @_; my($thebase) = ($file =~ /(.*)\/[^\/]+/); my($html,$html2); if (!-e $file){ $thebase =~ s/\/[^\/]+$/\/default/; } if (-e "$thebase/templates.old"){ open(TEMPLATE, "$file")||&DieNice("Opening: $file -- $!"); my $html = join('',<TEMPLATE>); close(TEMPLATE); }else{ open(TEMPLATE, "$thebase/master.htm")||&DieNice("Opening $theb +ase/master.htm: $!"); $html = join('',<TEMPLATE>); close(TEMPLATE); open(TEMPLATE, "$file")||&DieNice("Opening: $file -- $!"); $html2 = join('',<TEMPLATE>); close(TEMPLATE); $html =~ s/!INSERT!/$html2/i; }
Still trying to figure out how to fix it.