Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Looping through an Array

by vinoth.ree (Monsignor)
on Jan 11, 2013 at 13:25 UTC ( #1012888=note: print w/replies, xml ) Need Help??

in reply to Looping through an Array

Have you included

use strict; use warnings;

There is no array with @colnames, so its printing 0, You have $colnames variable which has the array reference, you need to dereference it like

print "A size:" . @$colnames . "\n";