Re: Do I have to repeat this run?

2025-11-02 Thread ToddAndMargo via perl6-users
On Mon, Oct 27, 2025 at 6:39 AM ToddAndMargo via perl6-users [email protected] > wrote:


On 10/27/25 3:33 AM, ToddAndMargo via perl6-users wrote:
 > Hi All,
 >
 > my $proc = run(
 >$Impersonate,
 >"-L",
 >"-H", Q['User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64;
x64;
 > rv:109.0) Gecko/20100101 Firefox/117.0'],
 >"-H", Q['Accept: text/html,application/xhtml+xml,application/
 > xml;q=0.9,image/avif,image/webp,*/*;q=0.8'],
 >"-H", Q['Accept-Language: en-US,en;q=0.5'],
 >"-H", Q['Accept-Encoding: gzip, deflate, br'],
 >"-H", Q['Upgrade-Insecure-Requests: 1'],
 >"-H", Q['Sec-Fetch-Dest: document'],
 >"-H", Q['Sec-Fetch-Mode: navigate'],
 >"-H", Q['Sec-Fetch-Site: none'],
 >"-H", Q['Sec-Fetch-User: ?1'],
 >"-H", Q['TE: Trailers'],
 >"--http2",
 >"--compressed",
 >$URL,
 >:err,
 >:out
 >);
 >
 > There is a test to see if I want to add anything to the above
 > or not.  If I want to add anything, do I have to repeat all
 > of it or can I put a test in there somewhere?
 >
 > Many thanks,
 > -T


The add would be

   "-o",
   $FileName,

But only if the test says to do so



On 11/2/25 11:01 AM, yary wrote:

my @args = $Impersonate,
        "-L",
        "-H", Q['User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64;
rv:109.0) Gecko/20100101 Firefox/117.0'],
        "-H", Q['Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/ 
webp,*/*;q=0.8'],

        "-H", Q['Accept-Language: en-US,en;q=0.5'],
        "-H", Q['Accept-Encoding: gzip, deflate, br'],
        "-H", Q['Upgrade-Insecure-Requests: 1'],
        "-H", Q['Sec-Fetch-Dest: document'],
        "-H", Q['Sec-Fetch-Mode: navigate'],
        "-H", Q['Sec-Fetch-Site: none'],
        "-H", Q['Sec-Fetch-User: ?1'],
        "-H", Q['TE: Trailers'],
        "--http2",
        "--compressed",
        $URL;

my $proc = run(|@args, :err, :out)

# if test says you need to add args then

@args.push("-o", $FileName);
$proc = run(|@args, :err, :out)

-y




Elegant!  Thank you!


Re: Do I have to repeat this run?

2025-11-02 Thread yary
my @args = $Impersonate,
   "-L",
   "-H", Q['User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64;
rv:109.0) Gecko/20100101 Firefox/117.0'],
   "-H", Q['Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8'],
   "-H", Q['Accept-Language: en-US,en;q=0.5'],
   "-H", Q['Accept-Encoding: gzip, deflate, br'],
   "-H", Q['Upgrade-Insecure-Requests: 1'],
   "-H", Q['Sec-Fetch-Dest: document'],
   "-H", Q['Sec-Fetch-Mode: navigate'],
   "-H", Q['Sec-Fetch-Site: none'],
   "-H", Q['Sec-Fetch-User: ?1'],
   "-H", Q['TE: Trailers'],
   "--http2",
   "--compressed",
   $URL;

my $proc = run(|@args, :err, :out)

# if test says you need to add args then

@args.push("-o", $FileName);
$proc = run(|@args, :err, :out)

-y


On Mon, Oct 27, 2025 at 6:39 AM ToddAndMargo via perl6-users <
[email protected]> wrote:

> On 10/27/25 3:33 AM, ToddAndMargo via perl6-users wrote:
> > Hi All,
> >
> > my $proc = run(
> >$Impersonate,
> >"-L",
> >"-H", Q['User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64;
> > rv:109.0) Gecko/20100101 Firefox/117.0'],
> >"-H", Q['Accept: text/html,application/xhtml+xml,application/
> > xml;q=0.9,image/avif,image/webp,*/*;q=0.8'],
> >"-H", Q['Accept-Language: en-US,en;q=0.5'],
> >"-H", Q['Accept-Encoding: gzip, deflate, br'],
> >"-H", Q['Upgrade-Insecure-Requests: 1'],
> >"-H", Q['Sec-Fetch-Dest: document'],
> >"-H", Q['Sec-Fetch-Mode: navigate'],
> >"-H", Q['Sec-Fetch-Site: none'],
> >"-H", Q['Sec-Fetch-User: ?1'],
> >"-H", Q['TE: Trailers'],
> >"--http2",
> >"--compressed",
> >$URL,
> >:err,
> >:out
> >);
> >
> > There is a test to see if I want to add anything to the above
> > or not.  If I want to add anything, do I have to repeat all
> > of it or can I put a test in there somewhere?
> >
> > Many thanks,
> > -T
>
>
> The add would be
>
>   "-o",
>   $FileName,
>
> But only if the test says to do so
>


Re: Do I have to repeat this run?

2025-10-27 Thread ToddAndMargo via perl6-users

On 10/27/25 3:33 AM, ToddAndMargo via perl6-users wrote:

Hi All,

    my $proc = run(
   $Impersonate,
   "-L",
   "-H", Q['User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; 
rv:109.0) Gecko/20100101 Firefox/117.0'],
   "-H", Q['Accept: text/html,application/xhtml+xml,application/ 
xml;q=0.9,image/avif,image/webp,*/*;q=0.8'],

   "-H", Q['Accept-Language: en-US,en;q=0.5'],
   "-H", Q['Accept-Encoding: gzip, deflate, br'],
   "-H", Q['Upgrade-Insecure-Requests: 1'],
   "-H", Q['Sec-Fetch-Dest: document'],
   "-H", Q['Sec-Fetch-Mode: navigate'],
   "-H", Q['Sec-Fetch-Site: none'],
   "-H", Q['Sec-Fetch-User: ?1'],
   "-H", Q['TE: Trailers'],
   "--http2",
   "--compressed",
   $URL,
   :err,
   :out
   );

There is a test to see if I want to add anything to the above
or not.  If I want to add anything, do I have to repeat all
of it or can I put a test in there somewhere?

Many thanks,
-T



The add would be

 "-o",
 $FileName,

But only if the test says to do so