Opened 9 years ago

Closed 9 years ago

#2789 closed enhancement (fixed)

Tirex : Perl version on Ubuntu 8.04 (LTS) does not support operator "//"

Reported by: tourcyc Owned by: Tom Hughes
Priority: trivial Milestone:
Component: utils Version:
Keywords: tirex Cc: Jochen Topf

Description

Hi,

Tirex runs like a charm on my V-Server on Ubuntu 8.04. But the libjson-perl package comming along with Hardy was not usable since JSON::true and JSON::false were used but did not yet exist. The libjson-perl source of the Intrepid (8.10) did built well on Ubuntu Hardy such that this restriction could be solved.

For the olderly perl version "" needed to be replaced. I don't know whether this should go into the subversion, I don't have write permission anyway, so here's the diff (including a typo fix):

> svn diff
Index: lib/Tirex/PrioQueue.pm
===================================================================
--- lib/Tirex/PrioQueue.pm      (revision 20439)
+++ lib/Tirex/PrioQueue.pm      (working copy)
@@ -274,7 +274,7 @@
 
 Return status of the priority queue.
 
-=cut1
+=cut
 
 sub status
 {
Index: lib/Tirex/Zoomrange.pm
===================================================================
--- lib/Tirex/Zoomrange.pm      (revision 20439)
+++ lib/Tirex/Zoomrange.pm      (working copy)
@@ -41,8 +41,8 @@
     my $self = bless {} => $class;
 
     $self->{'min'}  = $min;
-    $self->{'max'}  = $max // $min;
-    $self->{'name'} = $name // ('z' . $self->to_s());
+    $self->{'max'}  = $max ? $max : $min;
+    $self->{'name'} = $name ? $name :  ('z' . $self->to_s());
 
     return $self;
 }

Regards, Andreas Huck

Change History (3)

comment:1 Changed 9 years ago by Tom Hughes

Resolution: invalid
Status: newclosed

I don't believe tirex bugs are being handled in trac - I suggest you contact the authors directly.

comment:2 Changed 9 years ago by tourcyc

Cc: Jochen Topf added
Resolution: invalid
Status: closedreopened

Tirex is part of the applications, so I cannot see a reason why we should not use track. Tochen Topf is one of the authors and using this Trac, but Trac does not allow me to reasign the ticket (since it's not mine).

comment:3 Changed 9 years ago by Jochen Topf

Resolution: fixed
Status: reopenedclosed

I have fixed both errors in SVN. Note that your patch for the stuff was not quite right, the query has to be for defined($max) and defined($name) to get the same behaviour as , but in this case this might not matter.

There are several more cases in the code where the operator is used, but they are all in the munin scripts and, if changed, would make the code a lot harder to read. So I am keeping those for the time beeing. Most people will probably has a newer perl version.

Note: See TracTickets for help on using tickets.