wget Question

R

Reinhard Glauber

Gunnar Hjalmarsson said:
Reinhard Glauber wrote:

What did you do to find out before posting here? Did you possibly read
the docs for the functioh you are using?

perldoc -f system


Not installed on my system .. I'm lucky .. no one can blame me ;-))
You need to install the perl-doc package to use this program.
 
G

Gunnar Hjalmarsson

Reinhard said:
Not installed on my system .. I'm lucky .. no one can blame me ;-))
You need to install the perl-doc package to use this program.

No, you are not lucky, and anybody can blame you for not reading the
docs of the programming language you are using.

A few options:

- Install perldoc

- Install Perl on your PC. Since you seem to be on a Windows box, I'd
recommend the bundle at http://www.indigostar.com/indigoperl.htm, which
would give you the docs conveniently available as HTML documents.
http://www.activestate.com/ offers a similar bundle.

- Download the docs from http://www.activestate.com/

- Browse the docs on the web; in this case:
http://perldoc.perl.org/functions/system.html
 
J

Jürgen Exner

Reinhard said:
Not installed on my system .. I'm lucky .. no one can blame me ;-))
You need to install the perl-doc package to use this program.

Well, then why don't you fix your broken Perl installation? Then you can
read the documentation yourself and don't have to ask someone else to read
them for you.

Oh, and to answer your original question: See perldoc -f system, third
paragraph, fourth sentence.
Not to mention that this Question is Asked very Frequently, too.

jue
 
U

usenet

Reinhard said:

That's not Perl - that's a shell command with a little bit of Perl
wrapped around it (and it's not even the right sort of Perl).

Real Perl programmers use real Perl functions and modules, and they
resort to shell commands only when absolutely necessary (which is
generally rare - I haven't used a raw shell command from Perl in three
years). The most common module for this purpose is LWP. But I always
recommend the use of the super-duper-module IO::All
(http://tinyurl.com/982wo), especially to novice programmers, because
it provides a nice, EASY proxy to LWP (and a bunch of other functions
and modules). How easy, you ask? Well, I'm REALLY GLAD you asked:

#!/usr/bin/perl
use warnings; use strict;
use IO::All;
my $content < io('http://example.org');
print $content;
__END__

IT DON'T GET NO MORE EASIER THAN THAT RIGHT THERE!
 
E

Eric Schwartz

Real Perl programmers use real Perl functions and modules, and they
resort to shell commands only when absolutely necessary (which is
generally rare - I haven't used a raw shell command from Perl in three
years).

Abigail will likely be around shortly, but in case I beat him to the
punch: Real Perl programmers use whatever bits of Perl are appropriate
to the task. Perl is a very nice glue language, and in many cases
it's clearer and simpler to perform a task using the OS's native tools
than Perl's. Perl also has a number of modules that are not always
the easiest way to do things, though they trend towards more
portability.

Case in point, and this is what convinced me Abigail was right,
File::Find. I personally find it infinitely more expressive to use
find(1) rather than File::Find, and since I work for a group whose
charter is to promote Linux and Open Source tools throughout the
company, I don't have to care about portability. There are other
examples; that's just the most obvious.

If your personal taste leans towards using only Perl, that's fine,
there's nothing wrong with that. But it is blatantly incorrect to
assert that "real Perl programmers" only use shell commands as a last
resort.

-=Eric
 
X

xhoster

That's not Perl - that's a shell command with a little bit of Perl
wrapped around it (and it's not even the right sort of Perl).

Real Perl programmers use real Perl functions and modules, and they
resort to shell commands only when absolutely necessary

So lets say it takes several minutes to uncompress a file through perl
applying many regexes (or index calls) to each line (Not to mention the
time it takes to find, convince someone to install on many machines, and
then learn how to use the decompression module), but only a few seconds to
open and then read from:

open my $fh, qq{zcat /foo/bar/gene2accession.gz|fgrep "$grepper"|} or die
$!;

Is a savings of ~100x in run time absolutely necessary or just a needless
convenience?

Real programmers use the right tools for the job, whatever those may be.

Xho
 
A

axel

That's not Perl - that's a shell command with a little bit of Perl
wrapped around it (and it's not even the right sort of Perl).
Real Perl programmers use real Perl functions and modules, and they
resort to shell commands only when absolutely necessary (which is
generally rare - I haven't used a raw shell command from Perl in three
years). The most common module for this purpose is LWP. But I always
recommend the use of the super-duper-module IO::All
(http://tinyurl.com/982wo), especially to novice programmers, because
it provides a nice, EASY proxy to LWP (and a bunch of other functions
and modules). How easy, you ask? Well, I'm REALLY GLAD you asked:
#!/usr/bin/perl
use warnings; use strict;
use IO::All;

I think that should be:

use IO::All::LWP;
my $content < io('http://example.org');
print $content;
__END__

Axel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top