Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: exists EXPR error

by atcroft (Abbot)
on Dec 15, 2014 at 03:14 UTC ( [id://1110352]=note: print w/replies, xml ) Need Help??


in reply to exists EXPR error

Try replacing the line if ( exists %new_list{$file} ) { with if ( exists $new_list{$file} ) {, and the line if ( exists %old_list{$file} ) { with if ( exists $old_list{$file} ) {.

Hope that helps.

Replies are listed 'Best First'.
Re^2: exists EXPR error
by smturner1 (Sexton) on Dec 15, 2014 at 05:09 UTC

    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"; } }

      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1110352]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-19 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found