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[$
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 @
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[$
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
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
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
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
@{$_} 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.
> 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
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
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
_
$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 "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?
_
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
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
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
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
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
18 matches
Mail list logo