It seems to me that instead of manipulating data structures you should be using an object-oriented approach: A European class/package, from which the German class/package inherits its language() etc. methods.

Inheritance will take care of your 'overriding' requirements.

To mock around with these concepts, use Class::Prototyped:

use Class::Prototyped; my $european = Class::Prototyped->new( language => 'English', food => 'Europizza', ); my $german = Class::Prototyped->new( 'parent*' => $european, food => 'Wiener Schnitzel', ); my $bavarian = Class::Prototyped->new( 'parent*' => $german, ); print "Default language: ", $bavarian->language(), "\n"; $bavarian->language("Bavarian"); print "Explicitely set language: ", $bavarian->language(), "\n"; print "Default food: ", $bavarian->food(), "\n";

In reply to Re: deep copy, not deep create by saintmike
in thread deep copy, not deep create by horshack

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":