#!/usr/bin/perl use strict; use warnings; my $word; BEGIN { # In the beginning was the Word, # and the Word was with God, and the Word was God. $word='God'; # Note 'the'...obviously He intends a scalar... # The same was in the beginning with God. my $same; # Unused variable...typo? } # All things were made by him; and without him # was not any thing made that was made. my %things = make_all($word);# pass 'word' as maker. # In him was life; $word .= 'life'; # 'In' him??? Maybe concatenate # and the life was the light of men. $things{men}{light}=$word; # Something funny here... # And the light shineth in darkness; $things{darkness}{shine} = $word; # presume 'The light' means $things{men}{light} # Is 'shineth' an attribute? leave for now. # and the darkness comprehended it not. die "unknown error" unless ok($all{darkness}); # leftover Debug code??? sub make_all { # will replace with Class::Factory... my $maker = shift(); return map {$_=> make_thing($_,$maker) } (qw(light darkness heaven earth seas stars sun men winged_fowl creeping_things)); #etc. etc. - see Genesis for full list } sub make_thing { # formless thing - add attributes later my ($name,$maker) = @_; return { 'name'=>$name, # should bless instead? 'maker'=>$maker # why? Copyright reasons?? }; }