http://www.perlmonks.org?node_id=11132577


in reply to One liner with globs on Windows to parse .srt files

perl -MWin32::Autoglob?

  • Comment on Re: One liner with globs on Windows to parse .srt files

Replies are listed 'Best First'.
Re^2: One liner with globs on Windows to parse .srt files (update)
by LanX (Saint) on May 14, 2021 at 11:18 UTC
    Yeah, that's basically the same idea, but a bit longish for a one-liner, don't you think?

    Using INIT{@ARGV=<*inlined-glob-pattern*>} has less characters ...

    update

    hmm wait tho ...

    ... I could use the ENV-var PERL5OPT to always preload that module for all Perl scripts in the current cmd.exe :)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      Yeah, that's basically the same idea, but a bit longish for a one-liner, don't you think?

      Dunno, seemed like the most straightforward answer to your question - just copy Win32\Autoglob.pm to wglob.pm ;-)

      ("'-M5;@ARGV=<*.srt>' -e'...'" actually doesn't save any characters over "-e'BEGIN{@ARGV=<*.srt>}...'")

      Update: Regarding PERL5OPT, sure!

        > '-M5;@ARGV=<*.srt>'

        nice, I didn't know that trick to add "normal" code after the import; part of use 5 =)

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery