Author: techfox9

Perl passing hashes to functions ..

Thursday, October 9th, 2008 @ 10:06 pm


#!/usr/bin/perl -w
use strict;

sub showHash($)
  {
    my(%hashh) = %{$_[0]};

    my($temp);
    foreach $temp (keys(%hashh)) { print "$temp=" . $hashh{$temp} . "\n"; }
    print "\n";
  }

sub higherLevel($)
  {
    my(%hashh) = %{$_[0]};

    showHash(\%hashh);
  }

my %hash = ("1"=>"one","2"=>"two","3"=>"three");

higherLevel(\%hash);

Perl


 


Comments are closed.