Gossamer Forum
Home : General : Perl Programming :

how to remove "this" ?

Quote Reply
how to remove "this" ?
What code should I use to remove this:
" "
form
" " ???

[This message has been edited by jpop (edited July 27, 1999).]
Quote Reply
Re: how to remove "this" ? In reply to
Looks to me like you have uploaded a cgi script in binary mode. Some times when you upload a text file in binary mode, you get those weird characters.

Try uploading the script in ASCII mode. Other than that, I don't know.

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited July 27, 1999).]
Quote Reply
Re: how to remove "this" ? In reply to
Sorry, this character is generated by my cgi-script...
Not by binary ar ascii mode...
Quote Reply
Re: how to remove "this" ? In reply to
Normally this character denotes a carriage return. What is the code that generates the line? And how is it output? File or screen?

Dan Smile
Quote Reply
Re: how to remove "this" ? In reply to
This is the code :
@lines is a list of urls.
this code is used to find the link in a remote html file.
Unfortunately, may occur in $correct_url...
How can I remove it?

-------------------------------
foreach $line (@lines) {

use LWP::Simple;

$broken = 0;
my $url = "$line";

local $SIG{ALRM} = \&died;
alarm 10;
my $results = get ($url);
alarm 0;

$results or $broken = 1;

if ($broken) {
open(BROK, ">>data/broken.txt");
flock(BROK, 2);
print BROK "$url";
close(BROK);
}

else {
while ($results =~ m#href="([^"]+)"#sog) {
$unchecked_link = $1;
unless ($unchecked_link =~ /http:/i or $unchecked_link =~ /mailto:/i or $unchecked_link =~ /#/i or $unchecked_link =~ /ftp:/i or !$unchecked_link =~ /.htm/i or !$unchecked_link =~ /.shtml/i) {
$url =~ s/\n//g;
if ($url =~ /http:\/\/([^"]+)\/([^<]+).html/i) {$url =~ s/$2.html//g;}
if ($url =~ /http:\/\/([^"]+)\/([^<]+).htm/i) {$url =~ s/$2.htm//g;}
if ($url =~ /http:\/\/([^"]+)\/([^<]+).shtml/i) {$url =~ s/$2.shtml//g;}
$correct_url = "$url$unchecked_link";
$correct_url =~ s/ //;
$extended_url .= "$correct_url\n";
}}}}
---------------------------------------
Quote Reply
Re: how to remove "this" ? In reply to
Could you type it (the character) in here, so we could take a look at it and figure out something for you. It's impossible to tell what you want to get rid off, when you don't actually know what it is. Smile

------------------
find.virtualave.net