Re: program/script question

2017-03-07 Thread Brandon Allbery
On Tue, Mar 7, 2017 at 4:44 AM, Luca Ferrari wrote: > Usually a script is something that is not compiled, rather interpreted > on the fly (where "interpreted" could include any sort of JIT or alike > compilation). > This is one of those things where the ground has shifted

Re: program/script question

2017-03-07 Thread Luca Ferrari
On Sun, Mar 5, 2017 at 4:23 AM, ToddAndMargo wrote: > Hi All, > > This is one of those really dumb questions, but can I call > what I write in Perl a "program" or a "script"? Or, does > it even matter? > My point of view is it does not matter. Usually a script is

Re: program/script question

2017-03-07 Thread ToddAndMargo
On 03/06/2017 09:46 AM, Parrot Raiser wrote: This is an "angels dancing on the head of a pin" sort of question. "Program" is about purpose, "script" is about form. Any set of instructions (even a single one), given to a computer , can be considered a program. (If

Re: program/script question

2017-03-04 Thread Brandon Allbery
On Sat, Mar 4, 2017 at 10:23 PM, ToddAndMargo wrote: > This is one of those really dumb questions, but can I call > what I write in Perl a "program" or a "script"? Or, does > it even matter? > These days it doesn't really matter. The line was already significantly

program/script question

2017-03-04 Thread ToddAndMargo
Hi All, This is one of those really dumb questions, but can I call what I write in Perl a "program" or a "script"? Or, does it even matter? Many thanks, -T -- Yesterday it worked. Today it is not working. Windows is like that.

Re: embedded sub question

2017-03-04 Thread ToddAndMargo
On 03/04/2017 06:27 PM, Brandon Allbery wrote: On Sat, Mar 4, 2017 at 9:22 PM, ToddAndMargo > wrote: I am coming frrom Modula2 here. I M2 (using Perl syntax), sub A () { sub B () { }} B can only be seen

Re: embedded sub question

2017-03-04 Thread Brandon Allbery
On Sat, Mar 4, 2017 at 9:22 PM, ToddAndMargo wrote: > I am coming frrom Modula2 here. > > I M2 (using Perl syntax), > >sub A () { > sub B () { >}} > > B can only be seen inside A. Outside of A, B is > invisible. > > What are the rules for embedded subs in

embedded sub question

2017-03-04 Thread ToddAndMargo
Hi All, I am coming frrom Modula2 here. I M2 (using Perl syntax), sub A () { sub B () { }} B can only be seen inside A. Outside of A, B is invisible. What are the rules for embedded subs in Perl 6? Many thanks, -T -- ~~ Computers are like

Re: Inline::Perl5 "run" question

2017-03-04 Thread ToddAndMargo
On 03/04/2017 12:52 AM, ToddAndMargo wrote: Hi All, In the following code, how do I get access to the Perl 6 variables inside the Perl 5 code? #!/usr/bin/perl6 use Inline::Perl5; my $p6str = "string from Perl 6"; my $perl5 = Inline::Perl5.new(); $perl5.run(' print $p6str . "\n\n"; ');

Inline::Perl5 "run" question

2017-03-04 Thread ToddAndMargo
Hi All, In the following code, how do I get access to the Perl 6 variables inside the Perl 5 code? #!/usr/bin/perl6 use Inline::Perl5; my $p6str = "string from Perl 6"; my $perl5 = Inline::Perl5.new(); $perl5.run(' print $p6str . "\n\n"; '); Many thanks, -T --

Re: pod question

2017-03-01 Thread mt1957
On 03/01/2017 03:50 PM, Will Coleda wrote: Not true, '=for' is part of POD6. See below. If you're getting errors, it's helpful to reduce the example to a reasonably small bit of code that duplicates the same error; either you'll realize the issue as you remove unrelated bits of code, or you'll

pod question

2017-03-01 Thread mt1957
Hi, Is it true that the '=for' is taken out of the pod language? I get errors when I use it. It should take the line and the next lines as a block. I've also seen that it has the same effect now when I don't use it. Regards, Marcel

Re: pod question

2017-03-01 Thread Will Coleda
Not true, '=for' is part of POD6. See below. If you're getting errors, it's helpful to reduce the example to a reasonably small bit of code that duplicates the same error; either you'll realize the issue as you remove unrelated bits of code, or you'll end up with an example that epitomizes the

Re: for loop index question

2017-03-01 Thread Todd Chester
On 02/28/2017 11:06 PM, Andrew Kirkpatrick wrote: The zip operator in this case takes two sequences and interleaves them into a single sequence. It might be useful if you have handy or can generate a list of keys and a list of values you want to put together in pairs using => to create a hash

Re: for loop index question

2017-03-01 Thread Todd Chester
On 03/01/2017 12:45 AM, Richard Hainsworth wrote: Todd, As Andrew explained Z takes two arrays and an operator, eg. =>, or +, and then 'runs' the operator on the elements of the two lists. Here, you defined @x as a list of strings. I defined two lists, one of keys and one of values. Then I

Re: for loop index question

2017-02-28 Thread Andrew Kirkpatrick
The zip operator in this case takes two sequences and interleaves them into a single sequence. It might be useful if you have handy or can generate a list of keys and a list of values you want to put together in pairs using => to create a hash table. Your explicit approach makes sense for

Re: for loop index question

2017-02-28 Thread Todd Chester
On Wednesday, March 01, 2017 01:01 PM, Todd Chester wrote: Hi All, And it even gets more interesting. It even works with Associative Arrays (Hashes), which I adore! Interesting how associative arrays don't print in order that they were entered into the array. #!/usr/bin/perl6 my @x = (

Re: for loop index question

2017-02-28 Thread Todd Chester
Hi All, And it even gets more interesting. It even works with Associative Arrays (Hashes), which I adore! Interesting how associative arrays don't print in order that they were entered into the array. #!/usr/bin/perl6 my @x = ( "a", "b", "c", "d" ); print "loop of \@x\n"; for @x.kv ->

Re: for loop index question

2017-02-28 Thread Todd Chester
On 02/28/2017 01:30 PM, yary wrote: Maybe using placeholder variables was a bit too much (those variables with the ^ twigil) for @a.kv -> $k, $v { say "Value $v has index $k" } Value g has index 0 Value h has index 1 Value i has index 2 Value j has index 3 Value k has index 4 Hi Yary,

Re: for loop index question

2017-02-28 Thread Todd Chester
On 02/28/2017 01:20 PM, ToddAndMargo wrote: Hi All, There are times when I want to know th4e index of an array when I am in a "for @array" loop. I can do it with a variable outside the for loop and increment it, but I would line to know know if there is a way to incorporate it in the loop

Re: for loop index question

2017-02-28 Thread Todd Chester
On Tue, Feb 28, 2017 at 01:20:47PM -0800, ToddAndMargo wrote: Hi All, There are times when I want to know th4e index of an array when I am in a "for @array" loop. I can do it with a variable outside the for loop and increment it, but I would line to know know if there is a way to incorporate

Re: for loop index question

2017-02-28 Thread yary
Maybe using placeholder variables was a bit too much (those variables with the ^ twigil) > for @a.kv -> $k, $v { say "Value $v has index $k" } Value g has index 0 Value h has index 1 Value i has index 2 Value j has index 3 Value k has index 4

Re: for loop index question

2017-02-28 Thread yary
> my @a = ( 'g' .. 'k' ) [g h i j k] > @a.kv (0 g 1 h 2 i 3 j 4 k) > for @a.kv { say "Value $^v has index $^i" } Value g has index 0 Value h has index 1 Value i has index 2 Value j has index 3 Value k has index 4

Re: for loop index question

2017-02-28 Thread Elizabeth Mattijsen
> On 28 Feb 2017, at 22:20, ToddAndMargo wrote: > > Hi All, > > There are times when I want to know th4e index of an array > when I am in a "for @array" loop. I can do it with a > variable outside the for loop and increment it, but > I would line to know know if there is

Re: for loop index question

2017-02-28 Thread Patrick R. Michaud
I think the canonical Perl 6 answer is: for @array.kv -> $index, $value { do something } Pm On Tue, Feb 28, 2017 at 01:20:47PM -0800, ToddAndMargo wrote: > Hi All, > > There are times when I want to know th4e index of an array > when I am in a "for @array" loop. I can do it with a >

Re: smtp question

2017-02-10 Thread Francesco Rivetti
On 2017-02-10 5:51 AM, Brandon Allbery wrote: |3) not finding how to attach a file | Strictly speaking, that is not an SMTP function. You would use a MIME module to generate $message with an attached file. (This would likely be an example of $message not being a Str; it would be some kind of

Re: smtp question

2017-02-09 Thread ToddAndMargo
On 02/09/2017 08:51 PM, Brandon Allbery wrote: On Thu, Feb 9, 2017 at 11:41 PM, ToddAndMargo wrote: I am looking at

smtp question

2017-02-09 Thread ToddAndMargo
Hi All, I am starting a program (run from crontab) to test some things and eMail diagnostics to me. I am looking at https://github.com/retupmoca/P6-Net-SMTP I pretty much understand everything, but send($from, $to,

Re: inline question

2017-01-18 Thread Luca Ferrari
On Tue, Jan 17, 2017 at 6:35 PM, ToddAndMargo wrote: > Does Perl 5 have to be installed to get Inline work? Or just a path > to the downloaded perl5 module(s)? See the BUILDING section for more details: Luca

Re: Subroutine question

2017-01-13 Thread Brandon Allbery
On Fri, Jan 13, 2017 at 10:32 PM, ToddAndMargo wrote: > I almost understand what you said. What do you/they mean by > "positional parameters"? > foo(1, 5, :bar) 1 and 5 are positional: what they represent can only be determined by knowing their position in the parameter

Re: Subroutine question

2017-01-13 Thread ToddAndMargo
On 01/13/2017 06:53 PM, Brandon Allbery wrote: On Fri, Jan 13, 2017 at 9:50 PM, ToddAndMargo wrote: Is their example a boo-boo? :$type, # Optional How is this

Re: Subroutine question

2017-01-13 Thread Brandon Allbery
On Fri, Jan 13, 2017 at 9:50 PM, ToddAndMargo wrote: > Is their example a boo-boo? > :$type, # Optional > > How is this "optional" when "!" is the default? > > You misunderstood that section: it is the default only for positional parameters. -- brandon s allbery

Subroutine question

2017-01-13 Thread ToddAndMargo
Hi All, I am reading up on subroutines over at: https://en.wikibooks.org/wiki/Perl_6_Programming/Subroutines The above states:    In a subroutine declaration, named parameters must come after    all required and optional positional

Re: question about Supply.act()

2016-04-28 Thread Moritz Lenz
On 04/28/2016 11:11 AM, mt1957 wrote: Hi, The documentation about the method act explains that 'the given code is guaranteed to be only executed by one thread at a time'. Can I assume from this that any other thread including the main thread isn't running? No. Other threads might still be

CPAN and LWP::UserAgent question?

2016-01-13 Thread ToddAndMargo
Hi All, I am thinking of starting the transition from Perl 5 to 6. The major CPAN modules I use in Perl 5 are: use Term::ANSIColor qw ( BOLD BLUE RED GREEN RESET ); use Term::ReadKey qw ( ReadKey ReadMode ); use Net::Nslookup qw ( nslookup ); use LWP::UserAgent; use LWP::Protocol qw ( https );

Re: CPAN and LWP::UserAgent question?

2016-01-13 Thread H.Merijn Brand
On Wed, 13 Jan 2016 12:48:47 -0800, ToddAndMargo wrote: > Hi All, > > I am thinking of starting the transition from Perl 5 to 6. > > The major CPAN modules I use in Perl 5 are: > > use Term::ANSIColor qw ( BOLD BLUE RED GREEN RESET ); > use Term::ReadKey qw ( ReadKey

Perl6-debug - interface question

2013-09-23 Thread Revell, Gary
Hi, I'm just starting to use Perl6 and wanted to do some exercises with the perl6 debugger. All development is on Windows 7 Enterprize platform. [cid:image001.png@01CEB7D0.704DF1C0] I'm using the cmd program and as you can see above I'm getting what appear to be cursor positioning/screen

Re: Perl6-debug - interface question

2013-09-23 Thread Marc Chantreux
hello, On Sun, Sep 22, 2013 at 07:23:25PM +, Revell, Gary wrote: Hi, [cid:image001.png@01CEB7D0.704DF1C0] I don't know for other members of the list but i didn't appreciate to find an image attached to a message posted in a mailing list. You can post it on a website then give an url

Fwd: grammar question

2008-12-06 Thread Илья
Hi, I found I send this mail only to Patrick, but thought I send it to list too. I still have question about rule? and result Match object. Patrick do not answer, mb some one can say what I miss? or this is bug? Forward: Patrick, I read you post in blog about Z, so if I understand right for do

grammar question

2008-11-29 Thread Илья
Hi there, I have tried to fix our HTML::Template in November which is blocked by Rakudo segaful. I was trying to create simple example, but can`t reproduce it. By the way now I have short example(much shorter then when I start), and I have questions about it: grammar G { token TOP { ^ foo+ $

Re: Fwd: [november] Re: arrays and arrays ref question

2008-10-31 Thread Carl Mäsak
method a handful times, so maybe it's just a question of language acquisition.) // Carl

Fwd: [november] Re: arrays and arrays ref question

2008-10-31 Thread Илья
So, I have found workaround for now: my $ar = [1,2,3]; loop ( my $i = 0; $i $ar.elems; $i++ ) { $ar[$i].say } 1 2 3 2008/10/30 Илья [EMAIL PROTECTED]: I have found one: my $ar = [1,2,3]; my $i = 0; while $i $ar.elems {say $ar[$i]; $i++ }; 1 2 3 2008/10/30 Carl Mäsak [EMAIL PROTECTED]:

Re: Fwd: [november] Re: arrays and arrays ref question

2008-10-30 Thread Timothy S. Nelson
On Thu, 30 Oct 2008, wrote: Hi there, question about arrays and array refs in Rakudo today. I have array ref my $ar = [1,2,3]; how can I go over it? I try: my $r = [1,2,3]; say $r.elems; 3 my $r = [1,2,3]; say $r.WHAT; Array my $r = [1,2,3]; Y.say for $r; Y my $r = [1,2,3]; .say

Re: Fwd: [november] Re: arrays and arrays ref question

2008-10-30 Thread Timothy S. Nelson
On Thu, 30 Oct 2008, Carl Mäsak wrote: Timothy (): my $r = 1 2 3; for $r - $t { say $t }; Which revision of Rakudo are you running? In my r32239, it outputs 1 2 3 on the same line (i.e. it doesn't iterate over each element). Oops. My bad. Try either of the following with parrot

Re: a practical question

2006-08-23 Thread Steffen Schwigon
Richard Nabil Hainsworth [EMAIL PROTECTED] writes: But I want to start doing real things. Which for me requires gui toolkits. I have used Tk with perl5 and I am looking at WxWidgets. WxWidgets (and the more commercial Qt) exist as C++ classes, although WxPerl is a set of wrappers around

a practical question

2006-08-22 Thread Richard Nabil Hainsworth
I've been following the development of perl6 from its beginnings, read the Apocalypses and Exegesis as they came out, and though I am not a perl guru and did not understand it all, the language looks interesting and one I would like to experiment with. But I want to start doing real things.

GUI toolkits (RE: a practical question)

2006-08-22 Thread Conrad Schneiker
From: Richard Nabil Hainsworth [mailto:[EMAIL PROTECTED] But I want to start doing real things. Which for me requires gui toolkits. [...] So how to write an application in perl6 that uses (for the sake of illustration) WxWidgets? For simplicity, just a small window with Hello World, a

Re: Simple Print/Say Question

2006-05-24 Thread A. Pagaltzis
my %buckets = ( w = { count = 4, scale = 10.5, }, x = { count = 6, scale = 7, }, y = { count = 12, scale = 3, }, z = { count = 18,

Re: Simple Print/Say Question

2006-05-24 Thread Martin Kjeldsen
Just curious does this actually run? I'm trying on pugs 6.2.11 and it complains quite a bit. First of all shouldn't for %buckets.values - $arg_for be for %buckets.values - $arg_for is rw since $arg_for is modified? And then I get an error telling me 'No such method in class Scalar: kv' in

Re: Simple Print/Say Question

2006-05-24 Thread A. Pagaltzis
Hi Martin, * Martin Kjeldsen [EMAIL PROTECTED] [2006-05-24 11:50]: Just curious does this actually run? I'm trying on pugs 6.2.11 and it complains quite a bit. First of all shouldn't for %buckets.values - $arg_for be for %buckets.values - $arg_for is rw since $arg_for is modified?

Re: Simple Print/Say Question

2006-05-24 Thread A. Pagaltzis
* Daniel Hulme [EMAIL PROTECTED] [2006-05-24 12:45]: $arg_forarray = [ ( 0 .. $arg_forcount ) »*« $arg_forscale ]; btw, shouldn't the * be * as the right-hand operand is a scalar? I don’t know. S03 says: | If either argument is insufficiently dimensioned, Perl | upgrades it: | |

Re: Simple Print/Say Question

2006-05-24 Thread A. Pagaltzis
* Ovid [EMAIL PROTECTED] [2006-05-24 18:00]: First off, thanks to Aristotle for clearing some of my thinking. NP, it’s a good way for me to pick up the disparate Perl 6 clues I picked up haphazardly over time, too. In my version of Pugs (6.2.11 (r10390)), that fails for two reasons, both of

Re: Simple Print/Say Question

2006-05-23 Thread Gabor Szabo
question is: why is it doing that or, more to the point, what am I doing wrong? I am not sure, maybe the . before \n cause the problem but why not try this one: my @array = (1, 2, 3); say join |, @array; Gabor

Re: Simple Print/Say Question

2006-05-23 Thread Fagyal Csongor
PROTECTED] wrote: 1|2|3 I would say something like: print $array[0] . | . $array[1] . | . $array[2] . \n; not the best way but it works. In Perl6 if say something like this: print @array[0] ~ | ~ @array[1] ~ | ~ @array[2] . \n; I get 1 2 3 | | | My question

Re: Simple Print/Say Question

2006-05-23 Thread Chris Yocum
: print $array[0] . | . $array[1] . | . $array[2] . \n; not the best way but it works. In Perl6 if say something like this: print @array[0] ~ | ~ @array[1] ~ | ~ @array[2] . \n; I get 1 2 3 | | | My question is: why is it doing that or, more to the point, what am I doing

Re: Simple Print/Say Question

2006-05-23 Thread Ovid
This seems to work for me: pugs -e 'say (1,2,3).join(|)' 1|2|3 Or even: pugs -e '(1,2,3).join(|).say' 1|2|3 Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web Programming with Perl -- http

Re: Simple Print/Say Question

2006-05-23 Thread Dr.Ruud
Chris Yocum schreef: print @array[0] ~ | ~ @array[1] ~ | ~ @array[2] . \n; First the Perl6-equivalent of $ = '|' ; and then say @array ; -- Affijn, Ruud Gewoon is een tijger.

<    2   3   4   5   6   7