Revision 7a1d9a7,
256 bytes
checked in by Anders Kaseorg <andersk@…>, 13 years ago
(diff) |
Fix encode script to work with Perl 5.12
While we’re at it, turn on strict and warnings.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
|
-
Property mode set to
100755
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | use strict; |
---|
4 | use warnings; |
---|
5 | |
---|
6 | $ARGV[0] =~ s/\+([^+]*)\+/unparse($1)/eg; |
---|
7 | print $ARGV[0]; |
---|
8 | sub unparse { |
---|
9 | $_ = $_[0]; |
---|
10 | return "/" unless $_; |
---|
11 | return "_" if $_ eq "-"; |
---|
12 | return uc($_) if /^[a-z]$/; |
---|
13 | s/^x//; |
---|
14 | return chr hex $_; |
---|
15 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.