in reply to How to send attributes of an object to create an object of another class?

#!/usr/bin/perl --- use strict; use warnings; use Data::Dumper qw' Dumper '; Main( @ARGV ); exit( 0 ); sub Main { my $variable = 'String'; my %Hash = ( $variable => 'Hello' ); my $Ref = \%Hash; $Ref->{STRING} = 'STRING'; $Ref->{'s'.'t'.'r'.'i'.'NG'} = 'striNG'; $Hash { $Ref->{$variable} } = 'World!'; print Dumper( \%Hash ), "\n\n"; } __END__ $VAR1 = { 'String' => 'Hello', 'Hello' => 'World!', 'striNG' => 'striNG', 'STRING' => 'STRING' };
I suggest reading through perlintro and References quick reference
  • Comment on Re: How to send attributes of an object to create an object of another class?
  • Download Code