SkydiveUK24 Posted June 27, 2008 Share Posted June 27, 2008 Hello, Up until a few weeks ago my site was running great with this script, then it decided to stop working. It is a perl script which grabs data from my suppliers XML feed and imports it into my database. It used to import 2,000 products, update their stock level, add the category, image, price etc etc. I can't see a reason why it has stopped working, could it be because of possible Perl updates on the server? I setup a cronjob to run the script, which starts fine but when checking the log file it throws the following error: Done fetching feeds Not an ARRAY reference at line 100 Append Descriptions Starting foreach now Line 100 and just after is this below: elsif ( ref($PuckerLabRef) ) { foreach ( @$PuckerLabRef ) { if ( $_ ne '' ) { $_ =~ s/\s+$//; $$args{options_labels} .= "$_~"; } } } &log($code, "(options: $$args{options_labels})") if $$args{options_labels} ne ''; Any idea what could be wrong? I contact the helpdesk here, but were unable to help and referred me to this forum. Any help would be greatly appreciated. Regards, Dale Quote Link to comment Share on other sites More sharing options...
MikeJ Posted June 27, 2008 Share Posted June 27, 2008 Without seeing how $PuckerLabRef gets populated, I'd suspect a change in the XML files, so it's not getting populated with multiple items anymore. Also, I'm a little rusty on some of my perl, but I think if you want to check that the variable is actually an array, you need to use >ref($PuckerLabRef) eq "ARRAY" and not simply just the ref() function. Quote Link to comment Share on other sites More sharing options...
SkydiveUK24 Posted June 28, 2008 Author Share Posted June 28, 2008 Thank-you Mike, I added that to the line and it has imported everything. I am a very happy man indeed! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.