File: studly

package info (click to toggle)
filters 2.52
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 264 kB
  • ctags: 47
  • sloc: lex: 1,880; perl: 1,018; ansic: 214; makefile: 83; sh: 10
file content (13 lines) | stat: -rwxr-xr-x 448 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/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;
}