Zero equals pipe??



My perl program had some conditional statements that checked whether a
given characters was a pipe "|" or not. The program behaved strangely,
and I quickly realized it was treating pipes and zeros equivalently. To
make sure I was not going insane, I put the following checks:

if ( '1' == '|') { ... some statement ... }

if ( '0' == '|') { ... another statement ... }

By any sensible measure, both statements must return FALSE. First one
did that. Second one returned TRUE.

What's going on and how do I get around it?

.



Relevant Pages

  • Re: IO::Pipe and loss of data
    ... Messages vary in their length but can reach up to 2000 characters. ... > writer, then that buffer gets full, and writers will block until the ... After now switching to a named pipe I started with printing more info to my ... gives an error on every missing character at the end. ...
    (comp.lang.perl.misc)
  • Re: Is there an easier way to fix a crack in a large PVC pipe?
    ... TinyURL was created! ... has a length of 25 characters: ... I fixed one leak, the one downstream gets enough pressure and bust out. ... I cut a short section of the pipe out, ...
    (alt.home.repair)
  • Re: Sherlock Holmes Pipe Ban
    ... their early shows with a parental warning. ... misuse, i.e. Cookie Monster, and smoking with a pipe. ... characters was holding a pipe impersonating Sherlock Holmes. ...
    (alt.smokers.pipes)
  • Re: Comics wit da pipe
    ... the funnies are my fav. ... and his pipe is actually lit. ... I don't know of any comics that print in the paper that have a pipe in them. ... But occasionally SinFest has one of the main characters with at pipe. ...
    (alt.smokers.pipes)
  • Re: Sherlock Holmes Pipe Ban
    ... their early shows with a parental warning. ... misuse, i.e. Cookie Monster, and smoking with a pipe. ... characters was holding a pipe impersonating Sherlock Holmes. ...
    (alt.smokers.pipes)