See it working (not) here: http://b-my.com/cgi-bin/login.cgi Why is that, when the file http://b-my.com/cgi-bin/templates/friendlyurls/global_header.txt is there, i mean it is not missing but i receive an error? The file access code is 755? Here is my code:Software error: Can't open [http://b-my.com/cgi-bin/templates/friendlyurls/global_head +er.txt]: No such file or directory at modules/template.pm line 59.
package template; use strict; use warnings; sub files { my $templatepath = shift; opendir (DIR, "$templatepath"); my @files = grep { /.txt/ } readdir(DIR); close (DIR); @files = sort @files; return @files; } sub themes { my $templatepath = shift; opendir (DIR, "$templatepath"); my @files = grep { /./ } readdir(DIR); close (DIR); @files = sort @files; return @files; } sub save { my $name = shift; my $data = shift; my $templatepath = shift; open (DATABASE,">$templatepath/$name"); flock (DATABASE,2); print DATABASE "$data"; flock (DATABASE,8); close (DATABASE); } sub load2 { my $name = shift; my @bannerfile = shift; my @bannerfilebot = shift; my $templatepath = shift; open(DAT, "$name") or die "Can't open [templates/${name}]: $!"; flock (DAT, 2); my @data = <DAT>; flock (DAT, 8); close(DAT); return @data; } sub load { my $name = shift; my $templatepath = shift; open(DAT, "$name".'.txt') or die "Can't open [${name}.txt]: $!"; flock (DAT, 2); my @data = <DAT>; flock (DAT, 8); close(DAT); return @data; } sub loadsub { my $name = shift; my $templatepath = shift; open(DAT, 'accounts/$userid/templates/'. $name .'.txt') or die "Ca +n't open [templates/${name}.txt]: $!"; flock (DAT, 2); my @data = <DAT>; flock (DAT, 8); close(DAT); return @data; } sub print { my $name = shift; my @data = template::load($name); my @bannerfile = shift; my @bannerfilebot = shift; my $templatepath = shift; my $SITETEMPLATEgh = join ('', @data); print $SITETEMPLATEgh; } 1; # return true
In reply to File missing error...why? by sitecontact
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |