in reply to Printing the elements of array

#!/usr/bin/perl -w use strict; my @array=qw (5 4 10); for(my $i=0;$i<$#array;$i++){ my $first=$ar_no[$i];
The code you posted does not compile:
Global symbol "@ar_no" requires explicit package name at
You can use diagnostics to get a more verbose explanation. You declared an array name "array", but you did not declare an array named "ar_no". Try changing ar_no to array.

Replies are listed 'Best First'.
Re^2: Printing the elements of array
by viktor (Acolyte) on Jan 16, 2012 at 17:44 UTC
    sorry i just updated it