weihe has asked for the wisdom of the Perl Monks concerning the following question:
this is a encodeemail fuction, would you like help me write a decodeemail.#!C:\Perl\bin\perl.exe -w use strict; use warnings; use LWP::UserAgent; my $url = "http://bbs.wenjuantong.com"; open(OUT, ">>respone.txt") or die("Cannot open out file:$!"); my $agent = new LWP::UserAgent(); my $request = new HTTP::Request('get' => $url); $request ->content_type('application/x-www-form-urlencoded'); $request ->content('type=another'); my $response = $agent ->request($request); print(OUT $response->as_string()); print(OUT "\n"); close(OUT) or die("Cannot close out file:$!");
sub encodeemail{ my ($self, $email) = CGI::self_or_CGI(@_); my $char = ''; while ($email =~ /([a-z\@]{1})/is){ $char = '&#' . ord($1) . ';'; $email =~ s/$1/$char/sg; } return $email; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to write a function to decode email
by davido (Cardinal) on Apr 27, 2006 at 06:17 UTC | |
by weihe (Initiate) on Apr 27, 2006 at 16:51 UTC | |
|
Re: how to write a function to decode email
by sgifford (Prior) on Apr 27, 2006 at 15:32 UTC | |
| |
|
Re: how to write a function to decode email
by chargrill (Parson) on Apr 27, 2006 at 06:14 UTC | |
|