[Dresden-pm] framify.pl (was: Demnächst im Pentacon)

Thomas Washeim hakke_007 at gmx.de
Die Nov 23 11:12:07 CST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steffen Schwigon wrote:
|
|                                  ***
|
|            Bei der Gelegenheit, an alle Listen-Mitleser und
|               Perlmongers-Oldschooler der ersten Stunde:
|
|                    ,-------------------------------.
|                    |  Kommt mal wieder zahlreich!  |
|                    `-------------------------------'
|
|
| Ich male neuerdings gerne solche Kästchen.
| Das fördert plain-ascii und fixed-width-fonts. :-)
|
Sehr fein, hat mich inspiriert und ich habe ein kleines Perl-Script
geschrieben, das Text randisiert(?)! Hier der Code (in Aktion!):

+-----------------+
| #!/usr/bin/perl |
+-----------------+
+-----+---------+
| use | strict; |
+-----+---------+
+--+
+  +
+--+
+------+-------+-------------+----+-----------+----+------+
| open | FILE, | "<$ARGV[0]" | if | ($ARGV[0] | != | ""); |
+------+-------+-------------+----+-----------+----+------+
+-------+------+---+
| while | (<>) | { |
+-------+------+---+
+----+---------+
| my | $D="+"; |
+----+---------+
+----+---------+
| my | $L="|"; |
+----+---------+
+-----+---+
| map | { |
+-----+---+
+----+---+----+----+-------------------+---+---+
| if | ( | 75 | <= | (length($_.$D)+3) | ) | { |
+----+---+----+----+-------------------+---+---+
+-------+--------------------+
| print | "$D>\n$L>\n$D>\n"; |
+-------+--------------------+
+------+------+
| $D=" | >+"; |
+------+------+
+------+------+
| $L=" | >|"; |
+------+------+
+---+
| } |
+---+
+-----------------------------+
| $D.="-"x(length($_)+2)."+"; |
+-----------------------------+
+-------+----+-----+
| $L.=" | $_ | |"; |
+-------+----+-----+
+---+----------+
| } | (split); |
+---+----------+
+-------+-----------------+---+----------------+---+----------+>
| print | ((length($L)-1) | ? | "$D\n$L\n$D\n" | : | "+--+\n+ |>
+-------+-----------------+---+----------------+---+----------+>
~ >+--------------+
~ >| +\n+--+\n"); |
~ >+--------------+
+---+
| } |
+---+
+-------+-------+
| close | FILE; |
+-------+-------+


- --
Find my public key here: http://www.htw-dresden.de/~s50954/
Please note, that you will never receive an unsigned mail from me.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBo29n2/ggQBUI/skRAr4NAJ9WMG/mZwXGoKmf3mMW8SjW8dfKwwCgnTlb
HN4Kr7aWTcuTQiOfioJSQCE=
=ND/K
-----END PGP SIGNATURE-----