#!/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
