User Profile
Collapse
-
Thank You, I will try one too. So kind of you both to help me. Really appreciate that. -
Code:#!/usr/bin/perl use strict; use warnings; my @array = (1..1000); my $sum = 0; foreach my $num (@array){ $sum = $sum + $num; } sub total { my($v1) = print $sum; } my($output) = &total(); print "$output\n";
Leave a comment:
-
That helps a bunch. Man I still got a lot to learn. That little trick
$1 = $1 + $other didn't know you could do that. Yah man thanks again since I actually got so pissed, I broke something. At least I don't own a gun.Leave a comment:
-
Sum of Numbers in an Array
Code:#!/usr/bin/perl @array = (1..1000); sub total { my($v1) = print @array; } my($output) = &total();
@array = (1..1000);
print @array;
or
some bs, this thing sucks.
No activity results to display
Show More
Leave a comment: