Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^5: perl unpack and matching the unpacked data

by AnomalousMonk (Archbishop)
on Jul 18, 2014 at 01:10 UTC ( [id://1094148]=note: print w/replies, xml ) Need Help??


in reply to Re^4: perl unpack and matching the unpacked data
in thread perl unpack and matching the unpacked data

... what i tried was actually:
elsif ( $data eq "8000" || "0080" ) { $tid = .....; }

As you discovered, this syntax doesn't work — at least, not the way you expected: the truth value of the expression  $data eq '8000' is logical-ored with '8000'. Again, let Perl help you:

c:\@Work\Perl\monks>perl -wMstrict -MO=Deparse,-p -le "my $data = '8000'; ;; if ($data eq '8000' || '0080') { print 'yes'; }; " BEGIN { $^W = 1; } BEGIN { $/ = "\n"; $\ = "\n"; } use strict 'refs'; (my $data = '8000'); if ((($data eq '8000') or '0080')) { print('yes'); } -e syntax OK

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1094148]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-23 06:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found