usr bin env perl use warnings use strict use Data Dumper sub get_form_

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env perl
use warnings;
use strict;
use Data::Dumper;
sub get_form_data {
my ($self, %args) = @_;
unless ($args{to_utf8}) {
# If to_utf8 param required
return undef;
}
return {
test => "It works\n",
other => {
user => "admin",
pass => "admin"
}
};
}
######
my $data = main->get_form_data(
to_utf8 => 1,
);
unless ($data) {
print STDERR "Can't parse data\n";
}
print Dumper $data->{other} if $data->{other};
exit 0;