#!/usr/local/bin/perl

print "Enter string to encode:\n";
chop( $str = <STDIN> );

$str =~ s/(\W)/sprintf( "%%%x", ord($1) )/eg;

print "\nEncoded string:\n\n";
print "$str\n";

exit 0;
