Jeff Pang wrote:
Noah:

sub exiting {
    my ($hostname, %login) = @_;

Passing arguments like this has no such problem.
But you'd better pass the hash as a reference to the subroutine.

exitint($hostname, \%login);

sub exiting {
    my $hostname = shift;
    my %login = %{+shift};

What is the point of passing a reference if you are just going to copy the whole hash anyway (which is what the OP was doing)?




John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity.               -- Damian Conway

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to