[ic] eBay UserTags Update

Kevin Walsh kevin at cursor.biz
Tue Mar 23 13:17:10 EST 2004


Grant [emailgrant123b at yahoo.com] wrote:
> I did get some more info from the Perl group I got the
> modified code from.  Apparently "Regexes are not the
> Right Tool for constant strings" so I'm replacing:
> 
> if ($response =~ /^<\?xml/ ) {
> 
> with:
> 
> if ( index($response, '<?xml') == 0 ) {
> 
> in all the tags.  I'll be sure to let everyone know if this causes
> problems. 
> 
It won't cause problems, but it may affect code readability.

The index() will probably be twice as fast as that regex, in that
particular case, but considering the fact that the regex will probably
take 0.0000008 seconds to execute, being twice as fast isn't really
something to get excited about. :-)

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/



More information about the interchange-users mailing list