 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create Array in Perl?
Perl Array variables are prefixed with the @ sign and are populated using either parentheses or the qw operator. For example −
@array = (1, 2, 'Hello'); @array = qw/This is an array/;
The second line uses the qw// operator, which returns a list of strings, separating the delimited string by white space. In this example, this leads to a four-element array; the first element is 'this' and last (fourth) is 'array'. This means that you can use different lines as follows −
@days = qw/Monday Tuesday ... Sunday/;
You can also populate an array by assigning each value individually as follows −
$array[0] = 'Monday'; ... $array[6] = 'Sunday';
Advertisements
 