in reply to Re: exists EXPR error
in thread exists EXPR error

I am pretty sure that is what I have:

You suggested, "{ if ( exists $new_list{$file} ) {"

The code is broken into two lines to improve readability, but all of the code you suggested is present. Unless I am missing something!

sub DirCompare{ for my $file ( keys %old_list ) { if ( exists %new_list{$file} ) { next; } else { push @diffs, "Old file not in new: $file"; } } for my $file ( keys %new_list) { if ( exists %old_list{ $file } ) { next; } else { push @diffs, "Old file not in new: $file"; } }

Replies are listed 'Best First'.
Re^3: exists EXPR error
by BrowserUk (Patriarch) on Dec 15, 2014 at 05:25 UTC

    Contrast:if ( exists %new_list{$file} ) {

          with:if ( exists $new_list{$file} ) {

    Can you see.............^.....the difference?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      I see it now. Sorry.

      It cleared the error. Now I get to go to the next error! I love learning Perl (at least that is what I am telling myself:)).

      Thanks for your help