in reply to one-liner yields unexpected result

-m-...?

Replies are listed 'Best First'.
Re^2: one-liner yields unexpected result
by plendid (Sexton) on Feb 13, 2012 at 19:10 UTC

    -m- tells Perl to load a specified module before running the program. In my case File::Find::Rule.

      Try to use -m instead of -m-. From the documentation (perldoc perlrun)
      If the first character after the -M or -m is a dash (-) then the 'use' is replaced with 'no'.
        no Module; actually loads the module, then calls unimport on it. Since the OP isn't using anything that depends on an import having run, it shouldn't matter whether no or use is used.
      -m- tells Perl to load a specified module before running the program.

      No, it should be -mFile::Find::Rule, not -m-Fi...


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

Re^2: one-liner yields unexpected result
by Anonymous Monk on Feb 13, 2012 at 21:07 UTC

    Its odd but it works :)

    $ perl -m-File::Find::Rule -e "foreach (0..93) {print File::Find::Rule +->new->file->in(qq(/.mnt.$_))}" $ perl -MO=Deparse -m-File::Find::Rule -e "foreach (0..93) {print File +::Find::Rule->new->file->in(qq(/.mnt.$_))}" use File::Find::Rule (); foreach $_ (0 .. 93) { print 'File::Find::Rule'->new->file->in("/.mnt.$_"); } -e syntax OK