[PerlChina] hashref return stuff

fayland fayland at gmail.com
Mon May 22 22:51:59 PDT 2006


#!/usr/bin/perl

my $error = &validate();

if ($error) {
    print 'error';
} else {
    print 'ok';
}

sub validate {
    my $error = { };
    return $error;
}

会输出 error. 怎么写比较好?

-- 
Fayland Lam // http://www.fayland.org/ 



More information about the China-pm mailing list