Pure Programmer
Blue Matrix


Cluster Map

Sequence

L1

This page is under construction. Please come back later.

In programming languages we have three ways to control the flow of statements: Sequence, Selection and Iteration. Sequence is the simplest and most basic flow control mechanism. It simply means that statements are executed sequentially in the order they appear in the program.

Sequence1.pl
#!/usr/bin/env perl
use utf8;
use strict;
use warnings;

MAIN:
{
	my $x = 1;
	print "x: ", $x, "\n";
	$x = 2;
	print "x: ", $x, "\n";
	$x = 3;
	print "x: ", $x, "\n";
}

Output
$ perl Sequence1.pl x: 1 x: 2 x: 3
perl

Questions

Projects

More ★'s indicate higher difficulty level.

References