From 5444886acc0b9f7c0000c659295cf8e428af6b0a Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Fri, 28 May 2010 10:58:48 -0700 Subject: [PATCH] made the script compatible with perl 5.8 by no longer using the // operator --- feedGnuplot.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/feedGnuplot.pl b/feedGnuplot.pl index 795240b..fc47a01 100755 --- a/feedGnuplot.pl +++ b/feedGnuplot.pl @@ -317,7 +317,8 @@ sub mainThread { my $xlast; my $haveNewData; - while( $_ = ($dataQueue && $dataQueue->dequeue()) // <> ) + # I should be using the // operator, but I'd like to be compatible with perl 5.8 + while( $_ = (defined $dataQueue ? $dataQueue->dequeue() : <>)) { next if /^#/o; @@ -344,7 +345,9 @@ sub mainThread { # since $. is not meaningful in the plotting thread if we're using the data queue, we pass # $. on the data queue in that case. This construct pulls it from the queue if we're using # it, otherwise it uses $. directly - $xlast = ($dataQueue && $dataQueue->dequeue()) // $.; + + # I should be using the // operator, but I'd like to be compatible with perl 5.8 + $xlast = defined $dataQueue ? $dataQueue->dequeue() : $.; } if($options{dataindex})