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="usaims, post: 4785239"] I would like the program to tell me which number is different. Each number represents a unique number to a physical server. Basically, the numbers that I produced below where parsed from a log file. EXAMPLE: <Endpoint ep='10.50.19.77:9876'> <SoapVersion>1207553365</SoapVersion> <Status>ok</Status> </Endpoint> </Control> <Control> <Endpoint ep='10.15.19.78:9876'> <SoapVersion>1207553365</SoapVersion> <Status>ok</Status> </Endpoint> </Control> <Control> <Endpoint ep='10.15.19.79:9876'> <SoapVersion>1207553365</SoapVersion> <Status>ok</Status> </Endpoint> This is the code I used to parse it: my $start_tag = '<SoapVersion>'; my $end_tag = '</SoapVersion>'; open(FILE, '/tmp/test.whatever') || die "can't open the file: $!"; my $line = <FILE>; while(defined ( $line = <FILE> ) ) { if ( $line =~ m/$start_tag(.+?)$end_tag/g ) 99% of the time all these numbers are identical, when one is different from the other, I want Perl to tell me that. I'm in the process of studying your example, thank you. Can you explain to me what 'last unless length $curr' ???? I want to learn from you guys, thanks in advance. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Perl
Perl Misc
comparing two numbers
Top