chomp $body; # To get rid of the Carriage Return from the STDIN foreach my $temp (split(/ /,$body)) { # This will generate a loop for each variable/value pair by splitting on spaces my @variable = split (/=/,$temp); # This splits by the equals sign that is delimiting our values and variable names $vars{$variable[0]} = $variable[1]; # So generate a hash of the variable name and the variable value }