File: studly

package info (click to toggle)
filters 2.22
  • links: PTS
  • area: main
  • in suites: woody
  • size: 252 kB
  • ctags: 145
  • sloc: lex: 1,868; perl: 269; makefile: 81; sh: 6
file content (14 lines) | stat: -rwxr-xr-x 449 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl

# stUdLy cAPs, after emacs studly.el -- the commented line is just
# to remind diehards how it *should* be done ;)
#
# just for reference, you may do whatever you like with this file.
#
# -- nwp@lemon-computing.com

for (my $offset = 0; defined(my $c = getc); $offset++) {
#    (($c + $offset) % 4) == 2 and print (ord($c) ^ 32) or print($c);
    (($c + $offset) % 4) != 2 and print($c) or $c =~ tr/[A-Za-z]/[a-zA-Z]/, print $c;
}