duckyd has asked for the wisdom of the Perl Monks concerning the following question:
rather thanuse Module::Foo; Module::Foo::do_something();
I prefer the latter in almost all cases. I think it avoids a lot of mostly unneccesary clutter.use Module::Foo qw/do_something/; do_something();
If the method is only used once in the module or script, then I can see a justification for the former syntax, and it does make it very clear where the function is coming from, but for the most part, I don't think it's worth the extra clutter.
I am curious what other folks think. Which syntax do you prefer, and why? I thought I'd seen something about this in perldoc perlstyle, but I can't find it - is there a community consensus?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: prefered syntax for using imported subs
by jeffa (Bishop) on Mar 09, 2006 at 02:11 UTC | |
|
Re: prefered syntax for using imported subs
by adrianh (Chancellor) on Mar 09, 2006 at 10:28 UTC |