hurricup has asked for the wisdom of the Perl Monks concerning the following question:

I'm tired to excite with some perl basics i didn't know... But after i've started work on Camelcade I'm really ashamed...

Anyway. Today i've discovered that i can pass bareword package name as a function parameter. Can you imagine? :)

The question is: why the ... i see quoted package names everywhere?

Why

use parent qw(Foo Bar);
instead of
use parent Foo::,Bar::;
I suppose that it is some compatibility mode, but not sure...

Replies are listed 'Best First'.
Re: Quoting package names
by Anonymous Monk on May 26, 2015 at 21:40 UTC

    The question is: why the ... i see quoted package names everywhere?

    Because style is style and barewords have long been out of style

    also, :: require shifting whereas qw// doesn't (yes I know you used () )

      I'm just stupid again. This doesn't work with use strict. Sorry. :)

        Actually, it does work with strict. The trailing double colon is magical.

        However, "Foo" isn't longer than Foo:: and everyone knows what the former means, so there's usually not much point of writing the latter.