sub myfunction { use strict; use warnings; use Class::Struct; struct ( 'Structname', { value1 => '$', value2 => '$' } ); my $mystruct = new Structname; $mystruct = $ARGV[0]; return $mystruct->value1." ".$mystruct->value2; }