This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Khai báo kiểu dữ liệu scalar | |
$a = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@animal = ('cat','dog','cow'); | |
# các phần tử trong animal được đánh số từ 0 -> 2 | |
# Để lấy ra giá trị của chúng ta chỉ cần | |
print $animal[0] # cat nằm ở vị trí 0 | |
print $animal[1] # cat nằm ở vị trí 1 | |
print $animal[2] # cat nằm ở vị trí 2 |