Re: How do I call system functions?

2017-03-08 Thread ToddAndMargo
On Wed, Mar 8, 2017 at 5:51 AM, ToddAndMargo wrote: Hi All, In Linux, how do I call system functions from Perl 6? int XStoreBytes(Display *display, char *bytes, int nbytes); And what is that? "C"? Is there an inline "C" call? Many thanks, -T On 03/08/2017 06:51 A

Re: How do I call system functions?

2017-03-08 Thread ToddAndMargo
On 03/08/2017 06:51 AM, Will Coleda wrote: Perl 6 uses "NativeCall" to call out to native library functions. I would start with https://docs.perl6.org/language/nativecall and come back with specific questions. Oh poop I have a lot of reading to do. Found a great example over at: http://ro

Re: How do I call system functions?

2017-03-08 Thread ToddAndMargo
On 03/08/2017 10:04 AM, Brandon Allbery wrote: On Wed, Mar 8, 2017 at 1:00 PM, ToddAndMargo mailto:toddandma...@zoho.com>> wrote: On 03/08/2017 07:49 AM, Brandon Allbery wrote: On Wed, Mar 8, 2017 at 5:51 AM, ToddAndMargo mailto:toddandma...@zo

Re: How do I call system functions?

2017-03-08 Thread ToddAndMargo
On 03/08/2017 10:26 AM, Brandon Allbery wrote: On Wed, Mar 8, 2017 at 1:23 PM, ToddAndMargo mailto:toddandma...@zoho.com>> wrote: class Display is repr('CStruct') {} Class Display has no attributes, which is illegal with the CStruct representati

issues with

2017-03-08 Thread ToddAndMargo
Hi All, What is wrong with this? $ perl6 -MX11::Xlib::Raw -e 'say "hi";' ===SORRY!=== Could not find X11::Xlib::Raw::X at line 5 in: /home/tony/.perl6 /usr/share/perl6/site /usr/share/perl6/vendor /usr/share/perl6 CompUnit::Repository::AbsolutePath<68732640> CompUnit::Rep

My first inline code!

2017-03-08 Thread ToddAndMargo
Hi All, With the help of the guys over on the char line, I wrote my first inline code. Yippee!! I did not realize the name of the was was also the name of the line line c call. And I did not realize the call really did want an initialized variable as its parameter. #!/usr/bin/perl6 #`{

Re: issues with

2017-03-08 Thread ToddAndMargo
On 03/08/2017 01:08 PM, ToddAndMargo wrote: Hi All, What is wrong with this? $ perl6 -MX11::Xlib::Raw -e 'say "hi";' ===SORRY!=== Could not find X11::Xlib::Raw::X at line 5 in: /home/tony/.perl6 /usr/share/perl6/site /usr/share/perl6/vendor /usr/shar

Re: My first inline code!

2017-03-08 Thread ToddAndMargo
On 03/08/2017 02:58 PM, ToddAndMargo wrote: Hi All, With the help of the guys over on the char line, I wrote my first inline code. Yippee!! I did not realize the name of the was was also the name of the line line c call. And I did not realize the call really did want an initialized variable

Variables in modules

2017-03-08 Thread ToddAndMargo
Hi All, I want to set a global variable in a module that I want all "is export" sub's to see when called. INIT { ( my $IAm =~ $?FILE ) ~~ s|.*"/"|| }; Does not work. Is there a way to do this, or do I have to create $IAm inside each "is export" sub? Many thanks, -T -- ~

Re: Your thoughts on Padre?

2017-03-08 Thread ToddAndMargo
Hi All, The guys on the chat line told me to look at https://atom.io/ as it is specifically written for Perl 6 I tested it under "ssh -X". Oh boy it is SSSLLLOOOWWW. But if you are not using it remotely, it looks like a really sweet program for Perl 6. You can even create projects. Ove

Re: Variables in modules

2017-03-09 Thread ToddAndMargo
On 03/09/2017 03:58 AM, Timo Paulssen wrote: "my" variables are lexically scoped to the curly braces that contain them. That means that your $IAm is limited exactly to that init block. Also, =~ isn't in perl6. You can put "my $IAm" outside that block and assign to it inside the block, though. H

Re: issues with

2017-03-09 Thread ToddAndMargo
On 03/09/2017 04:00 AM, Timo Paulssen wrote: Hey, X11::Xlib::Raw is buggy. It has to have all modules it uses internally inside its "provides" section in the META6.json, otherwise "use" will not find them. I'll open a ticket with the module author. HTH - Timo Hi Timo, As long as Inlin

Re: Fwd: Re: Variables in modules

2017-03-10 Thread ToddAndMargo
On 03/10/2017 09:53 AM, Timo Paulssen wrote: I don't quite understand what's wrong with just my $TheValue = $?FILE.subst(/.* "/"/, "" :g); near the top of your module? Hi Timo, Because it gives you "Use of uninitialized value $TheValue" when you go to use it inside one of the "is export

Re: Fwd: Re: Variables in modules

2017-03-10 Thread ToddAndMargo
ToddAndMargo schreef op 2017-03-10 22:10: On 03/10/2017 09:53 AM, Timo Paulssen wrote: I don't quite understand what's wrong with just my $TheValue = $?FILE.subst(/.* "/"/, "" :g); near the top of your module? Hi Timo, Because it gives you "Use of

X11Clipboard.pm6

2017-03-10 Thread ToddAndMargo
Hi All, With the help if the guys on the chat, I wrote a nice X11 Clipboard module that will read and write to both X11 clipboards. And it uses "run" instead of "shell" so a terminal is not required when running it from a "launcher" http://vpaste.net/vprdG -T -- Yeste

Re: Fwd: Re: Variables in modules

2017-03-10 Thread ToddAndMargo
Hm. How does it do with "sub sayfn" commented out? On 03/10/2017 04:02 PM, Theo van den Heuvel wrote: > Todd, > > Apparently I don't understand your intentions. You said you wanted > constants globally available in your module. > Don't you want to use those constants? If so, how? > On

Re: Is there a list out there of all the \n characters?

2017-03-12 Thread ToddAndMargo
On 03/06/2017 02:14 AM, ToddAndMargo wrote: Hi All, Is there a list of all the \n pairs out there somewhere? Many thanks, -T Found it! https://docs.perl6.org/language/regexes#Backslashed,_predefined_character_classes -- ~~ Computers are like air

Re: Is there a list out there of all the \n characters?

2017-03-12 Thread ToddAndMargo
On 03/12/2017 03:32 PM, ToddAndMargo wrote: On 03/06/2017 02:14 AM, ToddAndMargo wrote: Hi All, Is there a list of all the \n pairs out there somewhere? Many thanks, -T Found it! https://docs.perl6.org/language/regexes#Backslashed,_predefined_character_classes This one helps too

I need help with pattern matching

2017-03-13 Thread ToddAndMargo
Hi All, What am I doing wrong here? $ perl6 -e 'my $x="abc\(123\)def"; $x ~~ m/(abc\))(123)(\(def)/; say "$x\n\$0=<$0> \$1=<$1> \$2=<$2>\n";' Use of Nil in string context in block at -e line 1 Use of Nil in string context in block at -e line 1 Use of Nil in string context in block

Re: I need help with pattern matching

2017-03-13 Thread ToddAndMargo
On 03/13/2017 01:16 AM, Elizabeth Mattijsen wrote: On 13 Mar 2017, at 08:27, ToddAndMargo wrote: Hi All, What am I doing wrong here? $ perl6 -e 'my $x="abc\(123\)def"; $x ~~ m/(abc\))(123)(\(def)/; say "$x\n\$0=<$0> \$1=<$1> \$2=<$2>\n";'

What to do when a pattern match fails

2017-03-13 Thread ToddAndMargo
Hi All, $ perl6 -e 'my $x="ab12cd"; $x ~~ m/ab(1q2)cd/; say "$x\n\$0=<$0>\n";' Use of Nil in string context in block at -e line 1 ab12cd $0=<> With out the "q" in this, it works. I deliberately put the "q" to see what would happen when a patter was not found. Is there a way around the "use of

preassigned names in pattern matches?

2017-03-13 Thread ToddAndMargo
Hi All, I adore this feature of loops: perl6 -e 'my @x=qw[a b z y]; for @x -> $a, $b { say "<$a> <$b>" };' because I can preassign a names to "$_". Question: in a pattern match such as: perl6 -e 'my $x="ab12cd"; $x ~~ m/(ab)(12)(cd)/; say "$x\n\$0=<$0>\t\$1=<$1>\t\$2=<$2>\n";'

Re: What to do when a pattern match fails

2017-03-13 Thread ToddAndMargo
On 03/13/2017 02:11 PM, Elizabeth Mattijsen wrote: On 13 Mar 2017, at 22:06, ToddAndMargo wrote: Hi All, $ perl6 -e 'my $x="ab12cd"; $x ~~ m/ab(1q2)cd/; say "$x\n\$0=<$0>\n";' Use of Nil in string context in block at -e line 1 ab12cd $0=<&g

Re: What to do when a pattern match fails

2017-03-13 Thread ToddAndMargo
On 03/13/2017 02:28 PM, Elizabeth Mattijsen wrote: On 13 Mar 2017, at 22:20, ToddAndMargo wrote: On 03/13/2017 02:11 PM, Elizabeth Mattijsen wrote: On 13 Mar 2017, at 22:06, ToddAndMargo wrote: Hi All, $ perl6 -e 'my $x="ab12cd"; $x ~~ m/ab(1q2)cd/; say "$x\n\$0=<

Re: Fwd: Re: Variables in modules

2017-03-13 Thread ToddAndMargo
On March 10, 2017 10:32:43 PM Theo van den Heuvel wrote: Not with me it doesn't. my $TheValue = $?FILE.subst(/.* "/"/, "", :g); sub sayfn is export { $TheValue.say } Could something else be wrong here? cheers, Theo ToddAndMargo schreef op 2017-03-10 22:10: On

Re: What to do when a pattern match fails

2017-03-13 Thread ToddAndMargo
On 03/13/2017 04:03 PM, yary wrote: On Mon, Mar 13, 2017 at 6:16 PM, ToddAndMargo mailto:toddandma...@zoho.com>> wrote: So if it only catches some of them, it will still return false? There is no catching some of them- either the pattern matches and all are caught, or the pattern

Re: What to do when a pattern match fails

2017-03-13 Thread ToddAndMargo
On 03/13/2017 02:06 PM, ToddAndMargo wrote: Hi All, $ perl6 -e 'my $x="ab12cd"; $x ~~ m/ab(1q2)cd/; say "$x\n\$0=<$0>\n";' Use of Nil in string context in block at -e line 1 ab12cd $0=<> With out the "q" in this, it works. I deliberately pu

Re: What to do when a pattern match fails

2017-03-13 Thread ToddAndMargo
On 03/13/2017 04:12 PM, ToddAndMargo wrote: On 03/13/2017 02:06 PM, ToddAndMargo wrote: Hi All, $ perl6 -e 'my $x="ab12cd"; $x ~~ m/ab(1q2)cd/; say "$x\n\$0=<$0>\n";' Use of Nil in string context in block at -e line 1 ab12cd $0=<> With out the &quo

Need help with a match

2017-03-13 Thread ToddAndMargo
Hi All, Just as soon as I think I understand it, a little humility fall into my lap! #!/usr/bin/perl6 my $x='sub Test () { #`(Sub|63218616) ... }'; $x ~~ m/sub (.*) \(/; say "$x\n$1"; $ WhoTest2.pl6 Use of Nil in string context in block at ./WhoTest2.pl6 line 4 sub Test () { #`(Sub|632186

Re: Need help with a match

2017-03-13 Thread ToddAndMargo
On 03/13/2017 07:58 PM, Brandon Allbery wrote: There is actually a third issue in that spaces are *ignored* in regexes, so you actually end up with $/[0] eq ' Test'. Use the <.ws> rule to avoid this. (The leading dot prevents that whitespace from additionally being captured as $/ which here would

Re: Need help with a match

2017-03-13 Thread ToddAndMargo
On 03/13/2017 07:53 PM, yary wrote: I think p6 regexes behave a bit like p5 regexes with the "x" flag turned on, where whitespace can be added in for readability. To have literal whitespace, put quotes around it. Like this (untested) $x ~~ m/sub ' ' (.*) ' ' \(/; Now that was way to easy and

Re: Need help with a match

2017-03-13 Thread ToddAndMargo
On 03/13/2017 08:16 PM, ToddAndMargo wrote: On 03/13/2017 07:53 PM, yary wrote: I think p6 regexes behave a bit like p5 regexes with the "x" flag turned on, where whitespace can be added in for readability. To have literal whitespace, put quotes around it. Like this (untested) $

more match humility

2017-03-13 Thread ToddAndMargo
What am I doing wrong now !?!?! :'( :'( :'( #!/usr/bin/perl6 sub Test () { my $f = $?FILE; say "\$\?FILE=<$f>"; my $g = $?FILE.IO.basename; say "\$\?FILE.IO.basename=<$g>"; ( my $IAm = $?FILE ) ~~ s|.*"/"||; say "Regex \$IAm=<$IAm>"; # sub Test () { #`(Sub|58588296) ... }

Re: more match humility

2017-03-13 Thread ToddAndMargo
On 03/13/2017 09:16 PM, ToddAndMargo wrote: What am I doing wrong now !?!?! :'( :'( :'( #!/usr/bin/perl6 sub Test () { my $f = $?FILE; say "\$\?FILE=<$f>"; my $g = $?FILE.IO.basename; say "\$\?FILE.IO.basename=<$g>"; ( my $IAm

Re: more match humility

2017-03-13 Thread ToddAndMargo
On 03/13/2017 10:20 PM, Brandon Allbery wrote: Just to be a little more clear about what is happening here: Perl 5 tended to treat things as strings if you use them as strings, or as numbers if you use them as numbers. Perl 6 is more strict about that, but makes an exception for specifically num

Re: more match humility

2017-03-14 Thread ToddAndMargo
On 03/14/2017 12:02 AM, Brent Laabs wrote: I'm not sure what you mean by lexiconical. I can't find any references to it in the official perl documentation (which would technically be lexicanonical, right?). The joke was that everything you did not understand was lexiconical. But if you're ta

Re: preassigned names in pattern matches?

2017-03-14 Thread ToddAndMargo
On 03/14/2017 01:51 AM, Elizabeth Mattijsen wrote: On 14 Mar 2017, at 02:04, ToddAndMargo wrote: On 03/13/2017 02:21 PM, Elizabeth Mattijsen wrote: On 13 Mar 2017, at 22:17, ToddAndMargo wrote: I adore this feature of loops: perl6 -e 'my @x=qw[a b z y]; for @x -> $a, $b { say &

my command line notes:

2017-03-14 Thread ToddAndMargo
Hi All, I wrote myself a little demonstration program on reading elements from the command line. I thought it might be useful to others (DuckDuckGo is a bust on Perl 6 and the command line): -T Perl 6: command line parameters: #!/usr/bin/perl6 if not @*ARGS.elems > 0 { say "command line is

Re: my command line notes:

2017-03-14 Thread ToddAndMargo
On 03/14/2017 01:26 PM, Will Coleda wrote: FYI https://docs.perl6.org/language/functions#index-entry-MAIN Thank you!

Re: my command line notes:

2017-03-14 Thread ToddAndMargo
On 03/14/2017 01:37 PM, ToddAndMargo wrote: On 03/14/2017 01:26 PM, Will Coleda wrote: FYI https://docs.perl6.org/language/functions#index-entry-MAIN Thank you! So far, I haven't gotten to creative: my $DebugFlag = @*ARGS.elems; # generate a crash report if > 0

Any directions for email attachments out there?

2017-03-16 Thread ToddAndMargo
Hi All, I need to attach a tar ball to an eMail. I know how to send a simple test eMail with Net::SMTP. Apparently, I have to MIME64 encode the stinker and figure out on my own what the headers and trailers are. Then use Net::SMTP's "data" function to attach the stinker. Be nice if there were

Re: my command line notes:

2017-03-16 Thread ToddAndMargo
On 03/15/2017 10:04 AM, Timo Paulssen wrote: On 14/03/17 20:58, ToddAndMargo wrote: #!/usr/bin/perl6 if not @*ARGS.elems > 0 { say "command line is empty"; exit 0; } say "\@\*ARGS has " ~ @*ARGS.elems ~ " elements"; say " \@\*ARGS = <&qu

RFE: throw an error on a single "="when used in an "if"

2017-03-18 Thread ToddAndMargo
Dear Perl 6 Developers, Request for Enhancement: Would you consider throwing a compiler error on the following: perl6 -e 'my $x=2;my $y=3; if $x = $y {say "yes";} else {say "no";}' yes It should have two == signs if it is followed by a {do something} This is the correct way: $ perl6 -e 'my

How do I remove N elements

2017-03-20 Thread ToddAndMargo
from the beginning of an array? I know about shift, but that is one at a time. I suppose I could do a loo[, but it would be nice to do it all at once. Many thanks, -T

Re: How do I remove N elements

2017-03-21 Thread ToddAndMargo
On 03/20/2017 11:18 PM, Norman Gaywood wrote: On 21 March 2017 at 15:39, ToddAndMargo mailto:toddandma...@zoho.com>> wrote: from the beginning of an array? untested but same as perl5: splice @list, 0, $N; https://docs.perl6.org/routine/splice <https://docs.perl6.org/routi

Question for the developers on splice

2017-03-21 Thread ToddAndMargo
Dear Developers, on this command: perl6 -e 'my @foo = ; @foo.splice(0,3); say @foo;' Are you actually moving one set up data into another set's element/slot/index, or are you just rearranging the pointers to each element? Many thanks, -T -- ~~~ Having been erased, Th

Is this file check backwards?

2017-03-21 Thread ToddAndMargo
https://docs.perl6.org/language/io.html From the above manual, the example to check if a file exists: if "nonexistent_file".IO.e { say "file exists"; } else { say "file doesn't exist"; } Sound backwards to me. What am I missing? Many thanks, -T -- ~ I

Re: Question for the developers on splice

2017-03-21 Thread ToddAndMargo
On 03/21/2017 02:14 AM, Elizabeth Mattijsen wrote: On 21 Mar 2017, at 10:00, ToddAndMargo wrote: on this command: perl6 -e 'my @foo = ; @foo.splice(0,3); say @foo;' Are you actually moving one set up data into another set's element/slot/index, or are you just rearranging the p

How to I create a file?

2017-03-21 Thread ToddAndMargo
Hi All, How to I do this bash code in Perl 6? if [ ! -f "$PathAndName" ]; then touch "$PathAndName" fi I am not finding the directions on how to create a "new" file at a specific location. Many thanks, -T -- ~~ Computers are like air conditioners. They mal

Re: Is this file check backwards?

2017-03-21 Thread ToddAndMargo
On Tue, 21 Mar 2017 at 09:53 ToddAndMargo mailto:toddandma...@zoho.com>> wrote: https://docs.perl6.org/language/io.html From the above manual, the example to check if a file exists: if "nonexistent_file".IO.e { say "file exists"; }

Re: How to I create a file?

2017-03-21 Thread ToddAndMargo
On Tue, Mar 21, 2017 at 3:01 AM, ToddAndMargo mailto:toddandma...@zoho.com>> wrote: Hi All, How to I do this bash code in Perl 6? if [ ! -f "$PathAndName" ]; then touch "$PathAndName" fi I am not finding the directions on how to create a "new&q

Re: How to I create a file?

2017-03-21 Thread ToddAndMargo
On 03/21/2017 03:07 AM, Brent Laabs wrote: You can create a file by opening a filehandle for writing. $PathAndName.IO.f or $PathAndName.IO.open(:w).close; What does the .f do? -- ~~ Computers are like air conditioners. They malfunction when you open win

Re: How to I create a file?

2017-03-21 Thread ToddAndMargo
On 03/21/2017 03:50 AM, Simon Proctor wrote: .e checks a path exists. .f checks it exists AND is a file. .d checks it exists AND is a directory. (Perl 5 was the -e, -f and -d tests) Beautiful explanation! Thank you! Perl 5 has the (about) same test as bash and I write a lot in that too. (I

Re: How to I create a file?

2017-03-21 Thread ToddAndMargo
On 03/21/2017 03:07 AM, Brent Laabs wrote: $PathAndName.IO.f or $PathAndName.IO.open(:w).close; Is that a coding "or" or an English "or"? -- ~~ Computers are like air conditioners. They malfunction when you open windows

Re: How to I create a file?

2017-03-21 Thread ToddAndMargo
On 03/21/2017 04:02 AM, Simon Proctor wrote: It's a logical test but I'd probably use || instead. Thank you!

maintainability and "or"

2017-03-21 Thread ToddAndMargo
Hi All, This is just one of those chatter posts. To me, the holy grail of coding is maintainability, which is why I code in Top Down. Code like below get my goat because I have to look at it several times before I realize what is going on $Name.IO.f or $Name.IO.open(:w).close; Basically the a

Re: How to I create a file?

2017-03-21 Thread ToddAndMargo
On 03/21/2017 04:27 AM, Philip Hazelden wrote: $PathAndName.IO.f or $PathAndName.IO.open(:w).close; Note, the following sequence is possible: 1. .IO.f returns false 2. Someone creates the file and writes some data to it 3. .IO.open truncates the file Thus, this has a chance of editing the file

Re: Question for the developers on splice

2017-03-21 Thread ToddAndMargo
On 03/21/2017 05:05 AM, Timo Paulssen wrote: Shifting from the front will just move the "beginning" pointer one slot forwards, and popping will decrease the "element count" number. I'm not sure if splice with an empty "insertion" list that happens to be at the end will also just reduce the numbe

Re: Question for the developers on splice

2017-03-21 Thread ToddAndMargo
On 03/21/2017 08:10 AM, Parrot Raiser wrote: "Premature optimisation is the root of many evils", or words to that effect. (I forget who said it, but I think it was someone credible.) Write your code as clearly and simply as you can, then see if it performs adequately under load. If it does, you'

Re: maintainability and "or"

2017-03-21 Thread ToddAndMargo
On 03/21/2017 04:50 AM, Elizabeth Mattijsen wrote: $PathAndName.IO.open(:w).close unless $PathAndName.IO.f; Hi Liz, Now that is elegant! Thank you! -T -- ~~ Computers are like air conditioners. They malfunction when you open windows ~~~

Re: maintainability and "or"

2017-03-21 Thread ToddAndMargo
On 03/21/2017 11:25 AM, Brandon Allbery wrote: people comparing perl 5 speed to perl 6 should take note: perl 5 used to be slow too If you wanted "speed", code in C or assembly. I am after rapid development. Perl 6 is perfect. -- ~~ Computers are like air

Re: maintainability and "or"

2017-03-21 Thread ToddAndMargo
Thank you all for the wonderful training and feedback!

File::Copy ??

2017-03-21 Thread ToddAndMargo
Hi All, Do we have anything like http://perldoc.perl.org/File/Copy.html under another name? Nothing showed up in https://modules.perl6.org/#q=file%3A%3A Many thanks, -T -- Yesterday it worked. Today it is not working. Windows is like that. ~~

Am I suppose to be able to change a variable's type on the fly?

2017-03-21 Thread ToddAndMargo
Hi All, Yes, I know, Perl is "lexiconical". $ perl6 -e 'my $x="abc"; $x=1E23; print "$x\n";' 1e+23 $ perl6 -e 'my Str $x="abc"; $x=1E23; print "$x\n";' Type check failed in assignment to $x; expected Str but got Num (1e+23) in block at -e line 1 So, unless I specifically declare a variable as

Re: File::Copy ??

2017-03-21 Thread ToddAndMargo
> On Wed, Mar 22, 2017 at 12:24 AM, ToddAndMargo wrote: >> Hi All, >> >> Do we have anything like >> >> http://perldoc.perl.org/File/Copy.html >> >> under another name? >> >> Nothing showed up in >>https://modules.perl6.org/#q

Re: Am I suppose to be able to change a variable's type on the fly?

2017-03-21 Thread ToddAndMargo
> On Wed, Mar 22, 2017 at 12:59 AM, ToddAndMargo wrote: >> Hi All, >> >> Yes, I know, Perl is "lexiconical". >> >> $ perl6 -e 'my $x="abc"; $x=1E23; print "$x\n";' >> 1e+23 >> >> $ perl6 -e 'my Str

Can this OR be shortened?

2017-03-24 Thread ToddAndMargo
Hi All,, if $Terminal ~~ /xterm/ || /linux/ {} does not work But this does if $Terminal ~~ /xterm/ || $Terminal ~~ /linux/ {} Can the if statement be shortened such that I do not have to repeat $Terminal? Many thanks, -T -- ~~ Computers are like air condit

Re: Can this OR be shortened?

2017-03-24 Thread ToddAndMargo
On 03/24/2017 06:14 PM, Brandon Allbery wrote: On Fri, Mar 24, 2017 at 8:58 PM, ToddAndMargo mailto:toddandma...@zoho.com>> wrote: if $Terminal ~~ /xterm/ || /linux/ {} if $Terminal ~~ /xterm || linux/ {} Perfect! Thank you! I keep forgetting spaces are ignored in regex's

tip on using /etc/crontab

2017-03-24 Thread ToddAndMargo
Hi All, Fedora Core 25 (Linux) I just found out the hard way that if us use use Inline::Perl5; use Email::Simple:from; your program will run from the command line, but when run from /etc/crontab, your program will just disappear. Mind you I actually did not use this code, I just had

Re: Can this OR be shortened?

2017-03-24 Thread ToddAndMargo
On 03/24/2017 08:36 PM, Timo Paulssen wrote: I seem to recall you asked about performance recently the regex engine has a significant overhead. Your regex is equivalent to $Terminal.contains('xterm' | 'linux') though of course if you only test this once at the beginning of the program, you

Re: Can this OR be shortened?

2017-03-24 Thread ToddAndMargo
On 03/24/2017 07:45 PM, Brad Gilbert wrote: All of these should work if $Terminal ~~ /xterm/ | /linux/ {} if $Terminal ~~ /xterm | linux/ {} if $Terminal ~~ /xterm || linux/ {} Note that | in a regex tries both sides as if in parallel, and goes for the longest, Hi Brad, What do y

"not" question

2017-03-27 Thread ToddAndMargo
Hi All, What am I doing wrong in my "AND not 789"? $ perl6 -e 'my $x="abc123def456"; my $y="123"; if $x.contains( $y & "abc" & ! "789" ) {say "Yes"} else {say "no"};' no -T -- ~~ Computers are like air conditioners. They malfunction

regex and performance question

2017-03-27 Thread ToddAndMargo
Hi All, When I do a if $x.contains( $y & "abc" ) Am I reintroducing a "regex" and losing the performance gained by avoiding a regex? Doesn't look like it to me, but I thought I'd better double check. Many thanks, -T -- ~~ Computers are like air condi

Re: "not" question

2017-03-27 Thread ToddAndMargo
On 27/03/17 18:53, ToddAndMargo wrote: Hi All, What am I doing wrong in my "AND not 789"? $ perl6 -e 'my $x="abc123def456"; my $y="123"; if $x.contains( $y & "abc" & ! "789" ) {say "Yes"} else {sa

Re: "not" question

2017-03-27 Thread ToddAndMargo
On 27/03/17 19:11, Timo Paulssen wrote: !"789" is just False. On 27/03/17 18:53, ToddAndMargo wrote: Hi All, What am I doing wrong in my "AND not 789"? $ perl6 -e 'my $x="abc123def456"; my $y="123"; if $x.contains( $y & "

Re: "not" question

2017-03-27 Thread ToddAndMargo
On 03/27/2017 10:36 AM, Timo Paulssen wrote: On 27/03/17 19:26, ToddAndMargo wrote: and `none("789")` is the opposite of `contains`? Nah, the fact that anything in the junction means "contains" is just because you're feeding the junction through the contains met

Re: regex and performance question

2017-03-27 Thread ToddAndMargo
On 03/27/2017 10:43 AM, Brandon Allbery wrote: On Mon, Mar 27, 2017 at 1:10 PM, ToddAndMargo mailto:toddandma...@zoho.com>> wrote: Am I reintroducing a "regex" It's a junction, not a regex. But junctions are even slower than regexes: they are, in effect, trying

What module do I use to create a "windows"?

2017-03-27 Thread ToddAndMargo
Hi All, RHEL 7.2 and Fedora 25. I would like to create a window that presents the user with a dynamically generated list for him to choose from, along with a "next" and a "cancel" button. What module do I use to create this? Many thanks, -T -- Yesterday it worked. To

Re: What module do I use to create a "windows"?

2017-03-27 Thread ToddAndMargo
On 27/03/17 20:52, ToddAndMargo wrote: Hi All, RHEL 7.2 and Fedora 25. I would like to create a window that presents the user with a dynamically generated list for him to choose from, along with a "next" and a "cancel" button. What module do I use to create this? Many

Re: What module do I use to create a "windows"?

2017-03-27 Thread ToddAndMargo
On 03/27/2017 12:25 PM, ToddAndMargo wrote: On 27/03/17 20:52, ToddAndMargo wrote: Hi All, RHEL 7.2 and Fedora 25. I would like to create a window that presents the user with a dynamically generated list for him to choose from, along with a "next" and a "cancel" button.

trivia question on zef

2017-03-27 Thread ToddAndMargo
Hi All, I do prefer Zef over Panda. Trivia question; the stuff I see happening at the beginning of a zef install, what is that? Perhaps a "C" compiler? -T -- ~ I am Windows I am the Blue Screen of Death No one hears your screams ~

gtk::simple progress bar?

2017-03-27 Thread ToddAndMargo
Hi All, Can GTK::Simple do a progress bar? Not seeing an example here: https://github.com/perl6/gtk-simple/tree/master/examples -T -- ~~ Computers are like air conditioners. They malfunction when you open windows ~~

Re: gtk::simple progress bar?

2017-03-27 Thread ToddAndMargo
On 03/27/2017 12:46 PM, Timo Paulssen wrote: On 03/27/2017 09:40 PM, ToddAndMargo wrote: Hi All, Can GTK::Simple do a progress bar? Not seeing an example here: https://github.com/perl6/gtk-simple/tree/master/examples -T It's not documented, but it's implemented: https://github

Re: gtk::simple progress bar?

2017-03-27 Thread ToddAndMargo
On 03/27/2017 12:46 PM, Timo Paulssen wrote: On 03/27/2017 09:40 PM, ToddAndMargo wrote: Hi All, Can GTK::Simple do a progress bar? Not seeing an example here: https://github.com/perl6/gtk-simple/tree/master/examples -T It's not documented, but it's implemented: https://github

Re: tip on using /etc/crontab

2017-03-27 Thread ToddAndMargo
On 03/24/2017 06:56 PM, ToddAndMargo wrote: Hi All, Fedora Core 25 (Linux) I just found out the hard way that if us use use Inline::Perl5; use Email::Simple:from; your program will run from the command line, but when run from /etc/crontab, your program will just disappear. Mind

RFE: doc upgrade on "last"

2017-03-27 Thread ToddAndMargo
Dear Developers: I got caught by the meaning of `last`. Although the documentation is clear, I would like to make it a little clearer. Sort of pound the nail on the head a little. https://docs.perl6.org/syntax/last Current: The last command immediately exits the loop in question. Suggested

Re: What module do I use to create a "windows"?

2017-03-27 Thread ToddAndMargo
On 03/27/2017 12:40 PM, Timo Paulssen wrote: On 03/27/2017 09:25 PM, ToddAndMargo wrote: Hi Timo, Thank you! Just out of curiosity -- I don't need it now -- is there a similar module for Windows? -T GTK::Simple is already portable across linux, mac os, and windows. Here's s

does `copy` have a recursive option?

2017-03-27 Thread ToddAndMargo
Hi All, Looking at https://docs.perl6.org/routine/copy It does not look like there is a `recursive` option. It that correct? Any work arounds? If not, I have already written a recursive delete on an FTP server that could be easily adapted to "copy". (The sub does a directory loop, if it

#!/usr/bin/perl6

2017-03-31 Thread ToddAndMargo
Hi All, Scientific Linux 7.3 (RHEL clone) I just came out of a panic with EPEL and their release update of Rakudo. Hosed the hole thing. Total mess. Anyway, thanks to the guys at the IRC channel, after a lot of uninstalling and erasing, I am now on https://github.com/nxadm/rakudo-pkg/rele

Re: #!/usr/bin/perl6

2017-04-01 Thread ToddAndMargo
On 04/01/2017 03:52 AM, Francis (Grizzly) Smit wrote: #!/usr/bin/env perl6 is probably better let /usr/bin/env find the path to perl6 What do you mean?

Re: #!/usr/bin/perl6

2017-04-01 Thread ToddAndMargo
On 04/01/2017 03:58 AM, Tom Browder wrote: On Sat, Apr 1, 2017 at 01:16 ToddAndMargo mailto:toddandma...@zoho.com>> wrote: Hi All, and all my Linux Perl6 programs start with #!/usr/bin/perl6 Modern practice for most Linux practicitioners I think is to use this sheban

Re: #!/usr/bin/perl6

2017-04-01 Thread ToddAndMargo
On 04/01/2017 03:01 PM, ToddAndMargo wrote: On 04/01/2017 03:52 AM, Francis (Grizzly) Smit wrote: #!/usr/bin/env perl6 is probably better let /usr/bin/env find the path to perl6 What do you mean? Never mind. Figured it out. :-) -- ~~ Computers are

Re: #!/usr/bin/perl6

2017-04-01 Thread ToddAndMargo
On 04/01/2017 03:05 PM, Brandon Allbery wrote: On Sat, Apr 1, 2017 at 6:01 PM, ToddAndMargo mailto:toddandma...@zoho.com>> wrote: On 04/01/2017 03:52 AM, Francis (Grizzly) Smit wrote: #!/usr/bin/env perl6 is probably better let /usr/bin/env find the path to

Re: How to limit the list of imported functions?

2017-04-07 Thread ToddAndMargo
On 04/07/2017 07:21 AM, Gabor Szabo wrote: In perl 5 we can limit which functions are imported by listing them after the name of the module: use Module ('foo', 'bar'); When I try the same in Rakudo I get "no EXPORT sub, but you provided positional argument in the 'use' statement" At least in

Re: How to limit the list of imported functions?

2017-04-07 Thread ToddAndMargo
On 04/07/2017 10:31 PM, Gabor Szabo wrote: strict function redeclaration prevention Cool feature! Many thanks, -T -- ~ When we ask for advice, we are usually looking for an accomplice. -- Charles Varlet de La Grange ~~~

Need "contains" help

2017-05-02 Thread ToddAndMargo
Hi All, Why does this work $ perl6 -e 'my $x="abcdef"; if $x.contains( "abc" ) { say "yes" } else { say "no" };' yes And this does not? $ perl6 -e 'my $x="abcdef"; if $x.contains( 'abc' ) { say "yes" } else { say "no" };' ===SORRY!=== Error while compiling -e Undeclared routine: abc u

Re: Need "contains" help

2017-05-02 Thread ToddAndMargo
On 05/02/2017 10:02 PM, Shrivats wrote: Careful :-) You're actually closing the single quote you​started with perl6 -e. In other words, this is your Shell's doing. You can execute this as a script with single quote around string literals with no issues Streetcars Mumble. And I did know that

Re: Need "contains" help

2017-05-02 Thread ToddAndMargo
On 05/02/2017 10:02 PM, Shrivats wrote: Careful :-) You're actually closing the single quote you​started with perl6 -e. In other words, this is your Shell's doing. You can execute this as a script with single quote around string literals with no issues Streetcars Mumble. I did know that. T

Re: Announce: Rakudo Star Release 2017.04

2017-05-02 Thread ToddAndMargo
On 05/01/2017 08:29 AM, Steve Mynott wrote: A useful and usable production distribution of Perl 6 I posted the following RFE: Would you please compile RPM's up for 2017.04: https://github.com/nxadm/rakudo-pkg/issues/11

net::smtp went missing

2017-05-17 Thread ToddAndMargo
Hi All, Fedora Code 25 # rpm -qa rak\* rakudo-0.2017.04.2-2.fc25.x86_64 # perl6 --version This is Rakudo version 2017.04.2 built on MoarVM version 2017.04 implementing Perl 6.c. One of my programs suddenly stop working with the following error message: Could not find Net::SMTP at line 58 in:

<    1   2   3   4   5   6   7   8   9   10   >