Re: Hm. ItemFactory vs. gtk2-perl 0.90 ? :)



On Tue, 2003-07-22 at 15:46, Chas Owens wrote:

sub chas {
        my $entry = shift;
        my (
                $path,
                $accelerator,
                $callback,
                $callback_action,
                $item_type,
                $extra_data
        );

        for my $key (keys %$entry) {
                eval "\$$key = \$entry->{$key}";
                if ($@) {
                        carp("Gtk Item Factory Entry; unknown key ($key) "
                           . "ignored, legal keys are: path, "
                           . "accelerator, accel, callback, "
                           . "callback_action, item_type, extra_data");
                }
        }
}

that's almost exactly what i had coded up originally before i decided to
switch to the if based method. i just don't like the whole eval thing.
it just doesn't sit right with me.

-rm




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]