#!/usr/bin/perl -w use strict; use Data::Dumper; my $x = test('a', 'b'); my @y = test('a', 'b'); print Dumper( $x, \@y ); sub test {}