forked from libwww-perl/libwww-perl
/
update_from_5b7
executable file
·73 lines (58 loc) · 1.69 KB
/
update_from_5b7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/local/bin/perl -w
# I decided to change some of the procedure names within this library
# in order to get a more consistent style. This change means that all
# thisTypeOfStyle is converted to this_type_of_style.
#
# This script should make it very easy to convert old script that run
# on libwww-perl-5b7 or older version of the library to run with this
# version.
die "Usage: $0 <sourcfile>...\n" unless @ARGV;
while (<DATA>) {
next if /^\s*$/;
next if /^\s*#/;
chomp;
($from, $to) = split;
next unless defined $to;
push(@code, "s/\\b$from\\b/$to/g;");
}
$code = join("\n", sort @code);
print <<EOT;
------
$code
------
EOT
exec "perl", "-pi.bak", "-e", $code, @ARGV;
__END__
# HTTP::*
statusMessage status_message
isSuccess is_success
isRedirect is_redirect
isError is_error
errorAsHTML error_as_HTML
asString as_string
pushHeader push_header
removeHeader remove_header
addContent add_content
headerAsString headers_as_string
# WWW::*
isMe is_me
# LWP::*
useAlarm use_alarm
readUntil read_until
isProtocolSupported is_protocol_supported
simpleRequest simple_request
redirectOK redirect_ok
getBasicCredentials get_basic_credentials
useEval use_eval
envProxy env_proxy
noProxy no_proxy
guessMediaType guess_media_type
mediaSuffix media_suffix
# HTML::*
asHTML as_HTML
extractLinks extract_links
pushContent push_content
insertElement insert_element
isEmpty is_empty
deleteContent delete_content
isInside is_inside