Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: compare two strings and return only he unique values.

by Kenosis (Priest)
on Feb 03, 2013 at 21:17 UTC ( #1016860=note: print w/replies, xml ) Need Help??


in reply to Re: compare two strings and return only he unique values.
in thread compare two strings and return only he unique values.

Won't show "A" when:

my ( $str1, $str2 ) = ( 'ABCDEA', 'BCDEO' );

Replies are listed 'Best First'.
Re^3: compare two strings and return only he unique values.
by Not_a_Number (Parson) on Feb 03, 2013 at 22:40 UTC

    Yeah, I know. But the OP said:

    I am trying to display unique values from two strings

    So is 'A', in your dataset, unique or not?

    Depends upon a better spec, I suppose...

    Update: smls (below) already pointed this out;

      Your solution is elegant and works beautifully with "ABCDE", "BCDEO" -- the OP's two initial strings. But the OP later included "ABCDE", "BBBBB" as options, clearly indicating the possibility of character reptition. Quite agree that a clearer spec would help...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016860]
help
Chatterbox?
[stevieb]: it is exceptionally difficult I'm finding to debug a dist that is x-platform, where on each platform you're wrapping a different binary. Trying to co-ordinate a successful test run where tests are extensive is a nightmare, especially when the dist...
[stevieb]: ...you're testing is a test system itself. 10+ documented issues fixed, another half dozen found while fixing the original ones. I'm getting there...
[stevieb]: Then throw in changes to Windows that throws everything you trusted right out the window.
[shmem]: that's why it is called "Windows"
[stevieb]: shmem thanks for the 'insight' :P
[shmem]: good thing that Sun already took "OpenWindows", otherwise I'd not stop to shudder imagining an "OpenWindows" from MS

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2017-03-28 21:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (342 votes). Check out past polls.