O'Reilly logo

Programmieren mit Perl by Jon Orwant, Tom Christiansen, Larry Wall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Class::Struct

use Class::Struct; struct Manager => { # Erzeugt Manager->new()-Konstruktor. name =>'$', # natne ()-Methode greift nun auf Skalarwert zu. salary =>'$', # Das gilt auch für salary() started =>'$', # Und für started() }; struct Shoppe => { # Erzeugt Shoppe->new()-Konstruktor. owner =>'$', # owner()-Methode greift auf Skalar zu. addrs =>'@', # addrs()-Methode greift auf Array zu. stock =>'%', # stock()-Methode greift auf Hash zu. boss => 'Manager', # Mit Manager->new() initialisiert. }; $store = Shoppe->new(); $store->owner('Abdul Alhazred'); $store->addrs(0, 'Miskatonic University'); $store->addrs(l, 'Innsmouth, Mass.'); $store->stock("books", 208); $store->stock("charms", 3); $store->stock("potions", "none"); $store->boss->naine ('Prof ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required