note 28150 added to features.commandline
| From: | geoffrey at rack1 dot php dot net | Date: | Fri, 03 Jan 2003 21:07:22 +0000 |
| Subject: | note 28150 added to features.commandline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41634@lists.php.net to get a copy of this message | ||
i was hoping for more really. perl command line interface offers a lot more features and less
syntactical complications. i really like that the developers are coming along with features like
this but i was thinking it would be more advanced by now. i don't want to continue using perl
either but i would have to think that it's still far more powerful than this. my friend asked
me "what is the fastest way to change a bunch of text in several files" .. i thought of
php but then i thought perl on the command line is much faster and requires half the write
time.<br>
perl -i -pe 's/expression/replacement/g' *.ext<br><br>
he came back to me again and asked for a way to rename a bunch of files. i thought of perl again.
<br>
find . -type f | perl -ne'chomp; next unless -e; $oldname = $_; s/oldname/newname/g; next if
-e; rename $oldname, $_'<br><br>
the list goes on. but the point is that there should be more to this. perl is still better.
it's ugly and old and been obfuscated but still the features are there and they are rich.
<br><br>
there are other problems with php as well. i won't get into them but one of the most prevalent
is exception handling. even python is better at this than php. perl utilizes the try, catch block,
python calls it try, except ... virtually every language has this. why not php?<br><br>
maybe that sounds too overboard. i think php will have it i think php will be the defacto standard
in web application languages. but i wonder about the direction sometimes. why work on this CLI when
your OOP support is still soo weak?
--
http://www.php.net/manual/en/features.commandline.php
http://master.php.net/manage/user-notes.php?action=edit+28150
http://master.php.net/manage/user-notes.php?action=delete+28150
http://master.php.net/manage/user-notes.php?action=reject+28150