Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here



I am currently working on a PERL script to help automate some processes.  This may be a silly question, but I have to ask.  Is there a way to connect to an http and save a specific page?  (i.e. I connect to http://www.something.com/new.txt and save new.txt)  I need to do it without opening netscape (hence automation).  I know the names of the sites and files.  Is there a way?

RE: Saving

use LWP::Simple;
$url = 'http://www.someURL.com';
$content = get($url);

keep the rudder amid ship and beware the odd typo

RE: Saving

Is this the only way to go about this problem?  I just like to know other aspects just in case.

RE: Saving

That is the most concise way I know of, so far.  

One of the Perl mottos is 'There's more than one way to do it."  And, it is true.  So, no,..... that is not the only way to go about the problem.  

If you are interested in the details, you can look at the documentation and contents of the LWP module or read up on the HTTP specifications.  That is where I would start, anyway.

good luck.

keep the rudder amid ship and beware the odd typo

RE: Saving

Anyone got any links to any of these?

>look at the documentation and contents of the LWP module >or read up on the HTTP specifications.

my test site

RE: Saving

Is there a way to do this without the libwww?  I don't have the ability to put libraries in, unless I beg of course...

RE: Saving

I humbly suggest that if you are going to be doing this kind of stuff with Perl, you are going to periodically need new modules installed.  There is enormous economy to be gained in using existing modules.  A solid cost/benefit case can be made.  I would go ahead and start cultivating a good relationship with your sys-admin (or , start rebuilding one if need be)

keep the rudder amid ship and beware the odd typo

RE: Saving

Problem finished.  Thanks!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close