Jump to content

Perl Script Issue


Recommended Posts



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.





Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...