#!/usr/bin/perl -w use strict; package Camel; sub new { my $class = shift; my $self = bless {name =>'Jack Camel'}, $class; } sub who { my $self = shift; return $self->{name} } sub what { my $self = shift; return "a camel, can't you see that?"; } package main; my $camel = new Camel; for ('who', 'what') { print $_, "?\t", $camel->$_, "\n"; }