Thread Methodenaufruf anhand des Methodennamens "objektorientiert" (8 answers)
Opened by Daniel at 2009-12-09 15:21

sid burn
 2009-12-10 12:51
#129155 #129155
User since
2006-03-29
1520 Artikel
BenutzerIn

user image
Oder:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
use JSON;
use DateTime;

my $dt = DateTime->now;
print object_to_json($dt, qw/day month year hour minute second/), "\n";

sub object_to_json {
    my ( $object, @methods ) = @_;
    return to_json({ map { $_ => $object->$_ } @methods });
}
Nicht mehr aktiv. Bei Kontakt: ICQ: 404181669 E-Mail: perl@david-raab.de

View full thread Methodenaufruf anhand des Methodennamens "objektorientiert"