in reply to Printing the elements of array
The code you posted does not compile:#!/usr/bin/perl -w use strict; my @array=qw (5 4 10); for(my $i=0;$i<$#array;$i++){ my $first=$ar_no[$i];
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.Global symbol "@ar_no" requires explicit package name at
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Printing the elements of array
by viktor (Acolyte) on Jan 16, 2012 at 17:44 UTC |