Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: xs modifying passed value

by space_monk (Chaplain)
on Nov 17, 2012 at 17:55 UTC ( #1004331=note: print w/replies, xml ) Need Help??


in reply to xs modifying passed value

print "It's $t\n" if $passfail eq 1;

Maybe a minor point, but "eq" is a string comparison operator, not a numeric comparison operator.

A Monk aims to give answers to those who have none, and to learn from those who know more.

Replies are listed 'Best First'.
Re^2: xs modifying passed value
by Festus Hagen (Novice) on Nov 18, 2012 at 01:48 UTC
    Yup, Thank you.

    I always get em backwards ... :(

    -Enjoy
    fh : )_~

      I always get em backwards

      Easy: If you want to compare characters (strings, char* or char[] if you know C), use the operators made from characters (eq, ne, lt, gt, le, ge, cmp). If you want to compare numbers like in mathematics, use the operators you know from mathematics (==, !=, <, >, <=, >=, <=>).

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        Excellent way to remember it ...

        Thank you!

        -Enjoy
        fh : )_~

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004331]
help
Chatterbox?
[1nickt]: I have been an apostate in the Apple orchard for almost 15 years. But Dells are still high quality it seems, unlike Macs these days.
[1nickt]: And you can still configure the system at will, on the "Small Business" site.
[Corion]: 1nickt: I bought a 2015 XPS 13, which is a very nice and shiney (and somewhat overpriced) machine, but I think it's still better priced than an Apple machine. Now it just has to hold up 10 years like the old one did ;)

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2017-03-27 13:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.