© William "Bo" Rothwell of One Course Source, Inc. 2019
William "Bo" RothwellBeginning Perl Programminghttps://doi.org/10.1007/978-1-4842-5055-6_2

2. Scalar Variables

William “Bo” Rothwell1 
(1)
San Diego, CA, USA
 

Numeric Literals

A numeric literal is simply any kind of valid number. In Perl the following numeric types are supported:
  • Integer (ex: 111)

  • Floating point (1.11)

  • Hex (0x111)

  • Octal (0111)

  • Scientific (1.11E3)

While it’s important to know what numeric types Perl supports, it’s also important to understand that Perl doesn’t “treat” these types differently. In fact, all numbers (and strings) are considered to be of one type in Perl: scalar.

Also note that while you can represent scalar values as Hex, Octal, or Scientific, Perl will really treat them ...

Get Beginning Perl Programming: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.