open(MY_ID,"<http://myhost/myrep/myfile");
open(MY_OTHER_ID,">myfile_local");
while(<MY_ID>)
{print MY_OTHER_ID $_;}
close(MY_OTHER_ID);
close(MY_ID);
how is it possible ???(i haven't learn how to use sockets yet... so if you
can tell me the syntax!)
second thing:
if my perl begin with:
BEGIN {$ENV{'HOST'} = "my own value";}
and if ,after, i open my file, does the remote file have as
$ENV{'REMOTE_HOST'}, the value i entered??
if not, how can i do that?
It's to manage to fake informations sent to a url, so i can just get the
content of the url, without having my ip or host or servername logged...
i thank everyone who will help me.
sc...@orka.fr
scalp.
#!/usr/bin/perl
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("Grab/0.1 " . $ua->agent);
# Create a request
my $req = HTTP::Request->new( GET => "http://somewhere/something");
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
# Check the outcome of the response
if ($res->is_success) {
print $res->content;
} else {
print "Bad luck this time\n";
}
> second thing:
> if my perl begin with:
>
> BEGIN {$ENV{'HOST'} = "my own value";}
>
> and if ,after, i open my file, does the remote file have as
> $ENV{'REMOTE_HOST'}, the value i entered??
> if not, how can i do that?
You can check it by getting http://hostname/cgi-bin/printenv
Also you MUST have printenv on server!
--
+--------------------------------------------------------------------
|Roman M.Ivanov, Administration of Novosibirsk Region, Russia,
|630011, Novosibirsk, Krasny prospekt, 18, http://www.adm.nso.ru/
| tel +7-3832-23-66-40, 23-54-44, fax +7-3832-236972
| mailto:po...@obladm.nso.ru or mailto:roman...@netscape.net
| ICQ UIN 8160057