Program complete
[email protected] (William Torrez Corea) Wed, 15 Nov 2023 00:16:46 -0600
| Newsgroups | perl.beginners |
|---|---|
| Message-ID | <CAGiORHfGTVQ2HWfjj3oBKQUXZ91xXw8iWEoRVRGnMTBOB-bHRw@mail.gmail.com> |
*What is a complete program or what needs a program to be complete?*
Is a different a program of C in comparison with a program in Perl. In C
the program has a structure but in Perl it is different.
my @numbers = (3,7,9,99,25);
> my @perfect_squares;
>
> # the next statement is useful when you want to skip the processing
> # of some elements. You can use this to rewrite the previous code
> # to find all perfect squares in a loop
> for my $number (@numbers){
> my $root = sqrt ($number);
>
> if (int ($root) != $root){
> next; #skip the rest of the loop BLOCK
> }
>
> print "Found perfect square: $number\n";
> push @perfect_squares, $number;
> }
> ~
>
> ~
>
--
With kindest regards, William.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀⠀⠀⠀