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

Re: BEGIN {} question

Thread Previous | Thread Next
ToddAndMargo via perl6-users
September 3, 2022 01:15
Re: BEGIN {} question
Message ID:
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.



Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About