in reply to Its not working.. String works but not split
updated: The results of compare, if $str1 and $str2 are exactly alike, should return 1; however, it returns less than 1, which simply measures "how much alike they are". And since I wanted to know "if they were exactly alike", I updated the code accordingly. Thanks for noticing that, ikegami#!/usr/bin/perl use strict; use warnings; use String::Compare; my $str1 = "string1 eq 79%"; my $str2 = "string2 eq 79%"; my $points12 = compare($str1, $str2); if($points12 == 1) { print 'They are the same', "\n"; } else { print 'They are not the same', "\n"; }
|
|---|