jagomart
digital resources
picture1_Perl Pdf 187645 | Lesson 14


 176x       Filetype PDF       File size 0.25 MB       Source: www.compsci.hunter.cuny.edu


File: Perl Pdf 187645 | Lesson 14
perl data types and variables perl data types and variables data variables expressions and much more cocoppyyrrigighhtt 22000069 sstteewwaarrtt wweeisisss data types in perl perl is unlike most high level ...

icon picture PDF Filetype PDF | Posted on 02 Feb 2023 | 2 years ago
Partial capture of text on file.
          Perl Data Types and Variables
          Perl Data Types and Variables
              Data, variables, expressions, and much more
   CoCoppyyrrigighhtt  22000069  SStteewwaarrtt  WWeeisisss
      Data types in Perl
       Perl is unlike most high-level languages in that it does not 
       make a formal distinction between numeric data and character 
       data, nor between whole numbers and numbers with fractional 
       parts. 
       Most  modern languages invented before Perl ask you to 
       declare in advance whether a variable will store a character, a 
       whole number, a floating point number, or something else. 
       Not Perl.
     2             CSci 132 Practical UNIX with Perl
      Typelessness in Perl
       To illustrate, if we declare a variable named $anything  
       using the statement
         my $anything;
         then all of the following assignment statements are valid:
         $anything = "Now I am a string";
         $anything = 10;
         $anything = 3.141592;
       In short,  in Perl, variables are untyped. 
     3             CSci 132 Practical UNIX with Perl
          Three data classes
           However, Perl does distinguish the class of data, i.e., whether 
           it is primitive or structured. Scalars are primitive and lists and 
           hashes are structured:
              scalar data       a single data item 
              list data         a sequence or ordered list of scalars
              hash data         an unordered collection of (key,value) pairs
           Scalars may be numbers such as 12 or 44.3 or strings like 
         "the swarthy toads did gyre and gimble in the wabe". 
           There are other kinds of scalars as well, as you will now see.
        4                      CSci 132 Practical UNIX with Perl
The words contained in this file might help you see if this file matches what you are looking for:

...Perl data types and variables expressions much more cocoppyyrrigighhtt sstteewwaarrtt wweeisisss in is unlike most high level languages that it does not make a formal distinction between numeric character nor whole numbers with fractional parts modern invented before ask you to declare advance whether variable will store number floating point or something else csci practical unix typelessness illustrate if we named anything using the statement my then all of following assignment statements are valid now i am string short untyped three classes however distinguish class e primitive structured scalars lists hashes scalar single item list sequence ordered hash an unordered collection key value pairs may be such as strings like swarthy toads did gyre gimble wabe there other kinds well see...

no reviews yet
Please Login to review.