newbie doubts

2002-12-04 Thread Nandita Shenvi

Hallo All,

I am new in wget and i have some doubts.

I have written a perl script as follows:

$all_links[3]=~s/http:\/\///;
 print $all_links[3];

system (wget, --output-document=wgetcheck,   $all_links[3]  );

I have not copied the whole script but just the last few lines.The variable
$all_links[3] has an URL:
http://bolinux39.europe.nokia.com/database2/MIDI100/GS001/01FINALC.MID.
the link follows a file, which I require.
I remove the http:// before calling the wget, but i still get an error 
message:

--13:56:24--  
http://%20bolinux39.europe.nokia.com/database2/MIDI100/GS001/01FINALC.MID%0A
  = `wgetcheck'
Resolving %20bolinux39.europe.nokia.com... failed: Host not found.
It seems like wget is adding%20 and %0A at the beginning and at the end of 
the URL.
I do not why, i would appreciate when somebody knows the the cause of this 
problem could write to me .I would be gratefull.


thanks
nandita

Nandita Shenvi
Appartment Nr. 707
Westhoffstr. 15
44791 Bochum
Germany
0234/5844456



_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail



Re: newbie doubts

2002-12-04 Thread Tony Lewis
Nandita Shenvi wrote:

 I have not copied the whole script but just the last few lines.The
variable
 $all_links[3] has an URL:
 http://bolinux39.europe.nokia.com/database2/MIDI100/GS001/01FINALC.MID.
 the link follows a file, which I require.
 I remove the http:// before calling the wget, but i still get an error
 message:

 --13:56:24--

http://%20bolinux39.europe.nokia.com/database2/MIDI100/GS001/01FINALC.MID%0A
= `wgetcheck'

$all_links[3] needs to be cleaned up. It contains as trailing \n and there
is a space between http://; and bolinux39 that should not be there.

The \n is easily addressed by: chomp @all_links;

You should look at your script to determine how the space got there. You can
get rid of all spaces by: $all_links[3] =~ s/ //g;
but that may not be what you want. You're better off figuring out how the
unwanted space got there in the first place and making sure it doesn't.

Tony