Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

same program different output

by jesuashok (Curate)
on Dec 09, 2006 at 10:33 UTC ( [id://588776]=perlquestion: print w/replies, xml ) Need Help??

jesuashok has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: same program different output
by Corion (Patriarch) on Dec 09, 2006 at 10:42 UTC

    You've just found out that =~ is not a symmetrical relation, while == is. Other asymmetrical relations are <, >, <=, >=. Other symmetrical relations are != and eq. If you want to learn more on (symmetric) relations, see Symmetric relation.

    Would it surprise you if a program that used $a < $b had output different from an otherwise identical program that used $b < $a?

Re: same program different output
by MaxKlokan (Monk) on Dec 09, 2006 at 12:19 UTC

    In program I you are checking if the regular expression /[abc][hij]/ matches the string " aj", which it does.

    In program II you are checking if regular expression / aj/ matches the string "[abc][hij]", which it does not.

Re: same program different output
by liverpole (Monsignor) on Dec 09, 2006 at 23:05 UTC
    jesuashok,

    I believe one of the reasons you are getting downvoted for this post is that it sounds a lot like a number of your previous posts, wherein you ask what sounds to be either a complete beginner's Perl question, or a question that doesn't make any sense, and then say "why is this happening?!"

    My question to you is this:  by all accounts, you've been working as a Perl programmer for at least a couple of years.  Is this really the first time you've come across regular expressions, or tried to understand how they work?  And you were unable to search for any meaningful answers, and didn't have even a single colleague who could explain it to you?  (Your junior, perhaps?)

    And if you already understand regular expressions, why are you even bothering to ask the question in the first place??

    Update:  Doing a Super Search for text containing =~, and jesuashok as author, finds (among numerous others) this node, and this one.

    [id://jesuashok|You] clearly understand how to use regular expressions.  Please stop wasting others' time.


    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
Re: same program different output
by Jasper (Chaplain) on Dec 13, 2006 at 17:20 UTC
    What the heck?

    You're a fricking hermit here, you've posted 1700 times, and this is the best you can do?

    Is this some sort of exercise in patience testing, because mine ran out with you some time ago. Anytime I see one of your posts, it's all I can do to stop myself immediately downvoting it.

    If you can't think of anything to say, STOP POSTING. Please. I'm sure everyone would be helpful they felt a question was interesting or funny, or insightful. But this is just so much garbage.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 22:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found