Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-14-2010, 02:14 PM   #1
LQ Newbie
Registered: Oct 2010
Posts: 3

Rep: Reputation: 0
Bareword Found where operator expected

$dec93 = 93;
$ser = SERVO;
$lbit = uc(sprintf("%02x\n", $dec93));
if($lbit == 5D){
print DATA "Byte11: $fbits11=$bstr11 Bits:[95-88]\t$ser\n";

Why do I get this error?

Bareword found where operator expected at C:\Perl Scripts\ line 64, near "5D" (Missing operator before D?)
Old 10-14-2010, 02:59 PM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,817

Rep: Reputation: 609Reputation: 609Reputation: 609Reputation: 609Reputation: 609Reputation: 609
Uh, quote your 5D.
Old 10-14-2010, 03:20 PM   #3
LQ Newbie
Registered: Oct 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Quoting produced the following:

Argument "5D" isn't numeric in numeric eq (==) at C:\Perl Scripts\ line 64.
Argument "5D\n" isn't numeric in numeric eq (==) at C:\Perl Scripts\ line 64

but this did the trick:

if($lbit =~ /5D/)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
perl xs error: Bareword found where operator expected at ./Makefile.PL line 10, near nikole Red Hat 1 04-13-2010 03:41 PM
error: unary operator expected ?? Lynda_M Programming 3 11-29-2008 09:03 PM
unary operator expected error! Lynda_M Programming 3 11-29-2008 01:04 PM
unary operator expected MONKEYJUDO Linux - Newbie 1 07-13-2008 07:05 AM
Binary operator expected - error mike9287 Linux - Newbie 9 07-17-2006 09:27 AM

All times are GMT -5. The time now is 05:28 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration