[30797] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2042 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 8 18:09:45 2008

Date: Mon, 8 Dec 2008 15:09:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 8 Dec 2008     Volume: 11 Number: 2042

Today's topics:
        is perl obsolete? <gavcomedy@gmail.com>
    Re: is perl obsolete? <tim@burlyhost.com>
    Re: is perl obsolete? xhoster@gmail.com
    Re: is perl obsolete? <r.ted.byers@gmail.com>
    Re: is perl obsolete? <tim@burlyhost.com>
    Re: is perl obsolete? <joost@zeekat.nl>
    Re: is perl obsolete? <tim@burlyhost.com>
    Re: is perl obsolete? <joost@zeekat.nl>
    Re: is perl obsolete? <cwilbur@chromatico.net>
    Re: is perl obsolete? <cartercc@gmail.com>
    Re: is perl obsolete? <joost@zeekat.nl>
    Re: is perl obsolete? <cartercc@gmail.com>
    Re: Linux disk errors - any early indications <james.harris.1@googlemail.com>
    Re: Linux disk errors - any early indications <tim@burlyhost.com>
    Re: Mathematica 7 compares to other languages <jon@ffconsultancy.com>
    Re: Mathematica 7 compares to other languages <xahlee@gmail.com>
    Re: Mathematica 7 compares to other languages <gneuner2@comcast.net>
        Trouble with Net::Ping <r.ted.byers@gmail.com>
    Re: Why would it appear to my scripts that a server the <r.ted.byers@gmail.com>
    Re: Why would it appear to my scripts that a server the <tim@burlyhost.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 8 Dec 2008 11:20:01 -0800 (PST)
From: gavino <gavcomedy@gmail.com>
Subject: is perl obsolete?
Message-Id: <1ab62b0e-34da-4285-84bc-62ab7462409a@i24g2000prf.googlegroups.com>

do people only use it for legacy?

php ruby haskell erlang all seem to be beyond it


------------------------------

Date: Mon, 08 Dec 2008 11:25:41 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: is perl obsolete?
Message-Id: <Vwe%k.59198$5L3.37575@newsfe09.iad>

gavino wrote:

> do people only use it for legacy?
> 
> php ruby haskell erlang all seem to be beyond it

Rather than listening to the hype of other languages or what people feel
about it, feel free to research it.  Perl is very widely used, is
popular and will remain so.  Other languages are fine to use as well
(it's your preference/choice and you can use more than one), but don't
let people's choices and opinions make you believe that a language they
don't like or use is somehow going to go away or makes it obsolete. 
Perl isn't going anywhere.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


------------------------------

Date: 08 Dec 2008 20:04:52 GMT
From: xhoster@gmail.com
Subject: Re: is perl obsolete?
Message-Id: <20081208150346.373$h7@newsreader.com>

gavino <gavcomedy@gmail.com> wrote:
> do people only use it for legacy?

No.  I use it extensively for new projects.

> php ruby haskell erlang all seem to be beyond it

"Beyond" in what way?  In my admittedly non-omniscient experience, people
who use Perl just quietly get the job done.  People using some other
languages I can think of seem to spend more time blathering about their
language than actually using it.  I'm sure some people whose favorite
language is <fill in the blank> will say the same thing with the labels
switched.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


------------------------------

Date: Mon, 8 Dec 2008 12:05:42 -0800 (PST)
From: Ted Byers <r.ted.byers@gmail.com>
Subject: Re: is perl obsolete?
Message-Id: <e6285a56-65e9-442d-af1c-d99c9c446e9f@w35g2000yqm.googlegroups.com>

On Dec 8, 2:20=A0pm, gavino <gavcom...@gmail.com> wrote:
> do people only use it for legacy?
>
No.  Our use is entirely new code (although we write a lot of code in
java, and soon C++)  Our legacy code is Basic, soon to be completely
rewritten in C++.

> php ruby haskell erlang all seem to be beyond it

What do you mean "beyond it"?

We have used PHP, but I prefer perl for the kinds of things we do that
don't involve a GUI or a web interface, and Java/servlets/JSP/JSF for
web programming, with a little ASP written in perl on occasion.  I
haven't seen enough of a payoff in PHP to warrant using it in
preference to anything else I use.  Obviously each language exists
because it has something its designers felt was missing in the other
options, and each language's popularity is a reflection of how many
developers share the language designers' views.

It is not likely that there will ever be unanimous agreement on what
makes a language desirable.  Some prefer BASIC because it is simple
(and built into just about all MS products), so simple one doesn't
need as  much training for VB developers as one needs for a C++ or
Java developer (hence the market demand for them).  But C++ and Java
developers would likely complain that VB is too simple, and that its
object model is broken.  I have had experienced VB developers ask me
what an object model is after I had asked them to explain some aspect
of the VB object model, this after they have told me, correctly (if
you're willing to accept such a simple object model), that VB supports
object oriented programming.

But worrying about the popularity of a language strikes me as folly.
There was a time when people had to develop in binary machine code,
and later in assembly.  Few people have those skills now, and for good
reason.  But somebody must still do it in order to map the programming
languages we understand and use to something a machine can process.
The skill sets a compiler developer must have are different from what
an application developer needs.

Some might argue that fortran ought to be used only for legacy code,
because it has allegedly been superceded by languages like C/C++.  I
would say not, though, since the fortran standard is continuing to
evolve, gaining support for new idioms touted by, e.g. those enamored
with object oriented programming.  As old as it is, fortran remains
well designed for its problem domain (number crunching).

I would respectfully suggest that rather than describing any of these
languages as being beyond any of the others, it would be fairer to say
only that they're different.  And I'd recommend you take a look at,
for example, James Colpien's book on multiparadigm development (yes, I
know that was written focussed on C++, but what is says is relevant
beyond C++ in terms of matching what is required by a problem domain
to what is supported by a given language).  A man who has only a
hammer wiling likely treat all fasteners as nails, while one who has
only a screwdriver will likely only see fasteners as screws, but it
seems to me that a sensible workman will have a complete toolkit,
including hammers, screwdrivers, staplers, &c., and be included to
select the right tool for a given job, and probably more than one tool
when considering different aspects of a major project, if I may use
that metaphore to explain the essence of multiparadigm development.
And to take that one step further, different workmen need different
tools, just as an electrician would likely use screwdrivers, as he
rewires a house, that are different from the screwdrivers used by a
jeweller repairing watches.

Cheers,

Ted


------------------------------

Date: Mon, 08 Dec 2008 12:14:52 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: is perl obsolete?
Message-Id: <0ff%k.495$R43.327@newsfe08.iad>

gavino wrote:


> php ruby haskell erlang all seem to be beyond it

Also, what do you mean by they all seem to be beyond it?  There's
absolutely nothing those languages or frameworks can do that Perl can't
do just as well (and sometimes better), or in a framework, too.  They
are newer, they are hyped more, is that what you mean?  PHP and Ruby
are fine languages, nothing wrong with them.  I use them as well as
Perl, but unless I have a specific request, I always code in Perl,
because those other languages have nothing on Perl that makes them
better.  Perhaps you can clarify in what way you mean they are beyond
Perl?
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


------------------------------

Date: Mon, 08 Dec 2008 21:28:59 +0100
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: is perl obsolete?
Message-Id: <87vdtuqulw.fsf@zeekat.nl>

Tim Greer <tim@burlyhost.com> writes:

> gavino wrote:
>
>
>> php ruby haskell erlang all seem to be beyond it
>
> Also, what do you mean by they all seem to be beyond it?  There's
> absolutely nothing those languages or frameworks can do that Perl can't
> do just as well (and sometimes better), or in a framework, too.  They
> are newer, they are hyped more, is that what you mean?  PHP and Ruby
> are fine languages, nothing wrong with them.  I use them as well as
> Perl, but unless I have a specific request, I always code in Perl,
> because those other languages have nothing on Perl that makes them
> better.  Perhaps you can clarify in what way you mean they are beyond
> Perl?

Don't expect a decent answer from gavino. He just thinks up these inane
questions and then never replies in any meaningful manner.

-- 
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/


------------------------------

Date: Mon, 08 Dec 2008 12:36:53 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: is perl obsolete?
Message-Id: <Fzf%k.3058$Xt.1664@newsfe13.iad>

Joost Diepenmaat wrote:

> 
> Don't expect a decent answer from gavino. He just thinks up these
> inane questions and then never replies in any meaningful manner.
> 

I see, I've not noticed him posting here before.  I assume there's a
good chance it's an attempt to troll and get people riled up (about
other people's opinions, ironically). :-)
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


------------------------------

Date: Mon, 08 Dec 2008 21:56:57 +0100
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: is perl obsolete?
Message-Id: <87r64iqtba.fsf@zeekat.nl>

Tim Greer <tim@burlyhost.com> writes:

> Joost Diepenmaat wrote:
>
>> 
>> Don't expect a decent answer from gavino. He just thinks up these
>> inane questions and then never replies in any meaningful manner.
>> 
>
> I see, I've not noticed him posting here before.  I assume there's a
> good chance it's an attempt to troll and get people riled up (about
> other people's opinions, ironically). :-)

He's a regular poster on comp.lang.lisp (where most people are of the
opinion he's never written a single line of lisp), but a quick google
groups search turns up posts on comp.lang.forth, c.l.tcl, c.l.haskell,
c.l.python, and on the third page, a post called "democrats are
communists" in alt.politics.

-- 
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/


------------------------------

Date: Mon, 08 Dec 2008 15:59:10 -0500
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: is perl obsolete?
Message-Id: <86myf6qt7l.fsf@mithril.chromatico.net>

>>>>> "TG" == Tim Greer <tim@burlyhost.com> writes:

    TG> Joost Diepenmaat wrote:

    >> Don't expect a decent answer from gavino. He just thinks up these
    >> inane questions and then never replies in any meaningful manner.

    TG> I see, I've not noticed him posting here before. 

He goes from programming language group to programming language group,
asking inane questions.  I suspect that he just got soundly flamed in
comp.lang.somethingorother and decided to focus on fresh meat.

He's a masterful troll - it's very easy to believe that he's just really
naive and curious.  Unfortunately, he's been naive and curious for the
past three years at least, and he never seems to learn anything from the
threads he spawns.

Charlton



-- 
Charlton Wilbur
cwilbur@chromatico.net


------------------------------

Date: Mon, 8 Dec 2008 13:43:36 -0800 (PST)
From: cartercc <cartercc@gmail.com>
Subject: Re: is perl obsolete?
Message-Id: <1f8f2d11-82c8-4447-835a-fd04959fdd3e@w34g2000yqm.googlegroups.com>

On Dec 8, 2:20=A0pm, gavino <gavcom...@gmail.com> wrote:
> do people only use it for legacy?
>
> php ruby haskell erlang all seem to be beyond it

Let's see ...

COBOL, circa 1950s - I have a friend who manages a dozen or so COBOL
programmers and complains because he has to personally train new hires
to write COBOL.

FORTRAN, circa 1950s - I have a friend who is a university senior
majoring in aerospace engineering and is taking FORTRAN as a program
requirement.

LISP, circa 1950s - There have been a glut of new books on LISP and
some recent articles that suggest that LISP will come into its own
with multi core processors.

C, circa 1970s - Still used for Linux, Unix, and Windows kernel
hacking.

Ada, circa 1970s - Where I work, we continually get job announcements
looking for Ada programmers, mostly from the armed services and
defense contractors.

Perl, circa 1980s - I use Perl on a daily basis in my job as a
database manager. I've experimented with several languages, and have
concluded (based on comparisons made among languages) that Perl is
optimal because of its string handling and RE facilities.

No, Perl isn't obsolete, not even close. It's not all prettied up like
C#, J#, F#, or the other brand new languages, but it has the collected
wisdom of the ages (relatively speaking) in CPAN. All things
considered, I'd much rather have my fat, ugly, old woman, who cleans
my house, cooks my meals, washes my clothes, and satisfies me in every
way than some tart in lipstick, rouge, a push-up bra and a mini-mini
skirt who'll leave me high and dry in my time of need.

CC.


------------------------------

Date: Mon, 08 Dec 2008 22:49:46 +0100
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: is perl obsolete?
Message-Id: <873agyqqv9.fsf@zeekat.nl>

cartercc <cartercc@gmail.com> writes:

> LISP, circa 1950s - There have been a glut of new books on LISP and
> some recent articles that suggest that LISP will come into its own
> with multi core processors.

If you haven't seen it yet, take a look at clojure. Looks like a strong
contender for the next "new lisp" - especially with its focus on
concurrency.

-- 
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/


------------------------------

Date: Mon, 8 Dec 2008 14:33:45 -0800 (PST)
From: cartercc <cartercc@gmail.com>
Subject: Re: is perl obsolete?
Message-Id: <562815c2-e67e-4811-87d5-bf4eeb1ab78d@c1g2000yqg.googlegroups.com>

On Dec 8, 4:49=A0pm, Joost Diepenmaat <jo...@zeekat.nl> wrote:
>
> If you haven't seen it yet, take a look at clojure. Looks like a strong
> contender for the next "new lisp" - especially with its focus on
> concurrency.

Take a look at today's /. for the article in Dr. Dobbs Journal, It's
Time to Get Good at Functional Programming

http://www.ddj.com/development-tools/212201710;jsessionid=3D3MQLTTYJRPL3CQS=
NDLRSKH0CJUNN2JVN

CC


------------------------------

Date: Mon, 8 Dec 2008 12:25:16 -0800 (PST)
From: James Harris <james.harris.1@googlemail.com>
Subject: Re: Linux disk errors - any early indications
Message-Id: <9f34f025-ef0c-421a-8b06-d218632fe658@l39g2000yqn.googlegroups.com>

On 4 Dec, 18:24, Tim Greer <t...@burlyhost.com> wrote:
> James Harris wrote:
> > I was thinking more of indications while Linux is running and the
> > disks are mounted, not of taking them down to scan them.
>
> You can run the checks while the drives/partitions are mounted.  fsck
> doesn't have to be told to actually try and fix the issues it finds,
> but you can simply check with smartctl or similar tools, as well as
> running badblocks on a live environment (again, you needn't tell it to
> fix the bad blocks or issues it finds).  What tools you use, depends on
> your drives, drivers, kernel options and what you have installed.  I'd
> recommend asking in a Linux group or searching google for specifics.

(e2)fsck has no option to _only_ report disk error status. It has a -n
option to answer No to all questions but it still goes away and scans
the disk - at least it does so for a partition which it knows has
errors.

What I'd like it to get at is the info about which partitions have
errors without scanning them.

I found tune2fs has a -e error-behaviour option but its only options
are


  continue    Continue normal execution.

  remount-ro  Remount filesystem read-only.

  panic       Cause a kernel panic.

None of these are what's needed unless "continue" generates an error
report somewhere which it doesn't seem to at the moment. What I want
is for an alert to be raised when an error is detected. For example
by:

1) e-mail,
2) syslog,
3) note the fact in memory etc.

Then these could be checked by:

1) e-mail is easy to read,
2) syslog can be scanned in a job overnight - if there is some known
string to look for,
3) a command to report on the partition errors noted in memory.

Any one of these would do, though the last is the best option as it
doesn't rely on disk storage. Doesn't seem much to expect one of these
but Linux has no such option (that I can find, anyway) to report a
filesystem problem.

James


------------------------------

Date: Mon, 08 Dec 2008 12:48:06 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Linux disk errors - any early indications
Message-Id: <bKf%k.2259$dm3.298@newsfe02.iad>

James Harris wrote:

> Any one of these would do, though the last is the best option as it
> doesn't rely on disk storage. Doesn't seem much to expect one of these
> but Linux has no such option (that I can find, anyway) to report a
> filesystem problem.

You needn't scan the drive for errors (that was a suggestion, of a few,
of how you could check to health or the current drive(s)), and with
normal usage it will report the error in the dmesg and messages log (if
it can), assuming you have the proper error reporting/debugging
enabled.

You should use tools such as smartctl (for example) and other commands
that will warn you both as errors happen and as it sees problems
starting to happen, but the rest were just tools you could use to check
the state of the drive now (you can use the other tools now that aren't
having to spend a long time scanning).  It really depends on your
system and what you can do, such as a hardware raid card, software
raid, or just normal ide/scsi/sata drives.  This should probably no
longer be posted to the Perl group.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


------------------------------

Date: Mon, 08 Dec 2008 21:31:29 +0000
From: Jon Harrop <jon@ffconsultancy.com>
Subject: Re: Mathematica 7 compares to other languages
Message-Id: <Z9ednSE6l5AIDKDUnZ2dnUVZ8gOdnZ2d@posted.plusnet>

Xah Lee wrote:
> Also, in this discussion, thanks to Thomas M Hermann's $20 offered to
> me for my challenge to you, that i have taken the time to show working
> code that demonstrate many problems in your code.

You failed the challenge that you were given. Specifically, your code is not
measurably faster on the problem that I set. Moreover, you continued to
write as if you had not failed and, worse, went on to give even more awful
advice as if your credibility had not just been destroyed.

> If you are a Mathematica expert, you could make it recurse yet have
> the speed as other langs.

No, you cannot. That is precisely why you just failed this challenge.

You should accept the fact that Mathematica currently has these
insurmountable limitations.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u


------------------------------

Date: Mon, 8 Dec 2008 14:32:59 -0800 (PST)
From: Xah Lee <xahlee@gmail.com>
Subject: Re: Mathematica 7 compares to other languages
Message-Id: <8947211d-2ee8-403a-8c8a-c7599aea5f80@k24g2000pri.googlegroups.com>

2008-12-08

Xah Lee wrote:
> > Also, in this discussion, thanks to Thomas M Hermann's $20 offered to
> > me for my challenge to you, that i have taken the time to show working
> > code that demonstrate many problems in your code.


A moron, wrote:
> You failed the challenge that you were given.

you didn't give me a challenge. I gave you. I asked for $5 sincerity
wage of mutal payment or money back guarantee, so that we can show
real code instead of verbal fight. You didn't take it and do nothing
but continue petty quarrel on words. Thomas was nice to pay me, which
results in my code that is demonstratably faster than yours. (verified
by a post from =E2=80=9Cjason-sage @@@ creativetrax.com=E2=80=9D, quote: =
=E2=80=9CSo Xah's
code is about twice as fast as Jon's code, on my computer.=E2=80=9D, messag=
e
can be seen at =E2=80=9C http://www.gossamer-threads.com/lists/python/pytho=
n/698196?do=3Dpost_view_threaded#698196
=E2=80=9D ) You refuse to acknowledge it, and continue babbling, emphasizin=
g
that my code should be some hundred times faster make valid argument.

As i said, now pay me $300, i will then make your Mathematica code in
the same level of speed as your OCmal. If it does not, money back
guaranteed. Here's more precise terms i ask:

Show me your OCmal code that will compile on my machine (PPC Mac, OSX
10.4.x). I'll make your Mathematica code in the same speed level as
your OCmal code. (you claimed Mathematica is roughly 700 thousand
times slower to your OCmal code. I claim, i can make it, no more than
10 times slower than the given OCmal code.)

So, pay me $300 as consulting fee. If the result does not comply to
the above spec, money back guaranteed.

> You should accept the fact that Mathematica currently has these
> insurmountable limitations.

insurmountable ur mom.

  Xah
=E2=88=91 http://xahlee.org/

=E2=98=84



------------------------------

Date: Mon, 08 Dec 2008 17:40:58 -0500
From: George Neuner <gneuner2@comcast.net>
Subject: Re: Mathematica 7 compares to other languages
Message-Id: <8evqj4p342jvcma5saibf54thv7075r88g@4ax.com>

On Sun, 7 Dec 2008 14:53:49 -0800 (PST), Xah Lee <xahlee@gmail.com>
wrote:

>The phenomenon of creating code that are inefficient is proportional
>to the highlevelness or power of the lang. In general, the higher
>level of the lang, the less possible it is actually to produce a code
>that is as efficient as a lower level lang. 

This depends on whether someone has taken the time to create a high
quality optimizing compiler.


>For example, the level or power of lang can be roughly order as 
>this:
>
>assembly langs
>C, pascal
>C++, java, c#
>unix shells
>perl, python, ruby, php
>lisp
>Mathematica

According to what "power" estimation?  Assembly, C/C++, C#, Pascal,
Java, Python, Ruby and Lisp are all Turing Complete.  I don't know
offhand whether Mathematica is also TC, but if it is then it is at
most equally powerful.

Grammatic complexity is not exactly orthogonal to expressive power,
but it is mostly so.  Lisp's SEXPRs are an existence proof that a
Turing powerful language can have a very simple grammar.  And while a
2D symbolic equation editor may be easier to use than spelling out the
elements of an equation in a linear textual form, it is not in any
real sense "more powerful".


>the lower level the lang, the longer it consumes programer's time, but
>faster the code runs. Higher level langs may or may not be crafted to
>be as efficient.  For example, code written in the level of langs such
>as perl, python, ruby, will never run as fast as C, regardless what
>expert a perler is. 

There is no language level reason that Perl could not run as fast as C
 ... it's just that no one has cared to implement it.


>C code will never run as fast as assembler langs.

For a large function with many variables and/or subcalls, a good C
compiler will almost always beat an assembler programmer by sheer
brute force - no matter how good the programmer is.  I suspect the
same is true for most HLLs that have good optimizing compilers.

I've spent years doing hard real time programming and I am an expert
in C and a number of assembly languages.  It is (and has been for a
long time) impractical to try to beat a good C compiler for a popular
chip by writing from scratch in assembly.  It's not just that it takes
too long ... it's that most chips are simply too complex for a
programmer to keep all the instruction interaction details straight in
his/her head.  Obviously results vary by programmer, but once a
function grows beyond 100 or so instructions, the compiler starts to
win consistently.  By the time you've got 500 instructions (just a
medium sized C function) it's virtually impossible to beat the
compiler.

In functional languages where individual functions tend to be much
smaller, you'll still find very complex functions in the disassembly
that arose from composition, aggressive inlining, generic
specialization, inlined pattern matching, etc.  Here an assembly
programmer can quite often match the compiler for a particular
function (because it is short), but overall will fail to match the
compiler in composition.

When maximum speed is necessary it's almost always best to start with
an HLL and then hand optimize your optimizing compiler's output.
Humans are quite often able to find additional optimizations in
assembly code that they could not have written as well overall in the
first place.

George


------------------------------

Date: Mon, 8 Dec 2008 13:47:07 -0800 (PST)
From: Ted Byers <r.ted.byers@gmail.com>
Subject: Trouble with Net::Ping
Message-Id: <18195b92-3a9d-4fd2-aaa6-514ef6753fc0@k8g2000yqn.googlegroups.com>

Here is a little script assembled fromt he documentation for
Net::Ping.


use Net::Ping;

$p = Net::Ping->new();
$p->hires();
#$host = '192.168.2.1';
$host = 'www.google.ca';
print '$host: ',$host,"\n\n";
($ret, $duration, $ip) = $p->ping($host,50);
print $ret,"\n";
print $duration,"\n";
print $ip,"\n\n";
printf("$host [ip: $ip] is alive (packet return time: %.2f ms)\n",
1000 * $duration)
      if $ret;
$p->close();

And here is the output from three runs of a program using Net::Ping:

C:/Perl/bin\perl.exe -w k:/Work/test.network.pl
$host: 192.168.2.1

1
0.96875
192.168.2.1

192.168.2.1 [ip: 192.168.2.1] is alive (packet return time: 968.75 ms)

Compilation finished at Mon Dec 08 16:26:54
C:/Perl/bin\perl.exe -w k:/Work/test.network.pl
$host: www.google.ca

0
5
72.14.205.99


Compilation finished at Mon Dec 08 16:27:56

C:/Perl/bin\perl.exe -w k:/Work/test.network.pl
$host: www.google.ca

0
21.046875
72.14.205.99


Compilation finished at Mon Dec 08 16:29:48


The first is within my homeoffice LAN, 192.168.2.1 being the router.
The first two sets of output are without specifying a timeout (i.e.
using ($ret, $duration, $ip) = $p->ping($host)).

And now here is what I get using ping manually:

C:\>ping www.google.ca

Pinging www.l.google.com [72.14.205.103] with 32 bytes of data:

Reply from 72.14.205.103: bytes=32 time=17ms TTL=246
Reply from 72.14.205.103: bytes=32 time=14ms TTL=246
Reply from 72.14.205.103: bytes=32 time=14ms TTL=246
Reply from 72.14.205.103: bytes=32 time=16ms TTL=246

Ping statistics for 72.14.205.103:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 14ms, Maximum = 17ms, Average = 15ms

C:\>ping www.google.ca

Pinging www.l.google.com [72.14.205.99] with 32 bytes of data:

Reply from 72.14.205.99: bytes=32 time=17ms TTL=246
Reply from 72.14.205.99: bytes=32 time=17ms TTL=246
Reply from 72.14.205.99: bytes=32 time=17ms TTL=246
Reply from 72.14.205.99: bytes=32 time=17ms TTL=246

Ping statistics for 72.14.205.99:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 17ms, Maximum = 17ms, Average = 17ms

C:\>

The manual execution of ping happened just before and just after my
test scriptlet was executed.

So, then, why would my router invariably be seen by Net::Ping as
accessable while google would not be, even though google clearly IS
accessable.  Again, I tried other sites, such as Microsoft, and while
they are clearly accessable when manually invoking ping, the script
using Net::Ping can not see them even though they get the correct IP
address for them (as can be determined by comparison with the manual
Ping command output at the time the script is executed.

Is there something in configuring Net::Ping that can make it useful
for automating checking connectivity (in the context of handling
situations where, say, and LWP agent fails to retieve data as expected
- did we get no data because there was no data or because the
connection was lost or some other reason)?

Thanks

Ted


------------------------------

Date: Mon, 8 Dec 2008 12:22:00 -0800 (PST)
From: Ted Byers <r.ted.byers@gmail.com>
Subject: Re: Why would it appear to my scripts that a server they're  connecting to has gone away (using Net::FTP and LWP)
Message-Id: <b7a0ed4e-3b03-4941-82e8-aa695465582b@v13g2000yqm.googlegroups.com>

On Dec 6, 5:57=A0pm, Bill H <b...@ts1000.us> wrote:
> On Dec 5, 1:23=A0am, Ted Byers <r.ted.by...@gmail.com> wrote:
>
>
>
>
>
> > Here is the interesting part of the log for my script that uses
> > NET::FTP:
>
> > Copying 44 files
> > Net::FTP=3DGLOB(0x3e18a04)>>> TYPE I
> > Net::FTP=3DGLOB(0x3e18a04)<<< 200 Type set to I
> > Status: 2
>
> > C_MerchantData_ALT_Work.2008-11-12.zip
> > Net::FTP=3DGLOB(0x3e18a04)>>> ALLO 5062889
> > Net::FTP=3DGLOB(0x3e18a04)<<< 202 No storage allocation neccessary.
> > Net::FTP=3DGLOB(0x3e18a04)>>> PORT 10,1,10,124,7,5
> > Net::FTP=3DGLOB(0x3e18a04)<<< 200 Port command successful
> > Net::FTP=3DGLOB(0x3e18a04)>>> STOR C_MerchantData_ALT_Work.
> > 2008-11-12.zip
> > Net::FTP=3DGLOB(0x3e18a04)<<< 150 Opening data channel for file
> > transfer.
> > Net::FTP=3DGLOB(0x3e18a04): Timeout at C:/Perl/site/lib/Net/FTP/
> > dataconn.pm line 7
> > 4
> > Status: 1
>
> > C_MerchantData_ALT_Work.2008-11-13.zip
> > Net::FTP=3DGLOB(0x3e18a04)>>> ALLO 5299854
> > Net::FTP: Unexpected EOF on command channel at C:\backup
> > \copy.backups.to.T.O.pl
> > line 48
> > Status: 5
>
> > Qualitatively, it looks like only one zip archive is tranfered (and my
> > colleagues in TO can open them and verify the contents), and then the
> > ftp session seems to go away and there is no more interaction with the
> > ftp server.
>
> > Here is the interesting part of a log created (LWP::DebugFile):
>
> > Here is the last bit pertaining to the download that occured just
> > before the failed dowwnload:
> > LWP::Protocol::http::request: ()
> > # Time now: {1228452248} =3D Thu Dec =A04 23:44:08 2008
> > LWP::UserAgent::request: Simple response: OK
>
> > # LWP::DebugFile logging to lwp.log
> > # Time now: {1228452249} =3D Thu Dec =A04 23:44:09 2008
> > LWP::UserAgent::new: ()
> > LWP::UserAgent::request: ()
>
> > ignoring the URL requested (it doesn't matter because if I select a
> > temporal interval involving a few kbytes of data, all works fine),
> > here is what follows:
>
> > .LWP::Protocol::http::request: ()
> > # Time now: {1228452869} =3D Thu Dec =A04 23:54:29 2008
> > LWP::UserAgent::request: Simple response: Internal Server Error
>
> > # LWP::DebugFile logging to lwp.log
> > # Time now: {1228452870} =3D Thu Dec =A04 23:54:30 2008
> > LWP::UserAgent::new: ()
> > LWP::UserAgent::request: ()
>
> > I find it interesting to observe that simply including use of
> > LWP::DebugFile is sufficient to prevent the script from freezing or
> > locking up. =A0Instead, an error like this is logged and the script
> > proceeds to the next request. =A0The error shown above happens in the
> > middle of the download, and in this run, this is the only download
> > that failed.
>
> > Questions:
>
> > 1) How do I get more information from LWP::DebugFile? =A0Or is there an=
y
> > more information to be had?
> > 2) I'd also included the following statements:
>
> > use Log::Trace;
> > use Log::Trace 'print';
> > use Log::Trace log =3D> 'master.generic.download.trace.log';
> > use Log::Trace warn =3D> { Deep =3D> 1, Everywhere =3D> 1, Verbose =3D>=
 2 };
>
> > But I did not get any log from Log::Trace. =A0i must have missed
> > something, but what?
>
> > 3) The information I'm getting from Net::FTP seems fine, except I have
> > yet to find the documentation for what the status codes (returned by
> > the status function) mean. =A0(I found curl, but haven't had time to
> > compile and run it on the same files). =A0Where will I find a more
> > complete description of these status codes?
>
> > 4) Most importantly of all, why do these transfers fail and what can
> > be done about them?
>
> > Thanks
>
> > Ted
>
> Ted, not sure if this may be your problem but I had an issue with
> NET::Ftp earlier this year. I have a script that runs as a cron job
> and uses ftp to transfer files from a clients web server to their
> interanl server. It had always worked great, then we upgraded the
> server and it would never connect and just get timeout warnings, even
> though I could connect from my own machine perfectly fine. It took me
> a day or so to determine that the upgraded server was not allowing the
> outgoing ftp connection because the destination server was an IP
> address. After I setup a DNS for it and used a domain name in the
> connection, it started working just fine again.
>
> Bill H- Hide quoted text -
>
> - Show quoted text -

Thanks all.

We're on our way to a solution, but not quite there, yet.  My
colleague (actually the ftp/router/network administrator) is convinced
it is largely a timeout error.  He retried my script with a pile of
really small files (a few k each) and my script worked flawlessly.
The files that we need to copy to our head office, though, are
typically a few megabytes in size, with one or two that are larger
(e.g. a dump of the current state of a DB managed using MySQL, which
is 200 MB before being compressed and about 15 MB after being
compressed).

I guess, then, the new infomrmation here is that this problem exists
only for transfers of large files, and that all works correctly if we
process only tiny files.

But then, this is a similar problem to our script that uses LWP to
retrieve data from our data feed, in that if the amount of data is
small, all is fine, but there is a server error in the client log when
LWP is asked to retrieve a few MB from the same server (in the LWP
case, we don't have direct access to the server, so we're not sure if
the problem is our script, LWP or the other guy's server).

Did I mention I am paranoid about backing up our data and code?  ;-)

Does anyone else use Net::FTP or LWP's user agents to move around
megabytes of data, in a single file?  If so, are there any tricks of
the trade you'd care to share?

Thanks

Ted


------------------------------

Date: Mon, 08 Dec 2008 12:42:05 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Why would it appear to my scripts that a server they're connecting to has gone away (using Net::FTP and LWP)
Message-Id: <xEf%k.3060$Xt.899@newsfe13.iad>

Ted Byers wrote:

> Does anyone else use Net::FTP or LWP's user agents to move around
> megabytes of data, in a single file?  If so, are there any tricks of
> the trade you'd care to share?

Even if the file is large, as long as the transfer is active, you
shouldn't be having problems with a timeout from inactivity. How is
your connection?  It's been a while since I've used Net::FTP for
anything, and for backups I'd just suggest you create an account with a
jailed (chrooted) shell and use sftp, rsync or similar for secure
transmission.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


------------------------------

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 V11 Issue 2042
***************************************


home help back first fref pref prev next nref lref last post