The following works just fine:
#!/usr/bin/perl
use warnings;
use strict;
my $my_hash = { field1=>'val1', field2=>'val2', field3=>'val3', };
my ($field1,$field2,$field3) = (values %{$my_hash});
print "field1=$field1\nfield2=$field2\nfield3=$field3\n";
but, see the following for why it won't work well:
Is Perl guaranteed to return consistently-ordered hash keys?
An example of this going wrong is as follows:
my $my_hash = { field1=>'val1', blah=>'val1.1', field2=>'val2', field3=>'val3', };
my ($field1,$field2, $blah,$field3) = (sort values %{$my_hash});
print "field1=$field1\nfield2=$field2\nblah=$blah\nfield3=$field3\n";
the output is:
field1=val1
field2=val1.1
blah=val2
field3=val3
Note that the value of $field1 is wrong here. As "mu is too short" has already noted a Hash Slice is the way to go here to make sure the ordering is what you expect, and don't forget to use warnings on all your code.