#!/usr/local/bin/perl use strict; use warnings; #--------------------------------------------------------- print "Content-type: text/html; charset=utf-8\n\n"; print "\n"; print "\n"; print "CGIのテスト\n"; print "\n"; print "\n"; print "u------------------
\n"; my @list = (1..3); my %hash = (a=>1, b=>2, c=>3); &func(@list, %hash); print "===============
\n"; &func0( \@list, \%hash ); sub func{ my(@list, %hash) = @_; foreach my $key( @list ){ print "$key
\n"; } print "--------
\n"; foreach my $key( keys %hash ){ print "$key: $hash{$key} \n"; } } sub func0{ my ($list0, $hash0) = @_; print "-------list--------
\n"; foreach my $key( @{ $list0 } ){ print "$key
\n"; } print "-------hash--------
\n"; foreach my $key( keys % { $hash0 } ){ print "$key: $hash0->{$key}
\n"; } } print "d------------------
\n"; print "\n"; print "\n";