You are here: Re: PHP equivalent to Perl's !~ « PHP Programming Language « IT news, forums, messages
Re: PHP equivalent to Perl's !~

Posted by Toby A Inkster on 01/19/08 23:44

The Natural Philosopher wrote:

> And apart from reminding me of 'pregnancy' how much more readable the
> PHP is!

Frankly I find the Perl version far more elegant. The lack of redundant
quote marks and nested brackets if far more pleasing to the eye IMHO.

Indeed, in Perl you could use:

print "match\n" if $foo !~ /bar/;

or even:

print "match\n" unless $foo =~ /bar/;

Either seem pretty readable to me.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 20 days, 10:51.]

Ham vs Bacon vs Pork
http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация