CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [FishMonger] script not producing output: Edit Log



StaedarN
Novice

May 14, 2013, 11:45 PM


Views: 820
Re: [FishMonger] script not producing output

 if( $nodiff && $diff )
{
printf("\n%d : %x : Differences found\n", $pagecount, $pagenumber);
}
elsif( $ident and not $nodiff)
{
printf("\n%d : %x : No Differences found\n", $pagecount, $pagenumber);

This if statement is confusing me. (the script was given to me, I have no previous perl experience so bare with me, ive tried hard to understand)

If we start from the first looping, $nodiff should be evaluated to 1 if the strings match, while $diff should be 0 all the time (since it never changes right?) which means the first statement will allways be false (concidering the && operation). This begs the question, how anything will ever be evaluated as "differences found"?

[edit] Another thing im wondering about is the !~.This kinda means if string 1 is not string 2; return true, right? (so the $nodiff should maybe be named $diff for clarity?)

As u can see im kind of clueless :< sry. Apreciate the help anyways!


(This post was edited by StaedarN on May 15, 2013, 12:14 AM)


Edit Log:
Post edited by StaedarN (Novice) on May 15, 2013, 12:14 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives