Re: BEGIN {} question

2022-09-01 Thread Richard Hainsworth
On Wed, 31 Aug 2022, 00:59 ToddAndMargo via perl6-users, < perl6-users@perl.org> wrote: > On 8/30/22 13:34, Richard Hainsworth wrote: > > Hi Todd, > > > > > Since you continue for ever to complain about 'compile' time issues, > > "Stage parce" is specifically what I am whining about > > > rather

Re: BEGIN {} question

2022-09-01 Thread ToddAndMargo via perl6-users
On 9/1/22 00:45, Richard Hainsworth wrote: Work with Raku rather than expect it to be the same as Perl. Oh I intent too! I program in Top Down. Perl 5's subroutines are a nightmare. I ADORE Perl 6's subroutines. By saying above / below, this indicates a linear view of code at the same

Re: BEGIN {} question

2022-09-01 Thread ToddAndMargo via perl6-users
On 9/1/22 00:45, Richard Hainsworth wrote: Raku and Perl are two different languages in the same family. They evolved with different targets, perl to react quickly to internet requests, Raku to be a better programming language. This may not be the take the actual developers have, but it's what

sprintf and print question

2022-09-01 Thread ToddAndMargo via perl6-users
Hi All, Is there a cleaner way to do this? $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)' ande I want to print the first four letter s to STDOUT. -T

Re: sprintf and print question

2022-09-01 Thread Andinus via perl6-users
ToddAndMargo via perl6-users @ 2022-09-01 19:37 -07: > Is there a cleaner way to do this? > > $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)' > ande > > I want to print the first four letter s to STDOUT. You can use substr, | put "andefghi".substr(0, 4) ande

Re: sprintf and print question

2022-09-01 Thread Norman Gaywood
On Fri, 2 Sept 2022 at 12:37, ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > Is there a cleaner way to do this? > > $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)' > ande > > I want to print the first four letter s to STDOUT. > $ raku -e 'printf

Re: sprintf and print question

2022-09-01 Thread William Michels via perl6-users
Hi Todd, ~$ raku -e '(sprintf "%.4s", "andefghi" ).put;' ande ~$ raku -e 'put (sprintf "%.4s", "andefghi" );' ande If sprintf isn't a requirement, then: ~$ raku -e 'put substr("andefghi", 0..3);' ande HTH, Bill. On Thu, Sep 1, 2022 at 7:37 PM ToddAndMargo via perl6-users <

Re: BEGIN {} question

2022-09-01 Thread Andinus via perl6-users
ToddAndMargo via perl6-users @ 2022-09-01 10:30 -07: > On 9/1/22 00:45, Richard Hainsworth wrote: >> Treat the regexes as data for a program. Compile the program once. >> Run the regexes as often as you need. > > Please elucidate. That could save me boat loads > of time. You could take the