Re: Printing an array within a hash

2006-10-02 Thread John W. Krahn
Johnson, Reginald (GTI) wrote: > I am trying to print the contents of the array from within the hash. I > see that I can do it by > > print "$name: $items[0][0] $items[0][1] $items[0][2] $items[0][3] \n " > > Is there a better way to accomplish this, especially if I don't know the > number of i

Printing an array within a hash

2006-10-02 Thread Johnson, Reginald \(GTI\)
I am trying to print the contents of the array from within the hash. I see that I can do it by print "$name: $items[0][0] $items[0][1] $items[0][2] $items[0][3] \n " Is there a better way to accomplish this, especially if I don't know the number of items in the array. Here is the code:

Re: Printing An Array

2006-02-26 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > Currently I have my script print in a long list .csv file. I need to > print my long list into rows of 20 elements. How can I go about doing > this? > > while ($x = ) > { > > chop $x; > @arr = split /\s+/,$x; > $temp = @arr; > print "$arr[$temp -1],\n"; > > } Based

Printing An Array

2006-02-26 Thread overkill
Currently I have my script print in a long list .csv file. I need to print my long list into rows of 20 elements. How can I go about doing this? while ($x = ) { chop $x; @arr = split /\s+/,$x; $temp = @arr; print "$arr[$temp -1],\n"; } __DATA__ hostname01 Unknown DL360 G3 M0PCLGP82F R

Re: Printing an Array

2003-07-31 Thread Rob Dixon
Josimar Nunes De Oliveira wrote: > Hi, > Pablo, you should write this at line of IF command: > if($count>0 && $count<$#archivo) { > I hope you get the right thing you want. Hi Pablo. Josimar's right, and it also looks like you're not using 'strict'? You may prefer the following, which avo

Re: Printing an Array

2003-07-30 Thread Josimar Nunes de Oliveira
PROTECTED]> Sent: Wednesday, July 30, 2003 4:48 PM Subject: Printing an Array > Hi! > > I have an array (@archivo), and each line has pipes (|), so Im using split, > but Im using 'sleep 1' to make it 'slower' so I can see line by line. > > foreach $i (@

Re: Printing an Array

2003-07-30 Thread Pablo Fischer
Solved; Another case of buffering, the right code: foreach $i (@archivo) { #Dont count the first and last line if($count>$size || $count<$size) { ($correo, $clave, $nombre, $registro, $id, $sexo, $password) = split(/\|/, $i); ($user, $host) = split(/\@/, $correo);

Printing an Array

2003-07-30 Thread Pablo Fischer
Hi! I have an array (@archivo), and each line has pipes (|), so Im using split, but Im using 'sleep 1' to make it 'slower' so I can see line by line. foreach $i (@archivo) { #Dont count the first and last line if($count>$size || $count<$size) { chomp($i); ($correo, $clav

RE: Printing an array reference from within a struct

2001-08-22 Thread Wagner-David
'Object::name' => 'CRAIG' }, 'Object' ) ]; Murray ID3148 CraigScottCara CRAIG ID0281 NA Looks like from the COokbook either should work and it will take someone with a higher understanding than me to explain. Wags ;) --

Printing an array reference from within a struct

2001-08-22 Thread Craig Moynes/Markham/IBM
Hey Perl'ers, I can't seem to print the array reference within the struct correctly ( I get a blank rather than the expected data). I grabbed this idea Chapter 12, pg 336 of Programming Perl and it looks like I followed their sample but something doesnt seme to be working correctly. Cheers,