Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Perl
Perl Misc
comparing two numbers
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="David K. Wall, post: 4785113"] Agreed. But I still might recommend looking at 'perldoc -q duplicate'. Here's another approach, which is what happens when the problem is not specified well: use strict; use warnings; my @nums = qw( 1207553365 1207553365 1207553365 1207553365 1207553365 1207553365 1207553365 1207553366 1207553365 ); my %hash; @hash{@nums} = (); # a little long-winded here, but I thought using ?: # might confuse the OP if ( 1 == keys %hash ) { print "All the same\n"; } else { print "At least one is different\n"; } [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Perl
Perl Misc
comparing two numbers
Top