develooper Front page | perl.fwp | Postings from December 2001

A Quick Quiz

Thread Next
From:
David Wheeler
Date:
December 14, 2001 22:57
Subject:
A Quick Quiz
Message ID:
1008399486.1066.12.camel@mercury.kineticode.com
Given this script, what would you expect the output to be?

#!/usr/bin/perl -w

use strict;

my %hash = (Perm => 1);

my @keys = keys %hash;
print "Keys: @keys\n";
test();
@keys = keys %hash;
print "Keys: @keys\n";

sub test { local $hash{Temp} = 'UTC' }

__END__

Hint: IMO, this is rather bug-like.

Regards,

David

-- 
David Wheeler                                     AIM: dwTheory
David@Wheeler.net                                 ICQ: 15726394
                                               Yahoo!: dew7e
                                               Jabber: Theory@jabber.org


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About