- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Perl Scalar Variables
A scalar is a single unit of data. That data might be an integer number, floating-point, a character, a string, a paragraph, or an entire web page. Simply saying it could be anything, but only a single thing.
Here is a simple example of using scalar variables −
Example
#!/usr/bin/perl $age = 25; # An integer assignment $name = "John Paul"; # A string $salary = 1445.50; # A floating point print "Age = $age\n"; print "Name = $name\n"; print "Salary = $salary\n";
Output
This will produce the following result −
Age = 25 Name = John Paul Salary = 1445.5
Advertisements
To Continue Learning Please Login
Login with Google