[26262] in Perl-Users-Digest
Perl-Users Digest, Issue: 8445 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 22 18:05:30 2005
Date: Thu, 22 Sep 2005 15:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 22 Sep 2005 Volume: 10 Number: 8445
Today's topics:
Re: Can a Perl Programmer Pick up PHP quickly? <perl@my-header.org>
Re: Problem in Executing system command in a forking se xhoster@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 22 Sep 2005 21:04:19 +0200
From: Matija Papec <perl@my-header.org>
Subject: Re: Can a Perl Programmer Pick up PHP quickly?
Message-Id: <03v5j1t522nq8ep966aj17detdvhihfr9u@4ax.com>
X-Ftn-To: Mladen Gogala
Oprosti sto nisam odgovorio, ali reader mi se cudno ponasa pa nisam prije
vidio poruku. :)
Mladen Gogala <gogala@sbcglobal.net> wrote:
>> It is, but you can soon find struggling with php if you want to do something
>> more => http://tnx.nl/php
>
>Ah, another PHP hater, and a countryman at that. No, no struggling is
>necessary. PHP is easier to learn then perl. Much easier to learn. On the
I don't see who claimed otherwise, of course it's easier to learn php; the
question is how far can you go with that knowledge? The page above shows the
php4 traps which are actually facts and are not subject to somebody personal
preferences (eg. liking/disliking over syntax/language philosophy).
>other hand, for the CLI environment, perl rulz. I started with perl few
>weeks ago, when subroutines were called with "&" and curent version was
>perl 4.0.36. As an oracle DBA, I used oraperl variety, a predecessor to
>DBI/DBD::Oracle. It was 1995. PHP5 was a breeze to pick: no @ISA, no
>$AUTOLOAD, no tie, no hidden first arguments, just classes, methods and
>inheritance, the way they're meant to be.
There is a price tag for power and it all depends if you'll need it and if
you are ready to pay for it. I agree that perl OO isn't the best thing out
there but personally, I would rather embrace demanding but consistent
language over non consistent and unexpectedly behaving one.
I think that python/ruby/java folks would also agree on that, and they don't
have much in common.
"Let those who have the ears to hear - hear.." ;)
>PHP functions are, on the other hand, well documented, books are complete,
I'll strongly disagree on documentation as it lacks completeness. As an
illustration to that, there are many user comments(threads actually) below
documentation that deals with solving various gotchas.
>unlike "Learning Perl", which skips things like references, packages and
>objects. To learn Perl, you need at least 3 books: "Learning Perl",
>"Programming Perl" and Conway's OO Perl. It is much easier to learn PHP
>then to learn Perl.
Yes, but it's also easier to learn logo then php. :)
imho, so long as your tool can do what you want, there is no need to change
it.
>On the other hands, Perl has formats, and PHP has
>nothing like a built-in report writer. I love both Perl and PHP, PHP for
>the web, Perl for CLI. Perl with its arcane secrets and tricks that can be
>learned only through the word of mouth
So, Conway did tell you everything in person as it also did to me? ;)
perldoc perl, and perldoc perltie looks enough
>and bizarre mechanisms like "tie"
afaik, there is nobody forcing anybody to use ties or similar. Ties are
transparent to user and exist to make life easier if you need it, but you
can also live long and well without them.
>is much, much harder to learn. This comes from someone who uses both perl
>and PHP. That page is rubbish. For the real PHP hater page look for the
I don't know if author of that page hates php or not, but there are some
real arguments which stand equally in all emotional contexts.
--
Matija
------------------------------
Date: 22 Sep 2005 18:07:04 GMT
From: xhoster@gmail.com
Subject: Re: Problem in Executing system command in a forking server
Message-Id: <20050922140704.271$Lf@newsreader.com>
vikrant <vikrantREMOVE@DELETEsaysnetsoft.com> wrote:
> hi
>
> I am trying to store the return value of system command after execution
> in a forking server.
>
> The command executes successfully but returns "-1".
How do you know?
> In case of failure,
> it returns the same value "-1", like when i am replacing "date" with
> "data" in system command. From my understanding, it should return -1 only
> in case of failure. How do go about distinguishing between a success and
> failure call while using the system commnad?
Maybe, if Perl is telling you that it fails, you should ask Perl why it
fails.
>
> Code:-
> -------------------------------------------------------------------------
> ---------- #!/usr/bin/perl -w
> use strict;
> use IO::Socket;
> use IO::Select;
>
> $SIG{CHLD} = 'IGNORE';
After asking Perl why it fails, I've decided this is your problem.
...
> my $sDatecmd=system("date");
> $sNew_Socket->send($sDatecmd);
$sNew_Socket->send("$sDatecmd $!");
> exit;
> }
>
> -------------------------------------------------------------------------
> ----------------------------
>
> Thanks
>
> Vikrant
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8445
***************************************