Categories
Perl

Switch Statement in Perl

A simple program that demonstrate how to use switch statement using Perl programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.


Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com


My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.https://www.unlimitedbooksph.com/


Program Listing

# switch_example.pl
# Author  : Jake Rodriguez Pomperada,MAED-IT,MIT
# Date    : April 26, 2020  Sunday  2:21 PM
# Email   : jakerpomperada@gmail.com
# Websites : http://www.jakerpomperada.com
#            http://www.jakerpomperada.blogspot.com

use Switch;

print "\n\n";
print "\tSwitch Statement Example ";
print "\n\n";

$var = 10;
@array = (10, 20, 30);
%hash = ('key1' => 10, 'key2' => 20);

switch($var) {
   case 10           { print "\tnumber 100\n" }
   case "a"          { print "\tstring a" }
   case [1..10,42]   { print "\tnumber in list" }
   case (\@array)    { print "\tnumber in list" }
   case (\%hash)     { print "\tentry in hash" }
   else              { print "\tprevious case not true" }
}
Categories
Perl

Closing a File in Perl

I wrote this simple program using Perl programming language to show you how to close a text file.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.


Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.https://www.unlimitedbooksph.com/

Sample Program Output

# close_file.pl
# Author   : Jake R. Pomperada,MAED-IT,MIT
# Date     : April 17, 2020   Friday   2:03 PM
# Location : Bacolod City, Negros Occidental
# Email    : jakerpomperada@gmail.com
# Websites : http://www.jakerpomperada.com
#            http://www.jakerpomperada.blogspot.com

printf("\n\n");
printf("\tClosing a File in Perl");
printf("\n\n");
open (my $fh, "<", "demo_file.txt") or die "Can't open < demo_file.txt: $!";
print readline($fh);
close($fh) or  "Couldn't close the file: $!";
printf("\n\n");
printf("The file demo_file.txt file close successfully.");
printf("\n\n");
printf("\tEnd of Program");
printf("\n\n");

Categories
Perl

Addition of Three Numbers Using Subroutine in Perl

I wrote this program to ask the user to give three numbers and then the program will compute the sum of three numbers using subroutine using the Perl programming language.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.


Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com


My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.https://www.unlimitedbooksph.com/

Program Listing

# pass_value_subroutine.pl
# Author   : Jake R. Pomperada,MAED-IT,MIT
# Date     : April 7, 2020   Tuesday  11:34 AM
# Location : Bacolod City, Negros Occidental
# Email    : jakerpomperada@gmail.com
# Website  : http://www.jakerpomperada.com
print("\n");

# Subroutine to add the two values given 
# by the user.

sub Sum_All {
   $sum = 0;

   foreach $item (@_) {
      $sum += $item;
   }
   printf("\n");
   printf("\tThe sum of %d, %d and %d is %d.",$num1,$num2,$num3,$sum);
   print("\n\n");
   print("\t\tEnd of Program");
   print("\n");
}

sub Addition { 
    print("\tAddition of Three Numbers Using Subroutine in Perl");
    print("\n\n");
    print("\tEnter First Value  : ");
    chomp($num1=<STDIN>);
    print("\tEnter Second Value : ");
    chomp($num2=<STDIN>);
    print("\tEnter Third Value  : ");
    chomp($num3=<STDIN>);
    
    $sum = Sum_All($num1,$num2,$num3);
 } 

# Calling the Subroutine 
Addition();  
Categories
Perl

unless-else Statement in Perl

I wrote this simple program in Perl programming language to demonstrate how to use unless-else statement.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/


Program Listing

# unless_else_example.pl
# Author  : Jake Rodriguez Pomperada,MAED-IT,MIT
# Date    : April 26, 2020  Sunday  4:10 PM
# Email   : jakerpomperada@gmail.com
# Websites : http://www.jakerpomperada.com
#            http://www.jakerpomperada.blogspot.com

print "\n\n";
print "\tunless-else Statement Example ";
print "\n\n";
print "\tGive a Number : ";
chomp($num=<>);
print "\n"; 
unless($num>=200) {
   #This print statement would execute,
   #if the given condition is false
   printf "\tThe given number $num is less than 200.";
}
else {
   #This print statement would execute,
   #if the given condition is true
   printf "\tThe given number $num is greater than or equal to 200.";
}
print "\n\n";
print "\tEnd of the Program";
print "\n\n";

Categories
Perl

More Operators in Perl

I wrote this simple program using Perl programming language to show you how to declare and use more operators in Perl.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Sample Program Output



print("\n");
print ("\tMore Operators in Perl");
print("\n\n");

$j = 15;

print("\t",$j++,"\n");
print("\t",$j--,"\n");
print("\t","j "x5,"\n");

Categories
Perl

Bitwise Operators in Perl

I wrote this simple program using Perl programming language to show you how to declare and use bitwise operators in Perl.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Sample Program Output
$a = 80;
$b = 23;

print("\n");
print ("\tBitwise Operators in Perl");
print("\n\n");

print("\tValue of \$a = $a and value of \$b = $b\n");

$c = $a &amp; $b;
print("\tValue of \$a &amp; \$b = $c\n");

$c = $a | $b;
print("\tValue of \$a | \$b = $c\n");

$c = $a ^ $b;
print("\tValue of \$a ^ \$b = $c\n");

$c = ~$a;
print("\tValue of ~\$a = $c\n");

$c = $a << 2;
print("\tValue of \$a << 2 = $c\n");

$c = $a >> 2;
print("\tValue of \$a >> 2 = $c\n");
Categories
Perl

Logical Operators in Perl

I wrote this simple program using Perl programming language to show you how to declare and use logical operators in Perl.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Sample Program Output

$a = true;
$b = false;

print("\n");
print ("\tLogical Operators in Perl");
print("\n\n");
print "\tThe result of \$a = $a and value of \$b = $b\n";

$c = ($a and $b);
print "\tThe result of \$a and \$b = $c\n";

$c = ($a  &amp;&amp; $b);
print "\tThe result of \$a &amp;&amp; \$b = $c\n";

$c = ($a or $b);
print "\tThe result of \$a or \$b = $c\n";

$c = ($a || $b);
print "\tThe result of \$a || \$b = $c\n";

$a = 0;
$c = not($a);
print "\tThe result of not(\$a)= $c\n";
Categories
Perl

Relational Operators in Perl

I wrote this simple program using Perl programming language to show you how to declare and use relational operators in Perl.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Sample Program Output
$a = 32;
$b = 11;

print("\n");
print ("\tRelational Operators in Perl");
print("\n\n");
print("\tValue of \$a = $a and value of \$b = $b\n");
if( $a == $b ) {
   print("\t$a == \$b is true\n");
} else {
   print("\t\$a == \$b is not true\n");
}

if( $a != $b ) {
   print "\t\$a != \$b is true\n";
} else {
   print("\t\$a != \$b is not true\n");
}

$c = $a <=> $b;
print("\t\$a <=> \$b returns $c\n");

if( $a > $b ) {
   print("\t\$a > \$b is true\n");
} else {
   print("\t\$a > \$b is not true\n");
}

if( $a >= $b ) {
   print "\t\$a >= \$b is true\n";
} else {
   print("\t\$a >= \$b is not true\n");
}

if( $a < $b ) {
   print("\t\$a < \$b is true\n");
} else {
   print("\t\$a < \$b is not true\n");
}

if( $a <= $b ) {
   print("\t\$a <= \$b is true\n");
} else {
   print("\t\$a <= \$b is not true\n");
}

Categories
Perl

Assignment Operators in Perl

I wrote this simple program using Perl programming language to show you how to declare and use assignment operators in Perl.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Sample Program Output

$a = 25;
$b = 8;

print("\n");
print ("\tAssignment Operators in Perl");
print("\n\n");
$a += $b;
print "\t\$a += \$b  = ",$a,"\n";
$a -= $b;
print "\t\$a -= \$b  = ",$a,"\n";
$a *= $b;
print "\t\$a *= \$b  = ",$a,"\n";
$a /= $b;
print "\t\$a /= \$b  = ",$a,"\n";
$a %= $b;
print "\t\$a %= \$b  = ",$a,"\n";
$a **= $b;
print "\t\$a **= \$b = ",$a,"\n";


Categories
Perl

Arithmetic Operators in Perl

I wrote this simple program using Perl programming language to show you how to declare and use arithmetic operators in Perl.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Sample Program Listing

$a = 10;
$b = 2;

print("\n");
print ("\tArithmetic Operators in Perl");
print("\n\n");
print("\t\$a+\$b = ",$a+$b,"\n");
print("\t\$a-\$b = ",$a-$b,"\n");
print("\t\$a*\$b = ",$a*$b,"\n");
print("\t\$a/\$b = ",$a/$b,"\n");
print("\t\$a%\$b = ",$a%$b,"\n");
print("\t\$a**\$b = ",$a**$b,"\n");