Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Found a Perl hole

by kutsu (Priest)
on Jan 27, 2005 at 17:22 UTC ( [id://425638]=note: print w/replies, xml ) Need Help??


in reply to Re: Found a Perl hole
in thread Found a Perl hole

I think you mean if(int(chr(127)) == $types[$t]...to second davis:

use warnings; use diagnostics; if(int(chr(127)) == @types[$t]) { print "BOO!\n"; }

Gives (among other interesting but pointless for this demo):

Scalar value @types[$t] better written as $types[$t] at test.pl line 4 (#2) (W syntax) You've used an array slice (indicated by @) to select a single element of an array. Generally it's better to ask for a scalar value (indicated by $). The difference is that $foo[&bar] always behaves like a scalar, both when assigning to it and when evaluating its argument, while @foo[&bar] behaves like a list when you assign to it, and provides a list context to its subscript, which can do weird things if you're expecting only one subscript.

"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-28 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found