Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Bug: Links::SiteHTML::display (...

Quote Reply
Bug: Links::SiteHTML::display (...
I just found something very strange. When I use the following code, it will only show a blank page.
Code:
require Links::SiteHTML;
print $IN->header();
print Links::SiteHTML::display ('error', { error => Links::language ('JUMP_INVALIDID', $id) });
return;


After trial and error, I found out if I use
Code:
Links::SiteHTML::display(....


it will be fine and print the template 'error.html'.

Why 'display(' and 'display (' make the difference?

Maybe this is a bug.

Quote Reply
Re: [Fortune] Bug: Links::SiteHTML::display (... In reply to
Both work exactly the same for me. Maybe it is some other part of your code.
Quote Reply
Re: [Paul] Bug: Links::SiteHTML::display (... In reply to
Hi Paul,

I am sure this is a bug.

I did a fresh install and upload this file as test_bug.cgi:

Code:


#!/usr/local/bin/perl
#
use strict;
use lib 'admin';
use Links qw/$DB $IN/;
# use Links::SiteHTML;
local $SIG{__DIE__} = \&Links::fatal;
Links::init('admin');

&main;

sub main {
#
require Links::SiteHTML;
print $IN->header();
print Links::SiteHTML::display('error', { error => "Everything is fine without a space between display and \(<BR>.\n" } ); # 1
print Links::SiteHTML::display ('error', { error => "Display nothing when there is a space between display and \(<BR>.\n" } ); # 2
print Links::SiteHTML::display('error', { error => "There is a bug in perl 5.005_03 or in LinksSQL 2.1.2<BR>.\n" } ); # 3
}


It only display # 1 and # 3. Would you please spend 1 minute to test it?
Quote Reply
Re: [Fortune] Bug: Links::SiteHTML::display (... In reply to
The way the parenthesis around subroutine aruments are handled is by perl itself so it wouldn't be a Links SLQ bug in any case.

However, I can confirm that using a space or no space works exactly the same for me. Your test script prints all 3 pages.

I think the most likely explanation is that it is your version of perl.
Quote Reply
Re: [Fortune] Bug: Links::SiteHTML::display (... In reply to
Hi Paul, thanks!

Maybe it's a bug in perl 5.005_03.

'use Links::SiteHTML' works fine with or without a space.

'require Links::SiteHTML' only works without a space.