Perl Data Types
There are 3 tasks in total, please address each
Topic 1: Perl Data Types -250 words
For this forum, create an original post addressing the topic(s) below, prior to midnight ET on Thursday. Continue to follow your classmates’ posts for the remainder of the week and respond to two or more of your classmates prior to midnight ET on Sunday. Your follow-up posts may add additional insights to a classmate’s opinions or may challenge posted opinions. Use examples from the readings, or from your own research to support your views as appropriate. Be sure to read the follow-up posts to your own posts and reply to any questions or requests for clarification. By the way, include the name of the person’s post you are replying to and your source for further research or reference. Thanks!
Task 2
Please provide feedback in 250 words to the following;
This week we are to discuss the three data types that are incorporated into the Perl scripting languages. In most of languages that I have worked with in the past, to include the two that we have all worked with thus far in this course, Node and VBScript, there have been a large number of data types. From integers, floating types, and decimals to deal with numbers, and Booleans to deal with the binary-like on and off state of a true or false variable, to even an entire object, there have always been many different types of data to process and deal with. However, the Perl scripting language deals with things in a different light. It actually only incorporates three separate data types. These data types are Arrays, Scalars, and Hashes.
Scalars are the data type that can store numeric or string values within its variables. While the entire syntax of Perl is absolutely different than anything I have dealt with before, the assignment of these variables seems loosely related to how we assigned variables when working with VBScript. For all variable assignments using a Scalar data type, the integer name is prefaced with a dollar sign, “$”, possibly stemming from the fact that the sign looks like an “S” for Scalar. For an integer assignment, you simply continue the assignment as you would in VBScript, and then you end the statement with a semicolon, “;”.
For example, to make an integer value for a number of cats, you would type:
$cats=10;
Floats and Strings work in a similar fashion, and the system can tell which is which by how you assign the value.
$catName=”Fido”;
$catPieRemaining=3.14;
An Array in Perl is basically the same as an array in any other language, and it stores Scalars. When you wish to create an array or refer to more than one data element within the collection, you use the ampersand, “@”. If you are only referring to one of the elements, you use the dollar sign, as you’re only referring to a singular Scalar.
@dogs=(1,2,3);
@dogNames=(“sherlock”, “holmes”);
You also refer to elements in a Perl array starting from the 0th point, as you would in any other language.
The final data type is the Hash. A Hash is created using the percent sign “%”. It is basically used to store scalars, as an array is. However, it has a unique key/value pairing attribute affixed to it. You can assign a scalar as the Key and then assign the scalar as the value.
%hungerLevel = (Aaron => ‘Hungry’)
In this example, Aaron is the key and Hungry is the value, and you can search through the hash by Key. These are quite confusing and I am still trying to figure them out.
Task 3
Please provide feedback in 250 words to the following;
Perl has three different data types that are used. The three different data types are scalar, lists and hashes. A scalar is used to store a variables data. When the line of code is written, a variable that is used may not be able to be recalled. This is why you must write the variable as a scalar variable. The scalar variable will have the $ before the variable’s name. This turns the variable into a scalar variable.
The next data type is called a list. When you think of list you can easily think of a grocery list. A grocery list can be used as a an example of how Perl defines a list. A list is Perl is a group of values are in one line. The lists are also stored in the order in which they are written.
The third data type is called hashes. A hash is very similar to a list and also a scalar. Hashes are similar to lists because they can be written the same way. Hashes are also similar to scalars because they are written with a prefix before the name. The information in the hash can be recalled in any order.
There a small differences between all three of the data types. Scalar variable differs between the other two because it only recalls the information that is in the single variable. The list data type is different because it can recall all the data in that list and only in a certain order. Hashes use a different prefix than scalars and also can recall the information in a different order.
Cozens, S. (n.d.). Working With Simple Values . In Beginning Pearl (pp. 37-74).
Cozens, S. (n.d.). Lists and Hashs . In Beginning Pearl (pp. 75-112).
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


