dkogan / feedgnuplot

Tool to plot realtime and stored data from the commandline, using gnuplot.
Other
711 stars 37 forks source link

Regexp Error when executing #1

Closed juanramb closed 14 years ago

juanramb commented 14 years ago

Unmatched ) in regex; marked by <-- HERE in m/ <> ) <-- HERE { next if / at ./feedGnuplot.pl line 317.

perl -v

This is perl, v5.8.8 built for x86_64-linux-thread-multi

The machine is a RHEL5

dkogan commented 14 years ago

I'm using the // operator, which was introduced in perl 5.10. You're using 5.8 here, so the code fails. Try this patch and let me know if something else doesn't work. I've never tried with perl5.8 myself.

diff --git a/feedGnuplot.pl b/feedGnuplot.pl
index 1f75478..beb50b3 100755
--- a/feedGnuplot.pl
+++ b/feedGnuplot.pl
@@ -312,7 +312,7 @@ sub mainThread {
     my $xlast;
     my $haveNewData;

-    while( $_ = ($dataQueue && $dataQueue->dequeue()) // <> )
+    while( $_ = (defined $dataQueue ? $dataQueue->dequeue() : <>))
     {
       next if /^#/o;

@@ -339,7 +339,7 @@ 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()) // $.;
+          $xlast = defined $dataQueue ? $dataQueue->dequeue() : $.;
         }

         if($options{dataindex})
juanramb commented 14 years ago

Thanks for your quick reply!