Perl Programming - Working with Scalar Data outro
Get the entire Perl Programming course for 20% off: http://stoneriverelearning.com/courses/perl-programming-for-beginners-online-course?product_id=38639&coupon_code=YOUTUBE20
Congratulations, guys! You’ve made it through our section 3, Working with Scalar Data. Hope you guys had a lot of fun. This is our conclusion to wrap up our section. I’m just going to go over everything that we’ve covered.
What did you learn in this section? Again, working with strings. So the skills that you should have developed is how to define strings, how to assign values to strings and set up variables, scalar variables or containers to save these strings. Strings are nothing more but text that we can use and display in our Perl programs. Strings are used across all programs and programming languages as well.
Working with numbers. The skills you learned is the different types of numbers. For example, we have our floating point type numbers. We have our whole numbers which include decimal points for our floating point numbers or also called real numbers. I know I explained the differences between the two so you guys have some awareness and you guys should know the differences between the two. Using a float number, it just includes a decimal point and whole numbers are just whole numbers with no decimal point.
Working with variables. We can take either or of these values from strings or numbers and save them into our containers which are called scalar variables, and we can use these valuables for later use in our programs. We can pass these values to other parts of our program to interact with certain operations we want to perform. Again, variable is one of our best friends because we want to reuse values and information.
Getting the user input. One of my best friends personally because again what it does is that it interacts with our user and it collects information from the keyboard. So we can collect information from our user, save it into our variables and we can perform all kinds of cool things with strings and numbers and our if control structures and while loops and all that cool stuff we learned in this section.
The chomp operator which usually is bundled when used with getting input from our user. All it does is it just removes the new line character from the user input using the line input operator or the line operator. That’s all it does. Just removes the new line character so we can format our output and use that data or information more correctly.
Decision making. So we’ve covered how to use our skills to create our if statements and our elsif statements as well. Again, this is extremely important because we’re giving our programs life. We’re giving it logic. This is how our programs become smart. For example, if we want to create a program for a bar and it wanted to check if our clients are under the age of 21 or over the age of 21, we can easily write a program saying, “Hey, if you are 21, then I’ll let you pass in and you can drink. But if you’re not a certain age, then we’ll go ahead and say otherwise.” That’s the logic that we can give our programs with a beautiful construct of decision making with if statements.
Looping usually is in contact with decision making with if statements. We don’t have to write something a million times over and over again. We can just write something once which gives us our looping and our while statements and make our life a lot easier as a programmer.
Congratulations, guys! I’ll see you in our next section.