Help with array of arrays!

2004-10-13 Thread Beckett Richard-qswi266
Guys, This script: use strict; use warnings; my @array; for (0..3) { push @array, ["$_:", 1, 2, 3]; } for (0..$#array) { my $row = $_; for (0..3) { my $col = $_; print "$array[$row][$col], " unless ($col == 3); print "$array[$

Re: Help with array of arrays!

2004-10-13 Thread David Greenberg
my @array = map { ["$_:", 1, 2, 3] } (0..3); foreach (@array) { print join (', ', @{$_}) . "\n"; } HTH, David On Wed, 13 Oct 2004 14:44:06 +0100, Beckett Richard-qswi266 <[EMAIL PROTECTED]> wrote: > Guys, > This script: > > use strict; > use warnings; > my @array; > for (0..3) { > push @

RE: Help with array of arrays!

2004-10-13 Thread Moon, John
Guys, This script: use strict; use warnings; my @array; for (0..3) { push @array, ["$_:", 1, 2, 3]; } for (0..$#array) { my $row = $_; for (0..3) { my $col = $_; print "$array[$row][$col], " unless ($col == 3); print "$array[$

RE: Help with array of arrays!

2004-10-13 Thread Beckett Richard-qswi266
Thanks to all those who helped, so far! :-) foreach ( @array ) { print join ( ", ", @{$_} ), "\n"; } This is the nice easy print statement I was looking for, but I don't quite understand it. I get the print, and the join, but what is @{$_} all about? Going back to the array: 1/1/2004 0 34.5

RE: Help with array of arrays!

2004-10-13 Thread Anderson, Mark (Service Delivery)
use strict; use warnings; my @array; for (0..3) { push @array, ["$_:", 1, 2, 3]; } for my $R (@array) { print join(",", @$R) , "\n"; # for (0..3) { # my $col = $_; # print "$array[$row][$col], " unless ($col == 3); # print "$array[$ro

RE: Help with array of arrays!

2004-10-13 Thread Anderson, Mark (Service Delivery)
The $@ is dereferencing the ananymous array you created using push... consider... push @array, [0,1,2,3]; #<- adds an anon array to @array for my $arrayref (@array) { print ref($arrayref) . "\t" . @$arrayref . "\t( @$arrayref )\n"; } so you can a) tell it's an array ref

RE: Help with array of arrays!

2004-10-13 Thread Moon, John
Subject: RE: Help with array of arrays! Thanks to all those who helped, so far! :-) foreach ( @array ) { print join ( ", ", @{$_} ), "\n"; } This is the nice easy print statement I was looking for, but I don't quite understand it. I get the print, and the join, but what is @{$_} all about? G

Re: Help with array of arrays!

2004-10-13 Thread David Greenberg
@{$_} dereferences the array reference created with []. For instance, my $ref = [1,2,3]; is the same as my @arr = (1,2,3); my $ref = [EMAIL PROTECTED]; To access the array (1,2,3) using $ref, you need to say @{$ref} or, to access an individual element of it, you can say $ref->[0], $ref->[1], etc.

RE: Help with array of arrays!

2004-10-13 Thread Thomas, Mark - BLS CTR
> Gives: > 0:, 1, 2, 3 > 1:, 1, 2, 3 > 2:, 1, 2, 3 > 3:, 1, 2, 3 > > Which is what I'd expect, and is designed to put the data > into a csv file. > > First, is this the best way to do it, or is there a neater trick? This is a neat trick: use Template; my $template = Template->new || die $T

adsi, which "interface"

2004-10-13 Thread Hon Shi
wooh Ok, I use the ADSI provider LDAP which can return any number of interfaces: IADs, IADsContainer, IADsSchema Question is, how do I know which ones I've got? Is the following correct? 'ADSI Objects of LDAP' list a dozen or so ADSI objects. When I use OLE->GetObject, I obtain one of the

Win32::MsgBox sometimes appears minimized

2004-10-13 Thread StoneBeat
Hi, i have an application than uses Win32::MsgBox to show errors / events, and sometimes the same msg appears in the foreground (thats ok) but sometimes appears minimized in the background and i don't know why. I have try Perl 5.6.x and 5.8.x Thanks _

pass an AD object

2004-10-13 Thread Hon Shi
$ldap = Win32::OLE->GetObject( "$spec"); subR(\$ldap); #-- sub subR { my ($ad) = @_; $className = $$ad->{'Class'}; } Doesn't work after I pass the object. How do you pass and use this object? Thanks - been using this list quite-a-bit. I should settle down soon.

Unlink and UNC paths

2004-10-13 Thread Adam R. Frielink
unlink "SERVER\\C\$" . $flist; $flist contains "\TEMP\file.tar.gz"; When unlink executes, I get the error 'No such file or directory'. I know I can access these files as I perform a copy from the remote server to my backup server using the same path. Is this an issue with unlink? _

RE: Unlink and UNC paths

2004-10-13 Thread Steven Manross
I would guess that $flist would need the same escaping on the \ that the first part of your UNC path has or change to ''.. HTH Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adam R. Frielink Sent: Wednesday, October 13, 2004 12:00 PM To: Perl Wi

RE: pass an AD object

2004-10-13 Thread Steven Manross
my $ldap = Win32::OLE->GetObject( "$spec"); subR($ldap); sub subR { my ($ad) = $_[0]; my $className = $ad->{'Class'}; } Should work as long as the "Class" property is valid... Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hon Shi Sent: We

RE: pass an AD object

2004-10-13 Thread Charles K. Clarkson
Hon-Shi <[EMAIL PROTECTED]> wrote: : $ldap = Win32::OLE->GetObject( "$spec"); You mean this. No quotes. ldap = Win32::OLE->GetObject( $spec ); : subR(\$ldap); : #-- : sub : subR { : my ($ad) = @_; : : $className = $$ad->{'Class'}; : } : : Doesn't work after I pass the object

RE: Win32::MsgBox sometimes appears minimized

2004-10-13 Thread Peter Eisengrein
Title: RE: Win32::MsgBox sometimes appears minimized > sometimes the same msg appears  in the foreground (thats ok) > but sometimes > appears minimized in the background and i don't know why. > Is there a pattern or commonality to when it does and does not happen? Can you show some code on

Perl Win32 Service Stops When Child Exits after fork()

2004-10-13 Thread John McDonald
Hi,   I setup a win32 Perl service which monitors a port for incoming data. I used information located at http://www.roth.net/perl/Daemon/ to setup the Perl service.  Everything works as advertised except for fork().  When the child exits, not only does it kill the child, but it also kills the se