in reply to Re^2: when is "my" not necessary?
in thread when is "my" not necessary?

Use a hash and don't abuse globals just to pass arguments. to paraphrase your code:

#!/usr/bin/perl -w use strict; check(qw(a b c)); sub check { my %hash = ( a => 'here', b => 'present', c => 'me too', ); for (@_) { print "$hash{$_} has a value\n"; } }

Replies are listed 'Best First'.
Re^4: when is "my" not necessary?
by whillers (Initiate) on Nov 04, 2004 at 19:24 UTC
    Thanks... ephiphony moment. I'm convinced to use strict refs and eliminate any symbolic usage.

    package x actually is a static cache of prefs stored in a database refreshed only when those prefers are updated by a user.

    Doing my stunt (above), I'm now using a hash to store all form fields and simply checking presence using the x list for that preference.

    Thanks-Thanks.