Man...whats wrong with this code? At first I thought it was the value not being passed into $html, but the debugging 'print' statements seem to show other wise. Code is;
'cat_advert_admin.html',
'cat_admin_front.html');
my $html;
foreach $html (@files) {
print "File: $html <BR>";
# if templates already exist...dont get rid of em!
if (-e "$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/$html") { next; }
$file = $tar->get_file ($html);
$file->name("$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/$html") or return Plugins::Category_Adverts->error("Error: $GT::Tar::error");
$file->write or return Plugins::Category_Adverts->error("Unable to extract file: '$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/$html' ($GT::Tar::error)", 'WARN');
}
The error when installing is;
Error running installation code: Can't call method "name" on an undefined value at (eval 4) line 194.
Am I going mad? What am I doing wrong?
*is glad he has short hair, so he can't pull it out easily*
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Code:
my @files = ('cat_advert.html', 'cat_advert_admin.html',
'cat_admin_front.html');
my $html;
foreach $html (@files) {
print "File: $html <BR>";
# if templates already exist...dont get rid of em!
if (-e "$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/$html") { next; }
$file = $tar->get_file ($html);
$file->name("$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/$html") or return Plugins::Category_Adverts->error("Error: $GT::Tar::error");
$file->write or return Plugins::Category_Adverts->error("Unable to extract file: '$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/$html' ($GT::Tar::error)", 'WARN');
}
The error when installing is;
Error running installation code: Can't call method "name" on an undefined value at (eval 4) line 194.
Am I going mad? What am I doing wrong?

*is glad he has short hair, so he can't pull it out easily*
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!