What are different data types that Perl supports. Elaborate on them.

devquora
devquora

Posted On: Feb 22, 2018

 

PERL has three basic data types. They are:

  • Scalar data type: These are simple variables that are either a number, string or a reference. Scalar data types start with a dollar sign($). Scalar values are by default undefined. A scalar value is interpreted as TRUE in the Boolean sense if it not a null string.
  • Arrays of scalar: These are the ordered list of scalars that can be accessed by a numeric index and starts with a 0. They start with "at" sign (@). In simpler words, array stores the list of scalar values.
  • Hashes of scalars: Hashes are also known as associative arrays and are preceded by a percentage sign (%). Hashes are unordered sets of value pairs that can be accessed using the keys as subscripts. It stores associative arrays that use a key-value as an index instead of numerical indexes. It is a third major data type after scalars and arrays.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Perl Interview Questions

    List all the features of Perl programming.

    Practical extraction and reporting language (PERL) is an open source software which is used to develop web-based applica..

    Perl Interview Questions

    What are the benefits of PERL in using it as a web-based application?

    The benefits of using PERL programming are: PERL is known as the duct tape of the internet. PERL can accelerate the pro..

    Perl Interview Questions

    Talk about the applications of PERL.

    PERL has myriad and varied applications. PERL is used to write Common Gateway Interface scripts and large projects like..