On Fri, Aug 22, 2008 at 05:30:19PM -0500, Andy Colson wrote:
> Moritz Lenz wrote:
> > The recommended way to write such a sub is
> >
> > sub xsum([EMAIL PROTECTED]) { ... }
> > xsum(|@x);
>
> Ahh, but, if I already had a list, would that flatten and then rebuild
> the list, correct? (and would, e
Patrick R. Michaud wrote:
> On Fri, Aug 22, 2008 at 04:34:04PM -0500, Andy Colson wrote:
>> sub xsum (@list)
>> {
>> my $i = 0;
>> print "summing: ";
>> for @list
>> {
>> $i += $_;
>> print $_,",";
>> }
>> say " = $i";
On Fri, Aug 22, 2008 at 04:34:04PM -0500, Andy Colson wrote:
> sub xsum (@list)
> {
> my $i = 0;
> print "summing: ";
> for @list
> {
> $i += $_;
> print $_,",";
> }
> say " = $i";
> return $i;
> }
> say "sum =
Moritz Lenz wrote:
Hi Andy,
you seem to have discovered a whole bunch of bugs at once :/
Andy Colson wrote:
Hi List --
I'v started playing around with perl 6, and I am having problems with
this example:
use v6;
sub xsum (@list)
{
my $i = 0;
print "summing: ";
f
Hi Andy,
you seem to have discovered a whole bunch of bugs at once :/
Andy Colson wrote:
> Hi List --
>
> I'v started playing around with perl 6, and I am having problems with
> this example:
>
> use v6;
>
> sub xsum (@list)
> {
> my $i = 0;
> print "summing: ";
>
Hi List --
I'v started playing around with perl 6, and I am having problems with
this example:
use v6;
sub xsum (@list)
{
my $i = 0;
print "summing: ";
for @list
{
$i += $_;
print $_,",";
}
say " = $i";
re