Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Problem with 'if' evaluation

Expand Messages
  • Bill Walton
    ... From: Jeff japhy Pinyan To: perl-beginner@yahoogroups.com Sent: Saturday, December 03, 2005 2:31 PM Subject: Re: [PBML] Problem with if evaluation ...
    Message 1 of 3 , Dec 3, 2005
    • 0 Attachment
      ----- Original Message -----
      From: Jeff 'japhy' Pinyan
      To: perl-beginner@yahoogroups.com
      Sent: Saturday, December 03, 2005 2:31 PM
      Subject: Re: [PBML] Problem with 'if' evaluation


      On Dec 3, Bill Walton said:

      > $position = index($filename,"xml");
      >
      > # This doesn't work. The 'test.sav' file is processed below.
      > next if (not $position); # skip non-XML files

      Did you read the documentation for the index() function? It returns -1 if the substring wasn't found in the string, NOT 0.
      [BW] Yep. I read it. Just forgot that, in perl, '-1' was TRUE. Told you it was a 'stupid newbie' problem ;-) Sorry about that. And thanks for the reply, Jeff.

      Best regards,
      Bill

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.