in reply to Re: Reading output of external program without Shell
in thread Reading output of external program without Shell

Hi karlgoethebier. I tried in the past CAM::PDF; . In the future I may opt for it, but at the moment I think the quality of output of pdftotext (from xpdf) is unbeatable (but I'll run some more tests)

  • Comment on Re^2: Reading output of external program without Shell

Replies are listed 'Best First'.
Re^3: Reading output of external program without Shell
by karlgoethebier (Abbot) on Nov 15, 2017 at 19:08 UTC

    Thanks for your kind reply. BTW, as far as i vaguely remember this doesn't call a shell:

    #!/usr/bin/env perl use strict; use warnings; use IPC::Run qw( run ); use feature qw(say); my $command = q(cat); my $text = run qq($command $0); say $text; __END__

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      this doesn't call a shell

      The code you showed does, but if you give run an arrayref, it does not (at least on *NIX):

      $ perl -wMstrict -MIPC::Run=run -e' run "pstree -A $$" ' perl---sh---pstree $ perl -wMstrict -MIPC::Run=run -e' run ["pstree","-A",$$] ' perl---pstree
        "The code you showed does..."

        Ah, right. Thanks for correcting me. A precious hint.

        BTW, from the friendly manual:

        # Launch a sub process directly, no shell. Can't do redirection # with this form, it's here to behave like system() with an # inverted result. $r = run "cat a b c";

        Perhaps i missed something.

        "Es ist immer komplizierter" (Ludwig Marcuse)

        Still my favorite quote and motto.

        Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

        perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help