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="A. Sinan Unur, post: 4785110"] Then you need to specify the problem a little better. For example, given the input below, what output would you like your program to produce? Please do read the posting guidelines to find out how you can help others help you. You will need to better describe what you are trying to do and make an effort yourself if you are to get the maximum possible help here. Here is something that might do what you are after. Please study it (not as a great example of programming) to try and understand in what ways it meets your specs, and in what ways it doesn't, and then formulate your next attempt based on that new understanding. #! /usr/bin/perl use strict; use warnings; if(defined(my $prev = <DATA>)) { chomp($prev); while(defined(my $curr = <DATA>)) { chomp $curr; last unless length $curr; unless($curr == $prev) { print "$.: $curr not equal to $prev\n"; $prev = $curr; } } } __END__ 1207553365 1207553365 1207553365 1207553365 1207553365 1207553365 1207553365 1207553366 1207553365 Sinan [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Perl
Perl Misc
comparing two numbers
Top