Perl requires explicit package name -


#!/usr/bin/perl # countlines2.pl bill weinman <http://bw.org/contact/> # copyright (c) 2010 bearheart group, llc  use strict; use warnings;  sub main { @values = (43,123,5,89,1,76); @values1 = sort(@values);    foreach $value(@values1){     print "$value\n";   } }  errors -  "global symbol "$value" requires explicit package name @ task2.txt line 12 "global symbol "$value" requires explicit package name @ task2.txt line 13 

i beginner in perl having above errors. please tell me how perl sorts numbers default(e.g. sort(@values) result in?).

you might find helpful add use diagnostics; give additional information:

(f) you've said "use strict" or "use strict vars", indicates variables must either lexically scoped (using "my" or "state"), declared beforehand using "our", or explicitly qualified package global variable in (using "::").

foreach $value(@values1){ should foreach $value(@values1){


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -