develooper Front page | perl.beginners | Postings from December 2002

Equivilence not working (forget it)

From:
beginnersperl
Date:
December 3, 2002 15:27
Subject:
Equivilence not working (forget it)
Message ID:
200212032312.gB3NC0E09095@server1.wiserhosting.net

Don't bother.  I have just seen exactly how stupid I am.  "multipart" 
will never match "multitype".

==============

This is driving me nuts!

Look at this:

if(/Content-Type:\s*(.+)\/(.+);/) 
{
  $content = $1;
  $subtype = $2;
  print $content;  #this returns "multitype"

  print "1match $1\n" if $1 eq $content;
  print "2match $1\n" if $1 eq "multitype";
  print "3match $1\n" if $content eq "multitype";
}

If I run this, "1match multitype" is printed.  2 and 3 don't match.

The weird thing is that if I unpack $content, and "multitype" into arrays 
as hex, the arrays match perfectly.  There are no trailing strange 
characters or anything.

So what am I doing wrong here?  Any takers?

Thanks,

Paul.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About