- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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 Sequential Number Arrays
Perl offers a shortcut for sequential numbers and letters. Rather than typing out each element when counting to 100 for example, we can do something like as follows −
#!/usr/bin/perl @var_10 = (1..10); @var_20 = (10..20); @var_abc = (a..z); print "@var_10\n"; # Prints number from 1 to 10 print "@var_20\n"; # Prints number from 10 to 20 print "@var_abc\n"; # Prints number from a to z
Here double dot (..) is called range operator. This will produce the following result −
1 2 3 4 5 6 7 8 9 10 10 11 12 13 14 15 16 17 18 19 20 a b c d e f g h i j k l m n o p q r s t u v w x y z
- Sorting Arrays in Perl
- Merging Arrays in Perl
- Transform Perl Strings into Arrays
- Transform Perl Arrays to Strings
- Insert sequential number in MySQL?
- Sequential Digits in C++
- DoubleStream sequential() method in Java
- LongStream sequential() method in Java
- IntStream sequential() method in Java
- What are Sequential Investment Decisions?
- What is Sequential Exception Technique?
- What is sequential pattern mining?
- Number of Squareful Arrays in C++
- Difference between combinational and sequential circuit