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
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:
[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
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
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
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 (@
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);
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
'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 ;)
--
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,
10 matches
Mail list logo