my $fields; eval $_; die if $@; my ( $name, $location, $mapref, $type, $description ) = @$fields; #### #! perl use strict; use warnings; use Data::Dumper; $Data::Dumper::Indent = 0; $Data::Dumper::Useqq = 1; $Data::Dumper::Purity = 1; my ($name, $location, $siteMapRef, $type, $description, $mapRef); while () { eval $_; die if $@; my $fields = [ $name, $location, $siteMapRef, $type, $description ]; $_ = Data::Dumper->new( [ $fields ], [ 'fields' ] )->Dump(); $_ .= "\n"; } continue { print $_; } __DATA__ $name="MyName";$location="MyLoc";$mapRef="MyRef";$type="MyType";$description="MyDesc"; #### $fields = ["MyName","MyLoc",undef,"MyType","MyDesc"]; #### use strict; use warnings;