#!/usr/bin/perl
###########################################
# urlcode.pl - URL en/decode
# Mike Schilli <m@perlmeister.com>, 2004
###########################################
use warnings;
use strict;

use Getopt::Std;
use URI::Escape;

getopts "d", \my %opts;

die "usage: $0 [-d] string" unless 
    defined $ARGV[0];

if($opts{d}) {
    print uri_unescape($ARGV[0]), "\n";
} else {
    print uri_escape($ARGV[0]), "\n";
}
