Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Re: comparing strings

by petral (Curate)
on Oct 30, 2002 at 17:52 UTC ( #209175=note: print w/replies, xml ) Need Help??


in reply to Re: Re: comparing strings
in thread comparing strings

Of course, if you're using arrays, you just need
if ($lines{$_] eq $lines2[$_]) {
The following will replace the non-matching chars in the string  $str1 with "*" (and leave the matching chars) by converting $str2 to a regex:
$str2 =~ s/./(?:($&)|.)/g; print map{$_||'*'} $str1 =~ /$str2/


  p

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://209175]
help
Chatterbox?
[NetWallah]: /stevieb I dont understand - the poster had a very legitimate issue, and expressed it clearly. WHat did you have a problem with?

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2017-02-23 14:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (347 votes). Check out past polls.