![]() In most programming languages, a global variable is declared outside a class, routine, or subroutine. Then, it displays the result: There is hope, Computer Hope What is a global variable? When you run the program, the print statement replaces the variable name, $name, with its string value. The double quotes indicate that the text inside is a string, but are not part of the string data. The value of fullname is the string Computer Hope, which is enclosed in double quotes. In the first line of the program, the variable is assigned a value using the assignment operator, =. In perl, the dollar sign $ indicates that fullname is the name of a variable, but the dollar sign is not part of the variable name. In the example above, the variable, named fullname, is declared using the Perl keyword my. Below is an example of a variable in the Perl programming language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |