in reply to Re^2: Usage of 'my' in 'eval'
in thread Usage of 'my' in 'eval'

I don't think that qualifies as "abuse" of perl. A lot of perl code uses named parameters but doesn't validate what is passed very well. So the idea of eval "" was to avoid mentioning the names more than once, and you've settled for mentioning them twice now?

You may want to look at Params::Validate.

Replies are listed 'Best First'.
Re^4: Usage of 'my' in 'eval'
by Anonymous Monk on Jan 06, 2006 at 15:54 UTC

    It's that mentioning them twice that bother's me, since it's (a bit) error prone - due to copy and paste, a longer (or shorter) my (var1, var2, ...) list will not neccessarily be detected at once. Having had the possibility to localize them via
    eval
    , each and only each valid named parameter would have been declared and initialized correctly. Later mispellings of these variable names would be detected via use strict.

    Besides, now I ALSO got the feeling I should have looked at Params::Validate!
    ;-)

    I find it hard to get an decent overview over the CPAN modules, thus gave up at some point and probably reinvent the weel again and again...

    Thank you for your support!