Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regexp Error when executing #1

Closed
juanramb opened this issue Apr 9, 2010 · 2 comments
Closed

Regexp Error when executing #1

juanramb opened this issue Apr 9, 2010 · 2 comments

Comments

@juanramb
Copy link

juanramb commented Apr 9, 2010

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
Copy link
Owner

dkogan commented Apr 9, 2010

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
Copy link
Author

Thanks for your quick reply!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants