[LUGOS-PROG] modifikacija loga
Borut Mrak
b at aufbix.org
Mon Jan 21 19:29:26 CET 2002
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 21 January 2002 18:29, Andraz Sraka wrote:
> @1011305372 <nick!~foouser at foodomain.foo> foobar tale log
> @1011305645 <nick2!~foouser2 at foodomain.foo> res full foo
> Thu Jan 17 23:09 2002 <nick> foobar tale log
> Thu Jan 17 23:14 2002 <nick2> res full foo
while(<>) {
if(/^@(\d+) <([^!]+)!.*?> (.*)$) {
my $time = $1;
my $nick = $2;
my $bla = $3;
my $longtime = localtime($time);
print "$longtime <$nick> $bla";
}
}
Tisti "Thu Jan 17..." ti vrne localtime (ali gmtime, ce ti je ljubse),
ce ga uporabis v skalarnem kontekstu.
Mogoce je kje kaksna napakica v regex-u, ker zadeve nisem preizkusal.
lp,
- --
Borut
b at aufbix.org
- ------------
"A Mormon is a man that has the bad taste and the religion to do what a
good many other people are restrained from doing by conscientious
scruples and the police." -- Mr. Dooley
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iEYEARECAAYFAjxMXgYACgkQRUVvbWYRhIIJXACfY6DVXtBEBi8wafmayRRhR5HM
KNIAoKXfOj9cEvdjjCr9Y4LxbqH6HpNR
=pfjy
-----END PGP SIGNATURE-----
More information about the lugos-prog
mailing list