#!/usr/bin/perl
# countlines2.pl by Bill Weinman <http://bw.org/contact/>
# Copyright (c) 2010 The BearHeart Group, LLC
use strict;
use warnings;
sub main {
my @values = (43,123,5,89,1,76);
my @values1 = sort(@values);
foreach $value(@values1){
print "$value\n";
}
}
Errors -
"Global symbol "$value" requires explicit package name at task2.txt line 12
"Global symbol "$value" requires explicit package name at task2.txt line 13
我是 perl 的初学者,所以我遇到了上述错误。另外请告诉我 perl 默认如何对数字进行排序(例如 sort(@values) 会产生什么结果?)。