Fixing WebCollage Screensaver Headers.pm “Use of uninitialized value $vals” error

WebCollage without an error

Tired of getting errors scrolling down the screen in the WebCollage Linux screensaver? So was I.

WebCollage (here’s the link to the .deb on Ubuntu), for a bit of background, is a nice Xorg screensaver for Linux that displays a random collage of images fetched from various search systems on the Internet and popped up in an array as a screensaver. It gives you a weird and occasionally surreal collage that I always find interesting.

Reading the error stating an unset variable “$vals” was to blame for the for thousandth time I decided to take action. The perl file Headers.pm, located somewhere on the file system, was calling an array that didn’t fetch anything leading to the following.

As it turns out, there is an unset variable “$vals” on line 264 and 268 of the Perl file Headers.pm (/usr/share/perl5/HTTP/Headers.pm on my Debian system). There are multiple ways to fix this error. I’m just going to check to see if it’s defined before referencing. Here’s my changes to line 264 on:

#if (index($vals, "\n") >= 0 ) {
if (defined $vals) {
$vals = _process_newline($vals, $endl);
}
if (defined $vals){
push @result, $field . ': ' . $vals;
}
VN:F [1.9.22_1171]
Rating: 8.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Fixing WebCollage Screensaver Headers.pm "Use of uninitialized value $vals" error, 8.0 out of 10 based on 1 rating

2 Comments

  1. This was helpful, but there is one thing you should add.

    I had to add another close bracket to get it to work. The first line gets commented out but it’s part of another code block. Unless there is a close bracket I kept getting errors that I needed one. Otherwise, thanks for the tip!

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    Reply
    • Ah, it may have changed since I fixed it the previous time. If there’s a way to submit the fix we should probably post it up, now that I think of it. Or possibly bump it to the Debian/whoever team if it’s no longer maintained.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

Time limit is exhausted. Please reload CAPTCHA.

Lost Password