develooper Front page | perl.perl6.users | Postings from September 2022

Re: BEGIN {} question

Thread Previous | Thread Next
From:
ToddAndMargo via perl6-users
Date:
September 3, 2022 01:15
Subject:
Re: BEGIN {} question
Message ID:
02581d99-64bf-7622-3639-e7b85b2b5d47@zoho.com
On 9/2/22 13:52, ToddAndMargo via perl6-users wrote:
> On 9/2/22 00:13, ToddAndMargo via perl6-users wrote:
>> Found something interesting
>>
>> $ raku -c GetUpdates.pl6
>> Syntax OK
>>
>> Will execute the BEGIN {}, not just
>> syntax check it.
> 
> The guys on the chat line said this is normal
> as `BEGIN` runs a compile time
> 
> 

Hi All,

Thinking about it, I thought I did not bring
enough attention to the `-c` switch in the
above command line.  This runs a SYNTAX check
and stops at that.  It does not run the program.
I use the `-c` option extensively to debug my
typos before debugging my programs.

When I found BEGIN actually running when all
I wanted was a syntax check, I was perplexed.
My understanding was that -c only checked my
syntax, including my BEGIN block.

This is why I asked on the chat line. Bug
or suppose to be?  And the answer is that
is just turned out that way.  And that is
fine with me.

:-)

-T

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About