#! /usr/local/bin/perl5 -w

use strict;

## url decding

sub uri_unescape
{
    # copied from libwww

    # Note from RFC1630:  "Sequences which start with a percent sign
    # but are not followed by two hexadecimal characters are reserved
    # for future extension"
    my @copy = @_;
    for (@copy) {
	s/\+/ /g;
	s/%([\dA-Fa-f]{2})/chr(hex($1))/eg;
    }
    wantarray ? @copy : $copy[0];
}

print uri_unescape($ARGV[0]);

