fetching to docs using wget



Hi,

I am trying to fetch various docs from server using wget. Below is the code
Files are downloading but of 0 size :(

Am i missing any thing

adave@adave:~/adave> cat fetch.pl
open(S,"<./source.txt") || die "Failed to open file 'source.txt' $!";
while(<S>)
{

if (/http/)
{
@a=split(/\//,$_);
$file=$a[-1];
$r=exec `/usr/bin/wget $_ >./$file `;
print $r;
print "Printing the output of last $?";
exit;
}
}
close(S);
adave@adave:~/adave> perl fetch.pl
--18:03:19-- http://localhost/training_files/docs/overview.ppt
=> `overview.ppt'
Resolving localhost... x.x.x.x.
Connecting to localhost x.x.x.x... connected.
HTTP request sent, awaiting response... 200 OK
Length: 145,920 [application/vnd.ms-powerpoint]

100%[==================================================================================================================>]
145,920 81.61K/s

18:03:21 (81.43 KB/s) - `overview.ppt' saved [145920/145920]

0Printing the output of last 0adave@adave:~/adave> ls -l
total 5
-rw-r--r-- 1 adave aix 254 2008-07-22 17:48 fetch.pl
-rw-r--r-- 1 adave aix 4074 2008-07-22 16:52 source.txt
-rw-r--r-- 1 adave aix 0 2008-07-22 18:03 overview.ppt



Thanks,
a b


Relevant Pages

  • Slow performance
    ... The computer is terribly slow ... opening and closing programes, connecting and downloading ...
    (microsoft.public.windowsxp.perform_maintain)
  • Slow Performance
    ... The computer is terribly slow ... opening and closing programes, connecting and downloading ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Slow Performance
    ... MS-MVP Windows - Shell/User ... connecting and downloading ... | to be visibly draining the source, ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Monitoring internet traffic
    ... Since a couple of days something has been downloading something from ... but not a list of processes connecting to the net). ... It lists "open files" and the processes they belong to, but sockets are also treated as files. ... Another useful command is 'iftop'. ...
    (alt.os.linux.suse)
  • Re: Remove of Domain Controllers
    ... This worked fine - once I connected to the proper server - ... NOT to and that was the piece of info I was missing. ... Are you connecting to the ... >endpoints available from the endpoint mapper.) ...
    (microsoft.public.win2000.active_directory)