Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris


by chromatic (Archbishop)
on Apr 11, 2000 at 21:38 UTC ( #7326=note: print w/replies, xml ) Need Help??

in reply to RE:
in thread

If Perl made a distinction between numerals in scalars and characters in scalars, yes. As the typing system is weak (that is, a combination of internal Perl magic and context determine which operation is more appropriate), it's helpful to be able to specify explicitly which kind of comparison is desired.

That's also why you'll see empty lists and the keyword scalar sometimes -- just a way of being sure that the operation has the desired effect by enforcing context and giving hints to the internal magic.

(Now things like && and and are merely syntactic sugar designed to make Perl Poetry more readable. Right. :)

Replies are listed 'Best First'.
by turnstep (Parson) on Apr 11, 2000 at 21:45 UTC

    'and' and 'or' are not merely the syntactic sugar (1) equivalents of && and || - they have a lower precedence. I prefer using && and ||, but 'and' and 'or' come in quite handy occasionally.

    (1) A lovely phrase. I wouldn't mind if perl had more for-foreach like things, just so I could sling the phrase around more often. :)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (11)
As of 2016-10-21 18:30 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (289 votes). Check out past polls.