#!/usr/bin/perl -w $wait = 0; if (@ARGV == 1) { $input = $ARGV[0]; } elsif ($ARGV[0] eq "-w") { $input = $ARGV[1]; $wait = 1; } @input = split //, $input; $output = ""; while (@input) { $char = shift @input; if ($char eq "%") { $high = hex shift(@input); $low = hex shift(@input); $char = chr 16*$high+$low; } $output .= $char; } if ($wait) { system "echo '$output' | nkf"; if ($wait); } else { print "$output\n"; }