RE: ADSVW.exe not giving me any properties

2002-10-04 Thread Tillman, James

> I imagine it all boils down to NIH:  The 'Not Invented Here' Syndrome.
> 
> Because it's not Microsoft Perl, they don't need to support it.
> 
> Rick

It's not just Perl in this case.  VB has always been crippled when
attempting to do more advanced operations, including Active Directory
manipulation.  VB has always been a second-class language in the Win32
world.  The direct APIs always provide so much more than the API-wrapping
COM objects you're encouraged to used in VB.

(Actually, unlike Perl, VB deserves it, it's crap, anyway ;-)

jpt
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



UDP

2002-10-04 Thread Harald Wopenka

Hi there,

looking for a little example how to send UDP-Pakets via Perl. I found some
nice things in perldoc, but they didn't work - or I was too dumb to
implement them.

Thanks in advance
Harry

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Perl and Strange File Names

2002-10-04 Thread Carlo7

Hello
I Need to print file listings on win32 (w2000).
When I glob or readdir i miss files with
strange names like !=MyDir=! .message ..cvs etc.
Is there a way I can get at these weird file names?
Perl doesn't seem to want to list them ...
TIA
Karl



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



GetUserName in advapi32.dll

2002-10-04 Thread pei zheng

Hi,
I've download Win32::API from activestate perl repository using ppm. A test
program to call Win32 API "GetCurrentProcessID" works fine. However, when
the API "GetUserNameA" in 'advapi32.dll' is called as
follows, an "application error" message box pops up with something like
"memory cannot be read...".

Anybody ever use this API? Do I miss something there? Thanks.

-Pei


#!C:/Perl/bin/Perl -w
use strict;
use Win32;
use Win32::API;
my $value=" " x 64;
my $GetUserName;
my $return;
my $UserName;

$GetUserName = new Win32::API('advapi32.dll','GetUserName',[qw(P
L)],"L") or die "win32 api error ";
$return = $GetUserName->Call($value,64) or die "Call to GerUserNameA
error!";
$UserName = substr($value,0,$return);

my $machine = Win32::NodeName;
print $machine, "  ";
print $UserName;
print  "\n";




___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: How do I manipulate this

2002-10-04 Thread Roberts, Pete OGUK-OGCH/2
Title: RE: How do I manipulate this



Krishna - try substituting the characters.  If 
line is held in $line
 
$line=~ s/\n// 
 
will 
kill the first line feed
 
$line 
=~ s/\n//g  
 
will 
kill all of them.
 
$line 
=~ s/\s+//g will kill all white space 
 
etc.
 
The 
regular expression matching too in komodo is excellent for getting a  
grip on what matches what.
 
Pete.
 
 
-Original Message-From: Krishna, Hari 
[mailto:[EMAIL PROTECTED]]Sent: 30 September 2002 21:41To: 
'Peter Eisengrein'; [EMAIL PROTECTED]Subject: 
RE: How do I manipulate this
How do 
you chop a newline character? The newline character may be in the middle of the 
line thats been processed. Do I have to read character by character and compare 
it to the chr(13)??
Any 
suggestions.

  -Original Message-From: Peter Eisengrein 
  [mailto:[EMAIL PROTECTED]]Sent: Monday, September 30, 2002 
  03:04 PMTo: 'Krishna, Hari'; 
  [EMAIL PROTECTED]Subject: RE: How do I 
  manipulate this
  I think you mean ascii chr's 12 and 14. You could do a simple 
  match like: my $chars = $line =~ 
  /HARIKRISHNA(..)SERVICES BRANC/; 
  But, if you know what characters you want, why not just print 
  em out: print chr(12) . char(14); 
  or is there more to it than that? -Pete 
  > -Original Message- > 
  From: Krishna, Hari [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 30, 2002 15:55 > To: [EMAIL PROTECTED] > Subject: RE: How do I manipulate this > 
  > > I pasted the 
  characters properly and when I opened the mail, > I 
  don't see > those characters. I don't know what the 
  deal is with this. > Anyway, the characters 
  are > > one that has a 
  kind of music syllable or music note (Hope you > 
  can understand > that) and the other is kind of 
  like. Both are adjacent to each other. >   _o_ >    
  |  > > 
  Thanks, > Hari. > 
  -Original Message- > From: Krishna, Hari 
  [mailto:[EMAIL PROTECTED]] 
  > Sent: Monday, September 30, 2002 02:39 PM 
  > To: [EMAIL PROTECTED] 
  > Subject: How do I manipulate this > > > Hi 
  Guys, > > How do I 
  interpret the following special characters (between > HARIKRISHNA and > SERVICES BRANC)? I 
  see these special characters only when I > open the 
  file > using the command prompt (Not by notepad or 
  wordpad). So when > I process a > file and I want to add those characters to the file, How do I 
  > do that? > 
  > HARIKRISHNA??SERVICES BRANC > > Thanks for the help. > Hari. > > 
  > CONFIDENTIALITY NOTICE: > This e-mail message, including all attachments, is for the 
  > sole use of the > 
  intended recipient(s) and may contain confidential and privileged 
  > information. You may NOT use, disclose, copy or 
  disseminate this > information.  If you are 
  not the intended recipient, please > contact 
  the > sender by reply e-mail immediately.  
  Please destroy all copies of the > original message 
  and all attachments. Your cooperation is greatly > 
  appreciated. > Columbus Regional Hospital 
  > 2400 East 17th Street > 
  Columbus, Indiana 47201 > 
  ___ > 
  Perl-Win32-Users mailing list > 
  [EMAIL PROTECTED] > To 
  unsubscribe: http://listserv.ActiveState.com/mailman/mysubs 
  > > CONFIDENTIALITY 
  NOTICE: > This e-mail message, including all 
  attachments, is for the > sole use of the 
  > intended recipient(s) and may contain confidential and 
  privileged > information. You may NOT use, 
  disclose, copy or disseminate this > 
  information.  If you are not the intended recipient, please 
  > contact the > sender 
  by reply e-mail immediately.  Please destroy all copies of the 
  > original message and all attachments. Your cooperation 
  is greatly > appreciated. > Columbus Regional Hospital > 2400 East 
  17th Street > Columbus, Indiana 47201 
  > ___ 
  > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs 
  > 
CONFIDENTIALITY NOTICE:
This e-mail message, including all attachments, is 
for the sole use of the intended recipient(s) and may contain confidential and 
privileged information. You may NOT use, disclose, copy or disseminate this 
information. If you are not the intended recipient, please contact the sender by 
reply e-mail immediately. Please destroy all copies of the original message and 
all attachments. Your cooperation is greatly appreciated. 
Columbus Regional Hospital
2400 East 17th Street 
Columbus, Indiana 47201


Re: Bug in Win32::TieRegistry: DESTROY overwrites $@

2002-10-04 Thread Tye McQueen

Excerpts from the mail message of Burkhard Meier:
) 
) eval {
) my $key = $Win32::TieRegistry::Registry->{
) 'HKEY_LOCAL_MACHINE\\SOFTWARE' };
) die;
) };
) if( $@ ) {
) print "Exception caught: $@\n";
) }
) else {
) print "OK\n";
) }

There are other cases that can cause the same problem.  This is why
I don't use $@ to determine if eval() was successful.  I'd rewrite
the above code as:

my $ok= eval {
my $key = $Win32::TieRegistry::Registry->{
'HKEY_LOCAL_MACHINE\\SOFTWARE' };
die;
1;
};
if(  ! $ok  ) {
print "Exception caught: $@\n";
}
else {
print "OK\n";
}

I'll add your changes to TieRegistry.

Thanks,
Tye
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Bug in Win32::TieRegistry: DESTROY overwrites $@

2002-10-04 Thread Burkhard Meier

Hello Tye, hello everybody,

The following script:

use Win32::TieRegistry;

eval {
my $key = $Win32::TieRegistry::Registry->{
'HKEY_LOCAL_MACHINE\\SOFTWARE' };
die;
};
if( $@ ) {
print "Exception caught: $@\n";
}
else {
print "OK\n";
}

...surprisingly prints out

"OK"

 instead of, what you would expect:

"Exception caught: Died at regerr.pl line 5."

This is because of a unpleasant behavior of Perl itself: "die" immediately
sets $@, and
THEN all local objects' DESTROY methods are called (in this case, in order
to destroy "$key"). Win32::TieRegistry's DESTROY executes an eval that
- most probably not deliberately - overwrites $@ with "".  Thus, the
script's
eval block is left, but the original exception never reaches the script's
exception handler.
The exception has seemingly mysteriously disappeared.
I have submitted a bug report for the Perl core - nevertheless I think
that Win32::TieRegistry should be changed. The current behavior leads
to problems that are quite hard to track down.

The solution I found was to localize $@ in the DESTROY method, so it won't
change
the global value set by a previous "die" statement:

--- TieRegistry.pm.orig Sun Sep 29 10:36:27 2002
+++ TieRegistry.pm  Sun Sep 29 11:42:13 2002
@@ -1484,6 +1484,7 @@
 my $self= shift(@_);
 return   if  tied(%$self);
 my $unload;
+local $@;
 eval { $unload= $self->{UNLOADME}; 1 }
or  return;
 my $debug= $ENV{DEBUG_TIE_REGISTRY};

I have also added a test case to test.pl:

--- test.pl.origSun Sep 29 10:37:36 2002
+++ test.pl Sun Sep 29 10:59:44 2002
@@ -31,6 +31,13 @@
 print '# $val->[0] is "',$val->[0],'".',$/   if  $Debug;
 print $val->[0] =~ /^0x[\da-f]{8}$/i ? "" : "not ", "ok 4\n";

+eval {
+my $reg2 = $reg->{ 'HKEY_LOCAL_MACHINE/Software' };
+die "catch this exception!";
+};
+print $@ =~ /catch this/ ? "" : "not ", "ok 5\n";
+
 # This doesn't work unless you have the SetDualVar
 # module installed so just don't test it for now:
-# print 0+$val->[0] == hex($val->[0]) ? "" : "not ", "ok 5\n";
+# print 0+$val->[0] == hex($val->[0]) ? "" : "not ", "ok 6\n";
+

(BTW, the test cases 3 and 4 elsewhere in the test script
fail on my Windows 2000 machine because the referenced key has the type
REG_BINARY,
not REG_DWORD as expected)

Now I really think that a new version of Win32::TieRegistry should be
published
in CPAN. What has to be done in order to achieve this?

Best regards,
  Burkhard


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Bug in Win32::TieRegistry: DESTROY overwrites $@

2002-10-04 Thread Burkhard Meier

Hello Tye, hello everybody,

The following script:

use Win32::TieRegistry;

eval {
my $key = $Win32::TieRegistry::Registry->{
'HKEY_LOCAL_MACHINE\\SOFTWARE' };
die;
};
if( $@ ) {
print "Exception caught: $@\n";
}
else {
print "OK\n";
}

...surprisingly prints out

"OK"

 instead of, what you would expect:

"Exception caught: Died at regerr.pl line 5."

This is because of a unpleasant behavior of Perl itself: "die" immediately
sets $@, and
THEN all local objects' DESTROY methods are called (in this case, in order
to destroy "$key"). Win32::TieRegistry's DESTROY executes an eval that
- most probably not deliberately - overwrites $@ with "".  Thus, the
script's
eval block is left, but the original exception never reaches the script's
exception handler.
The exception has seemingly mysteriously disappeared.
I have submitted a bug report for the Perl core - nevertheless I think
that Win32::TieRegistry should be changed. The current behavior leads
to problems that are quite hard to track down.

The solution I found was to localize $@ in the DESTROY method, so it won't
change
the global value set by a previous "die" statement:

--- TieRegistry.pm.orig Sun Sep 29 10:36:27 2002
+++ TieRegistry.pm  Sun Sep 29 11:42:13 2002
@@ -1484,6 +1484,7 @@
 my $self= shift(@_);
 return   if  tied(%$self);
 my $unload;
+local $@;
 eval { $unload= $self->{UNLOADME}; 1 }
or  return;
 my $debug= $ENV{DEBUG_TIE_REGISTRY};

I have also added a test case to test.pl:

--- test.pl.origSun Sep 29 10:37:36 2002
+++ test.pl Sun Sep 29 10:59:44 2002
@@ -31,6 +31,13 @@
 print '# $val->[0] is "',$val->[0],'".',$/   if  $Debug;
 print $val->[0] =~ /^0x[\da-f]{8}$/i ? "" : "not ", "ok 4\n";

+eval {
+my $reg2 = $reg->{ 'HKEY_LOCAL_MACHINE/Software' };
+die "catch this exception!";
+};
+print $@ =~ /catch this/ ? "" : "not ", "ok 5\n";
+
 # This doesn't work unless you have the SetDualVar
 # module installed so just don't test it for now:
-# print 0+$val->[0] == hex($val->[0]) ? "" : "not ", "ok 5\n";
+# print 0+$val->[0] == hex($val->[0]) ? "" : "not ", "ok 6\n";
+

(BTW, the test cases 3 and 4 elsewhere in the test script
fail on my Windows 2000 machine because the referenced key has the type
REG_BINARY,
not REG_DWORD as expected)

Now I really think that a new version of Win32::TieRegistry should be
published
in CPAN. What has to be done in order to achieve this?

Best regards,
  Burkhard


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Removing icons from the systemtray when using Win32::GUI

2002-10-04 Thread Champ Echols

I have written a perl app using Tk and Win32::GUI. Win32::GUI is used solely
to place an icon in the systemtray.  All works as planed except for the bug
in Win32::GUI that leaves the icon in the systemtray when the app is closed.
The notes for Win32::GUI indicate that this is a bug and to explicitly
remove the icon from the systemtray.  Does anyone know how to explicitly
remove an icon from the systemtray during application shutdown?

C. Echols


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



(no subject)

2002-10-04 Thread Champ Echols

I have written a perl app using Tk and Win32::GUI. Win32::GUI is used solely
to place an icon in the systemtray.  All works as planed except for the bug
in Win32::GUI that leaves the icon in the systemtray when the app is closed.
The notes for Win32::GUI indicate that this is a bug and to explicitly
remove the icon from the systemtray.  Does anyone know how to explicitly
remove an icon from the systemtray during application shutdown?

C. Echols


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Security descriptor using WMI

2002-10-04 Thread Jangale V-S

Hi all,

We are in the process of moving to W2K. In the process the filestructure
will be transferred to W2K server with existing security rights !

We need to change those rights with following changes.

1) Change name of domain from old to new one.
2) Change name of group/user to corresponding group/user in W2K .
(The mapping between current group/user vs group/user in W2k is
available)

Now requirement is to write script which will get current access right on
directory,
change domain and group/user in security descriptor,remove existing
permissions
on folder and apply new permissions as per above changes !!

I can get current security descriptor using WMI. The problem is changing
domain name
and groups/user in this security descriptor.

Can somebody guide me ??

With Best Regards,


V.S. Jangale,

___
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Win32::Job/Process - maintaining constant number of sub-processes

2002-10-04 Thread Gould, Kevin








Be sure and wait against your sub processes.  When they’re done, that will
ensure they clear.  Disclaimer: I cut
this out of something I wrote and cleaned it up for consumption so I may have
missed something here and there in the cleanup.

 

Something like this:

 

foreach $Something ($Somelist)

  { 

if (scalar(keys %PidList)
< $Parms{MaxThreads})

 {

 

    print  "Creating
a thread for $Something\n”;

 

    if ($ForkResult=fork)

       {

     print
"Adding $ForkResult to thread tracking list\n";

     #Keep the PID to track

     $PidList{$ForkResult}=$Something;

       } elsif
(defined $ForkResult)

       {

     #We're
the child

     print
"Childthread: Thread is executing a process $Something\n";

     &Process; -àcall some subroutine you want to do.

     exit;

       }else

       {

     &Mainlog ("Unknown error forking: $!
$^E","FATAL");

       }

 

 } else 

 {

    print "Maximum copy operations in progress ($Parms{MaxThreads}) - waiting 5
seconds for some to complete\n";

    #
We have the maximum number of processes executing -
wait for interval then try again.

    sleep 5;

 

    #
Wait against the children

    &WaitCopies;

 

    #Look
again to see if we can start more copies

    redo Begin;

 }

 

}

 

print "No more pending copy operations
queued - waiting for completion of operations in progress\n";

 

# Wait on all the executing processes

while (scalar (keys %PidList)
!= 0 ) 

 
{

print "Waiting for copies to complete:
",scalar (keys %PidList)," in progress\n";

    sleep 5;

   
&WaitCopies;

   

 
}

 

# We’re done

 

sub WaitCopies

  {

    foreach $Process (keys %PidList) 

    {

 

      $Result = waitpid( $Process,
&POSIX::WNOHANG );

       if
($Result==-1) {

 
$Result = waitpid( $Process, &POSIX::WNOHANG );

 
print "Process $Process ($PidList{$Process}) complete\n";

 
delete $PidList{$Process};

        } else

   
{

  
 print
"Process $Process ($PidList{$Process}) still
active\n";

   
}

    }

}

 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 26, 2002 11:56 AM
To:
[EMAIL PROTECTED]
Subject: Win32::Job/Process
- maintaining constant number of sub-processes

 

Hi all,

 

I'd really
appreciate any help with a problem I am having. 

 

I am trying to
achieve the following basic logic in Perl on W2k Server...

 

·
When it starts,
my script spawns a pre-defined number (10) of identical sub-processes 

·
It then
continuously loops back every few seconds to check if any have completed

·
If a processes
has completed, it spawns another instance to replace it

·
And so on

 

I have tried using
Win32::Process and that works well, but when the script terminates the
sub-processes continue to run (detatched).

 

Reading the
documentation it seems to me that Win32:Job is more suitable my rough attempt
at coding (below) is even worse that the version using Win32::Process - it does
what is described above using the "watch" method to keep an eye on
the spawned processes and starting new ones as required. 

 

But the problem is,
when the last of the 10 originally spawned processes exits, the entire script
exits and all the sub-processes die with it rather than continuing to spawning
new processes until I decide for some arbitrary reason to exit and kill the
entire process tree. 

 

Has anybody got any
pointers as to how I can add new processes to a Win32::Job structure and have
them included in the "watch" method?

 

Thanks.

 

Barry Caruth.

 

--- code starts here ---

 

use strict;

use warnings;

use Win32::Job;

 

# Use sleep.exe from resource kit to hide complexity of real process

our $exe_path = "c:\\program files\\resource kit\\sleep.exe"; 

 

our $count = 0;

my $return = 0;

our %pid_hash = ();

 

our $job = Win32::Job->new or die $!;

 

while( $count < 10 ) # Max number of threads

{

  &start_process;

  $count++;

};

 

while ($return == 0) {

  sleep 2;

  $return =
$job->watch(\&handler,2,1);

};

 

print "done\n";

 

 

sub start_process {

 

  my $pid;

  $pid = $job->spawn( $exe_path,
"sleep " . (5 * ($count+1))) or die $!;

  $pid_hash{$pid} = "";

  print "Process $pid
Started\n"; 

  

};

 

sub handler {

 

  my $status;

  my $pid;

  my $value;

  my $exitcode = 0;

  

  $status = $job->status();

  

  foreach $pid (keys %$status) {

   
$exitcode = $$status{$pid}{exitcode};

    

    if ($exitcode
!= 259) {

 
if (exists $pid_hash{$pid}) {


Setting NTFS Permission with ADSI and Perl

2002-10-04 Thread Lawrence, Rob
Title: Setting NTFS Permission with ADSI and Perl





I have converted a vbscript (below) to perl to Set NTFS Permissions on a folder.  It all works except the snip below.  In this part I am trying to do is remove all objects except the administrators group.  Suspect there is some kind of data type issue.  The foreach only runs once and $ace->{Trustee} returns nothing.  Using Vbscript ace->{Trustee} would return DOMAIN\Username.  I have tried using Strings, Hashes, and Arrays and none of them return what I need...

I know there are perl modules that work but I would rather not use any additional modules, mainly since with adsi I am directly calling from M$'s APIs'.

Any Input is appreciated!


-Rob



-snip--
     my $oDacl;
    @oDacl =  $oFileSD->DiscretionaryACL;
 foreach $ace(@oDacl)
      {
        print "$ace->{Trustee}\n";
        if( $ace->{Trustee} != "BUILTIN\\Administrators")
          {
              print "Removing $ace\n";
     @oDacl->RemoveAce($ace);
          }
      $oFileSD->{DiscretionaryACL} = @oDacl;
      }  



--snip



The rest of the script works fine, it Sets and reorders the ACL in their proper sequence.




-- Begin Script ---


use Win32::OLE;


#
# Define a ADS_RIGHTS_ENUM constants:
#
  $ADS_RIGHT_DELETE = 0x1;
  $ADS_RIGHT_READ_CONTROL   = 0x2;
  $ADS_RIGHT_WRITE_DAC  = 0x4;
  $ADS_RIGHT_WRITE_OWNER    = 0x8;
  $ADS_RIGHT_SYNCHRONIZE    = 0x10;
  $ADS_RIGHT_ACCESS_SYSTEM_SECURITY = 0x100;
  $ADS_RIGHT_GENERIC_READ   = 0x8000;
  $ADS_RIGHT_GENERIC_WRITE  = 0x4000;
  $ADS_RIGHT_GENERIC_EXECUTE    = 0x2000;
  $ADS_RIGHT_GENERIC_ALL    = 0x1000;
  $ADS_RIGHT_DS_CREATE_CHILD    = 0x1;
  $ADS_RIGHT_DS_DELETE_CHILD    = 0x2;
  $ADS_RIGHT_ACTRL_DS_LIST  = 0x4;
  $ADS_RIGHT_DS_SELF    = 0x8;
  $ADS_RIGHT_DS_READ_PROP   = 0x10;
  $ADS_RIGHT_DS_WRITE_PROP  = 0x20;
  $ADS_RIGHT_DS_DELETE_TREE = 0x40;
  $ADS_RIGHT_DS_LIST_OBJECT = 0x80;
  $ADS_RIGHT_DS_CONTROL_ACCESS  = 0x100;
# 
# 
# ADS_ACETYPE_ENUM
# Ace Type definitions
#
  $ADS_ACETYPE_ACCESS_ALLOWED   = 0;
  $ADS_ACETYPE_ACCESS_DENIED    = 0x1;
  $ADS_ACETYPE_SYSTEM_AUDIT = 0x2;
  $ADS_ACETYPE_ACCESS_ALLOWED_OBJECT    = 0x5;
  $ADS_ACETYPE_ACCESS_DENIED_OBJECT = 0x6;
  $ADS_ACETYPE_SYSTEM_AUDIT_OBJECT  = 0x7;
#
#
# ADS_ACEFLAGS_ENUM
# Ace Flag Constants
#
 $ADS_ACEFLAG_UNKNOWN  = 0x1;
 $ADS_ACEFLAG_INHERIT_ACE  = 0x2;
 $ADS_ACEFLAG_NO_PROPAGATE_INHERIT_ACE = 0x4;
 $ADS_ACEFLAG_INHERIT_ONLY_ACE = 0x8;
 $ADS_ACEFLAG_INHERITED_ACE    = 0x10;
 $ADS_ACEFLAG_VALID_INHERIT_FLAGS  = 0x1f;
 $ADS_ACEFLAG_SUCCESSFUL_ACCESS    = 0x40;
 $ADS_ACEFLAG_FAILED_ACCESS    = 0x80;
#  
#'--
#' Delete the EveryOne Ace from the DACL
#'
sub DeleteEveryoneAce(@oSd)
{
 my $oDacl;
    $oDacl =  @oSd->DiscretionaryACL;


 foreach $ace($oDacl)
      {
        print "$ace->{Trustee}\n";
        if( $ace->{Trustee} != "BUILTIN\\Administrators")
          {
              print "Removing $ace\n";
     $oDacl->RemoveAce($ace);
          }
      $oSd->{DiscretionaryACL} = $oDacl;
      }  


}
#==
# Sub to reorder an ACL
# Comments in the subroutine explain how the ACL should be ordered.
# The IADsAccessControlList::AddAce method makes not attempt to properly
# order the ACE being added.
#
sub ReorderDacl(@dacl)
{
   #
   # Initialize all of the new ACLs
   #
   # VBS methods of creating the ACL bins
   #
    $newdacl = Win32::OLE->CreateObject("AccessControlList");
    $ImpDenyDacl = Win32::OLE->CreateObject("AccessControlList");
    $InheritedDacl = Win32::OLE->CreateObject("AccessControlList");
    $ImpAllowDacl = Win32::OLE->CreateObject("AccessControlList");
    $InhAllowDacl = Win32::OLE->CreateObject("AccessControlList");
    $ImpDenyObjectDacl = Win32::OLE->CreateObject("AccessControlList");
    $ImpAllowObjectDacl = Win32::OLE->CreateObject("AccessControlList");
   #
   # Sift the DACL into 5 bins:
   # Inherited Aces
   # Implicit Deny Aces
   # Implicit Deny Object Aces
   # Implicit Allow Aces
   # Implicit Allow object aces
   #
   foreach $ace(@dacl)
    {
  # Sort the original ACEs into their appropriate 
  # ACLs 
  #
     
  if (($ace->{AceFlags} && $ADS_ACEFL

Re: #defines ? or Constant Data in perl ?

2002-10-04 Thread Andie Kirkpatrick

What I tend to do, though its only partly satisfactory, is to use a reference to a 
constant.

my $PI=\3.141592654;
print "PI is $$PI\n";
$$PI=4; # Modification of a read-only value attempted at...

# Problem is you can assign the reference to something else
$PI=\4; # Works just fine only the laws of physics break down

HTH
Andie

> - Original Message -
> From: "Story, Lenny" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, September 23, 2002 7:23 PM
> Subject: #defines ? or Constant Data in perl ?
>
>
> > Greetings,
> >
> > Is there some such way to define a constant, or #define style
> > variable in perl ?
> >
> > I  typically have the need to define data which is just to
> > eliminate the need for "magic" numbers etc.
> >
> > thus far i have just defined variables such as :
> >
> > my $WELCOME_MSG = "Hello!";
> > print $WELCOME_MSG;
> >
> >
> > Which does work, but is not really what i want...
> >
> > Any ideas anyone ?
> >
> > Thanks,
> > Lenny
> >
> >
> > -Lenny
> > [EMAIL PROTECTED]
> >


"I have seen the future and it licks itself clean."
 - Bucky Katt

___

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Net::ParseWhois

2002-10-04 Thread iCap

Hello,
I'd like to set up a domain search tool to display registrar information on
domains.  I've tried using Net::ParsWhois and am seeing several conflicts
with Netsol's whois service, even though the documentation states it is
looking at www.networksolutions.com.
Does anyone know of a more precise module or solution?

Thanks,
Kirk


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: $Rc = system('D:/ftproot/edi/finqas.bat $invoice');

2002-10-04 Thread Khan, Moin
Title: RE: $Rc = system('D:/ftproot/edi/finqas.bat $invoice');





use " " instead of ' '


-Original Message-
From: Carl Jolley [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 20, 2002 12:49 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: $Rc = system('D:/ftproot/edi/finqas.bat $invoice');



On Fri, 20 Sep 2002 [EMAIL PROTECTED] wrote:


> My problem is in this line [$Rc = system('D:/ftproot/edi/finqas.bat
> $invoice');]
> I'm trying to invoke a batch file, and have VARIABLE $invoice with
> differnt values.
> In finqas.bat I also have %1 witch has to be substituted by the value
> of $invoice.
> Instead of substituting the value of $invoice, it puts "$invoice"
>
>
> HERE IS MY CODE.
>
> my $From = 'D:/ftproot/edi/tmp/finqas';
> my $To = 'S:/finqas';
>
> opendir INVOICES, 'D:/ftproot/edi/tmp/finqas' or die "cannot opendir
> invoices: $!";
> while (my $invoice = readdir INVOICES)
>    {
>   next unless -f "D:/ftproot/edi/tmp/finqas/$invoice" ;
>
>   rename ("$From/$invoice", "$To/$invoice") or warn "rename: $!";
>
>  $Rc = system('D:/ftproot/edi/finqas.bat $invoice');
>   print "$Rc\n" ;
>
>    }
> closedir INVOICES or warn "can't closedir INVOICES: $!";


The $invoice variable will not be interpolated (be replace with
its value) if it appears in a single quoted string.


 [EMAIL PROTECTED] 
 All opinions are my own and not necessarily those of my employer 


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs





Setting NTFS Permission with ADSI and Perl

2002-10-04 Thread Lawrence, Rob
Title: Setting NTFS Permission with ADSI and Perl





I have converted a vbscript (below) to perl to Set NTFS Permissions on a folder.  It all works except the snip below.  In this part I am trying to do is remove all objects except the administrators group.  Suspect there is some kind of data type issue.  The foreach only runs once and $ace->{Trustee} returns nothing.  Using Vbscript ace->{Trustee} would return DOMAIN\Username.  I have tried using Strings, Hashes, and Arrays and none of them return what I need...

I know there are perl modules that work but I would rather not use any additional modules, mainly since with adsi I am directly calling from M$'s APIs'.

Any Input is appreciated!


-Rob



-snip--
     my $oDacl;
    @oDacl =  $oFileSD->DiscretionaryACL;
 foreach $ace(@oDacl)
      {
        print "$ace->{Trustee}\n";
        if( $ace->{Trustee} != "BUILTIN\\Administrators")
          {
              print "Removing $ace\n";
     @oDacl->RemoveAce($ace);
          }
      $oFileSD->{DiscretionaryACL} = @oDacl;
      }  



--snip



The rest of the script works fine, it Sets and reorders the ACL in their proper sequence.




-- Begin Script ---


use Win32::OLE;


#
# Define a ADS_RIGHTS_ENUM constants:
#
  $ADS_RIGHT_DELETE = 0x1;
  $ADS_RIGHT_READ_CONTROL   = 0x2;
  $ADS_RIGHT_WRITE_DAC  = 0x4;
  $ADS_RIGHT_WRITE_OWNER    = 0x8;
  $ADS_RIGHT_SYNCHRONIZE    = 0x10;
  $ADS_RIGHT_ACCESS_SYSTEM_SECURITY = 0x100;
  $ADS_RIGHT_GENERIC_READ   = 0x8000;
  $ADS_RIGHT_GENERIC_WRITE  = 0x4000;
  $ADS_RIGHT_GENERIC_EXECUTE    = 0x2000;
  $ADS_RIGHT_GENERIC_ALL    = 0x1000;
  $ADS_RIGHT_DS_CREATE_CHILD    = 0x1;
  $ADS_RIGHT_DS_DELETE_CHILD    = 0x2;
  $ADS_RIGHT_ACTRL_DS_LIST  = 0x4;
  $ADS_RIGHT_DS_SELF    = 0x8;
  $ADS_RIGHT_DS_READ_PROP   = 0x10;
  $ADS_RIGHT_DS_WRITE_PROP  = 0x20;
  $ADS_RIGHT_DS_DELETE_TREE = 0x40;
  $ADS_RIGHT_DS_LIST_OBJECT = 0x80;
  $ADS_RIGHT_DS_CONTROL_ACCESS  = 0x100;
# 
# 
# ADS_ACETYPE_ENUM
# Ace Type definitions
#
  $ADS_ACETYPE_ACCESS_ALLOWED   = 0;
  $ADS_ACETYPE_ACCESS_DENIED    = 0x1;
  $ADS_ACETYPE_SYSTEM_AUDIT = 0x2;
  $ADS_ACETYPE_ACCESS_ALLOWED_OBJECT    = 0x5;
  $ADS_ACETYPE_ACCESS_DENIED_OBJECT = 0x6;
  $ADS_ACETYPE_SYSTEM_AUDIT_OBJECT  = 0x7;
#
#
# ADS_ACEFLAGS_ENUM
# Ace Flag Constants
#
 $ADS_ACEFLAG_UNKNOWN  = 0x1;
 $ADS_ACEFLAG_INHERIT_ACE  = 0x2;
 $ADS_ACEFLAG_NO_PROPAGATE_INHERIT_ACE = 0x4;
 $ADS_ACEFLAG_INHERIT_ONLY_ACE = 0x8;
 $ADS_ACEFLAG_INHERITED_ACE    = 0x10;
 $ADS_ACEFLAG_VALID_INHERIT_FLAGS  = 0x1f;
 $ADS_ACEFLAG_SUCCESSFUL_ACCESS    = 0x40;
 $ADS_ACEFLAG_FAILED_ACCESS    = 0x80;
#  
#'--
#' Delete the EveryOne Ace from the DACL
#'
sub DeleteEveryoneAce(@oSd)
{
 my $oDacl;
    $oDacl =  @oSd->DiscretionaryACL;


 foreach $ace($oDacl)
      {
        print "$ace->{Trustee}\n";
        if( $ace->{Trustee} != "BUILTIN\\Administrators")
          {
              print "Removing $ace\n";
     $oDacl->RemoveAce($ace);
          }
      $oSd->{DiscretionaryACL} = $oDacl;
      }  


}
#==
# Sub to reorder an ACL
# Comments in the subroutine explain how the ACL should be ordered.
# The IADsAccessControlList::AddAce method makes not attempt to properly
# order the ACE being added.
#
sub ReorderDacl(@dacl)
{
   #
   # Initialize all of the new ACLs
   #
   # VBS methods of creating the ACL bins
   #
    $newdacl = Win32::OLE->CreateObject("AccessControlList");
    $ImpDenyDacl = Win32::OLE->CreateObject("AccessControlList");
    $InheritedDacl = Win32::OLE->CreateObject("AccessControlList");
    $ImpAllowDacl = Win32::OLE->CreateObject("AccessControlList");
    $InhAllowDacl = Win32::OLE->CreateObject("AccessControlList");
    $ImpDenyObjectDacl = Win32::OLE->CreateObject("AccessControlList");
    $ImpAllowObjectDacl = Win32::OLE->CreateObject("AccessControlList");
   #
   # Sift the DACL into 5 bins:
   # Inherited Aces
   # Implicit Deny Aces
   # Implicit Deny Object Aces
   # Implicit Allow Aces
   # Implicit Allow object aces
   #
   foreach $ace(@dacl)
    {
  # Sort the original ACEs into their appropriate 
  # ACLs 
  #
     
  if (($ace->{AceFlags} && $ADS_ACEFL

Setting NTFS Permission with ADSI and Perl

2002-10-04 Thread Lawrence, Rob
Title: Setting NTFS Permission with ADSI and Perl





I have converted a vbscript (below) to perl to Set NTFS Permissions on a folder.  It all works except the snip below.  In this part I am trying to do is remove all objects except the administrators group.  Suspect there is some kind of data type issue.  The foreach only runs once and $ace->{Trustee} returns nothing.  Using Vbscript ace->{Trustee} would return DOMAIN\Username.  I have tried using Strings, Hashes, and Arrays and none of them return what I need...

I know there are perl modules that work but I would rather not use any additional modules, mainly since with adsi I am directly calling from M$'s APIs'.

Any Input is appreciated!


-Rob



-snip--
     my $oDacl;
    @oDacl =  $oFileSD->DiscretionaryACL;
 foreach $ace(@oDacl)
      {
        print "$ace->{Trustee}\n";
        if( $ace->{Trustee} != "BUILTIN\\Administrators")
          {
              print "Removing $ace\n";
     @oDacl->RemoveAce($ace);
          }
      $oFileSD->{DiscretionaryACL} = @oDacl;
      }  



--snip



The rest of the script works fine, it Sets and reorders the ACL in their proper sequence.




-- Begin Script ---


use Win32::OLE;


#
# Define a ADS_RIGHTS_ENUM constants:
#
  $ADS_RIGHT_DELETE = 0x1;
  $ADS_RIGHT_READ_CONTROL   = 0x2;
  $ADS_RIGHT_WRITE_DAC  = 0x4;
  $ADS_RIGHT_WRITE_OWNER    = 0x8;
  $ADS_RIGHT_SYNCHRONIZE    = 0x10;
  $ADS_RIGHT_ACCESS_SYSTEM_SECURITY = 0x100;
  $ADS_RIGHT_GENERIC_READ   = 0x8000;
  $ADS_RIGHT_GENERIC_WRITE  = 0x4000;
  $ADS_RIGHT_GENERIC_EXECUTE    = 0x2000;
  $ADS_RIGHT_GENERIC_ALL    = 0x1000;
  $ADS_RIGHT_DS_CREATE_CHILD    = 0x1;
  $ADS_RIGHT_DS_DELETE_CHILD    = 0x2;
  $ADS_RIGHT_ACTRL_DS_LIST  = 0x4;
  $ADS_RIGHT_DS_SELF    = 0x8;
  $ADS_RIGHT_DS_READ_PROP   = 0x10;
  $ADS_RIGHT_DS_WRITE_PROP  = 0x20;
  $ADS_RIGHT_DS_DELETE_TREE = 0x40;
  $ADS_RIGHT_DS_LIST_OBJECT = 0x80;
  $ADS_RIGHT_DS_CONTROL_ACCESS  = 0x100;
# 
# 
# ADS_ACETYPE_ENUM
# Ace Type definitions
#
  $ADS_ACETYPE_ACCESS_ALLOWED   = 0;
  $ADS_ACETYPE_ACCESS_DENIED    = 0x1;
  $ADS_ACETYPE_SYSTEM_AUDIT = 0x2;
  $ADS_ACETYPE_ACCESS_ALLOWED_OBJECT    = 0x5;
  $ADS_ACETYPE_ACCESS_DENIED_OBJECT = 0x6;
  $ADS_ACETYPE_SYSTEM_AUDIT_OBJECT  = 0x7;
#
#
# ADS_ACEFLAGS_ENUM
# Ace Flag Constants
#
 $ADS_ACEFLAG_UNKNOWN  = 0x1;
 $ADS_ACEFLAG_INHERIT_ACE  = 0x2;
 $ADS_ACEFLAG_NO_PROPAGATE_INHERIT_ACE = 0x4;
 $ADS_ACEFLAG_INHERIT_ONLY_ACE = 0x8;
 $ADS_ACEFLAG_INHERITED_ACE    = 0x10;
 $ADS_ACEFLAG_VALID_INHERIT_FLAGS  = 0x1f;
 $ADS_ACEFLAG_SUCCESSFUL_ACCESS    = 0x40;
 $ADS_ACEFLAG_FAILED_ACCESS    = 0x80;
#  
#'--
#' Delete the EveryOne Ace from the DACL
#'
sub DeleteEveryoneAce(@oSd)
{
 my $oDacl;
    $oDacl =  @oSd->DiscretionaryACL;


 foreach $ace($oDacl)
      {
        print "$ace->{Trustee}\n";
        if( $ace->{Trustee} != "BUILTIN\\Administrators")
          {
              print "Removing $ace\n";
     $oDacl->RemoveAce($ace);
          }
      $oSd->{DiscretionaryACL} = $oDacl;
      }  


}
#==
# Sub to reorder an ACL
# Comments in the subroutine explain how the ACL should be ordered.
# The IADsAccessControlList::AddAce method makes not attempt to properly
# order the ACE being added.
#
sub ReorderDacl(@dacl)
{
   #
   # Initialize all of the new ACLs
   #
   # VBS methods of creating the ACL bins
   #
    $newdacl = Win32::OLE->CreateObject("AccessControlList");
    $ImpDenyDacl = Win32::OLE->CreateObject("AccessControlList");
    $InheritedDacl = Win32::OLE->CreateObject("AccessControlList");
    $ImpAllowDacl = Win32::OLE->CreateObject("AccessControlList");
    $InhAllowDacl = Win32::OLE->CreateObject("AccessControlList");
    $ImpDenyObjectDacl = Win32::OLE->CreateObject("AccessControlList");
    $ImpAllowObjectDacl = Win32::OLE->CreateObject("AccessControlList");
   #
   # Sift the DACL into 5 bins:
   # Inherited Aces
   # Implicit Deny Aces
   # Implicit Deny Object Aces
   # Implicit Allow Aces
   # Implicit Allow object aces
   #
   foreach $ace(@dacl)
    {
  # Sort the original ACEs into their appropriate 
  # ACLs 
  #
     
  if (($ace->{AceFlags} && $ADS_ACEFL

RE: Dave Roth's web site

2002-10-04 Thread Timothy Johnson


If you are copying modules from one Win32 system to another, then it's as
simple as copying your perl directory.  If you are moving the files from
Win32 to Linux, forget about it.  You should just reinstall.

-Original Message-
From: Carroll, Shawn [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 1:08 PM
To: 'Timothy Johnson'; 'Edgington, Jeff'; [EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: Dave Roth's web site


While we're on the topic of modules...

I've managed to accumulate modules from many different places, and they're
all installed on one machine.  I want the same modules on a different
machine.  Rather than get them from a bunch of different repositories all
over again, what's the best way to replicate the modules on the new machine?
Is it as simple as copying over a directory?  Or are they "registered" or
otherwise installed somehow?  


Also, anything to worry about if the modules are copied from a Win32 machine
to a Linux machine?


Shawn

# -Original Message-
# From: Timothy Johnson [mailto:[EMAIL PROTECTED]]
# Sent: Wednesday, September 18, 2002 3:54 PM
# To: 'Edgington, Jeff'; [EMAIL PROTECTED];
# [EMAIL PROTECTED];
# [EMAIL PROTECTED];
# [EMAIL PROTECTED]
# Subject: RE: Dave Roth's web site
# 
# 
# 
# And if you want to set up his repository permanently in PPM, do this:
# 
# PPM> set repository dave http://www.roth.net/perl/packages
# PPM> set save
# 
# I also recommend checking out the repository at
# http://jenda.krynicky.cz/perl
# 
# -Original Message-
# From: Edgington, Jeff [mailto:[EMAIL PROTECTED]]
# Sent: Wednesday, September 18, 2002 12:45 PM
# To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
# [EMAIL PROTECTED];
# [EMAIL PROTECTED]
# Subject: RE: Dave Roth's web site
# 
# 
# ppm install http://www.roth.net/perl/packages/win32-daemon.ppd
# 
# 
# 
# -Original Message-
# From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
# Sent: Wednesday, September 18, 2002 2:39 PM
# To: [EMAIL PROTECTED];
# [EMAIL PROTECTED];
# [EMAIL PROTECTED]
# Subject: Dave Roth's web site
# 
# 
# Does anybody know Dave's web?
# 
# I want to download daemon.pm on his web.
# 
# Thanks a lot in advance!
# 
# Lixin
# ___
# Perl-Win32-Admin mailing list
# [EMAIL PROTECTED]
# To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
# ___
# Perl-Win32-Admin mailing list
# [EMAIL PROTECTED]
# To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
# ___
# Perl-Win32-Admin mailing list
# [EMAIL PROTECTED]
# To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
# 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: FTP using Win32:Internet

2002-10-04 Thread Nakamura, Hisashi

Thank you, Trevor.
Your sample is helpful.
However, the timeout value I set doesn't do.
The timeout occurs in 45 seconds regardless of the timeout value.

Apart from this, how can we change the directory of local host, which we can
do it by "lcd" command when executing FTP by windows/NT commands?

Thanks,

H.Nakamura

-Original Message-
From: Trevor Joerges [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 19, 2002 1:37 AM
To: Nakamura, Hisashi; [EMAIL PROTECTED]
Subject: Re: FTP using Win32:Internet


Yes - check to see if the condition was successful. If it isn't then do
something and continue.
i.e:

foreach $ftpserver (@ftpservers) {
if (!$ftp = Net::FTP->new($host, Debug => 0, Port => 21, Passive =>
True, Timeout => 60)) {
# do something like write to log file
}
else {
next;
}
}

You'll probably want to put this type or a similar success check around
most/all your ftp commands if you are expecting to catch failures and
continue to the next server upon a failure.

Hope this helps.
Kind regards,
Trevor J. Joerges

$_=q;rrUSFWPSZK.ZKPFSHFT,rkvtuZbopuifsZQZibdl
rrqpxfsfeZcyZQ,,riuuq://xxx.%.dpn,ru~@%.dpn ,rrr8-)
;;s;\~;kpfshft;g;s;\%;tfoenjnf;g;y;B-x;A-w;;
s;P;perl;g;s;,;\n;g;s;Y; ;g;s;q;\t;g;print;



- Original Message -
From: "Nakamura, Hisashi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 04, 2002 5:55 AM
Subject: FTP using Win32:Internet


| I want to write a script which performs FTP function using Win32:Internet.
| The function of the script will be sending files to several remote servers
| one by one.
| The problem is that when the connection to the first server failed, the
| program stopped and doesn't move on to the connection to the next server.
| How can I solve this problem?
|
| *
| Hisashi Nakamura
| Systems-Sales Engineer
| Dow Jones (Japan)
| Phone +81-3-5220-2739
| FAX+81-3-5220-2746
| *
| ___
| Perl-Win32-Users mailing list
| [EMAIL PROTECTED]
| To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: ADSVW.exe not giving me any properties

2002-10-04 Thread Norris, Joseph

Heaven forbid if ol'bill got his hands into the PERL pie... Larry and Co.
have done the best job of keeping this in the hands of the programmers and
developers with not closed doors!!! (getting off soapbox :)

-Original Message-
From: Richard A. Nakroshis [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 04, 2002 9:29 AM
To: Norris, Joseph
Cc: Perl Win32 Users (E-mail)
Subject: Re: ADSVW.exe not giving me any properties


"Norris, Joseph" wrote:
> 
> The ultimate goal is to just be able to update the telephoneNumber in the
> active directory - WHY DOES BILL MAKE SO HARD!

I imagine it all boils down to NIH:  The 'Not Invented Here' Syndrome.

Because it's not Microsoft Perl, they don't need to support it.

Rick
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: XL 2 CSV (Unicode 8)

2002-10-04 Thread Steve Combs

> From: "Darren S. Eyers" <[EMAIL PROTECTED]>
> Subject: XL 2 CSV (Unicode 8)
> Date: Thu, 3 Oct 2002 18:39:45 +0100
> Organization: Datawest Ltd
>
> Hi All,
> Anyone know how to extract data held in MS Excel into csv but keeping
> the special characters like the Trade Mark Symbol, 3/4 symbol etc?

I use Spreadsheet-ParseExcel under ASP to process uploaded .XLS files.
If your Trade and 3/4 symbols are one-byte ascii chr(174) and chr(190),
they will be handled correctly.  I don't think that Unicode is supported.

Here's the guts of a PerlScript to convert an .XLS file to CSV.

require Spreadsheet::ParseExcel;
import  Spreadsheet::ParseExcel;
$oExcel = new Spreadsheet::ParseExcel;
$oBook  = $oExcel->Parse(\$XLS_Binary_Data);
$oWkS   = $oBook->{Worksheet}[0];
for (my $iR=$oWkS->{MinRow}; defined $oWkS->{MaxRow} &&
$iR<=$oWkS->{MaxRow}; $iR++) {
   for (my $iC=$oWkS->{MinCol}; defined
$oWkS->{MaxCol}&&$iC<=$oWkS->{MaxCol}; $iC++) {
  $oWkC = $oWkS->{Cells}[$iR][$iC];
  $CSV_Text_Data.=($iC>0?",":"");
  if ($oWkC) {
 $v=$oWkC->Value;
 $v=~s/"/""/g;
 $v="\"$v\"" if $v=~/[",]/;
 $CSV_Text_Data.=$v;
  }
   }
   $CSV_Text_Data.="\n";
}
$Response->write("$CSV_Text_Data\n");

--Steve

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Re: ADSVW.exe not giving me any properties

2002-10-04 Thread Richard A. Nakroshis

"Norris, Joseph" wrote:
> 
> The ultimate goal is to just be able to update the telephoneNumber in the
> active directory - WHY DOES BILL MAKE SO HARD!

I imagine it all boils down to NIH:  The 'Not Invented Here' Syndrome.

Because it's not Microsoft Perl, they don't need to support it.

Rick
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Setting your dos window size, title and colour!

2002-10-04 Thread Tillman, James

> Now, does anyone know what else you can do with:
> 
> system ("mode con:...
> 
> I'd like to be able to set the buffer size, too.

C:\>mode /?
Configures system devices.

Serial port:   MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s]
[to=on|off] [xon=on|off] [odsr=on|off]
[octs=on|off] [dtr=on|off|hs]
[rts=on|off|hs|tg] [idsr=on|off]

Device Status: MODE [device] [/STATUS]

Redirect printing: MODE LPTn[:]=COMm[:]

Select code page:  MODE CON[:] CP SELECT=yyy

Code page status:  MODE CON[:] CP [/STATUS]

Display mode:  MODE CON[:] [COLS=c] [LINES=n]

Typematic rate:MODE CON[:] [RATE=r DELAY=d]



jpy
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Re: New to Win32::GUI

2002-10-04 Thread Johan Lindstrom

At 11:30 2002-10-04 -0400, Conrad, Bill (ThomasTech) wrote:
> For years I have been developing PERL Tk scripts which I have been
>using on both UNIX and PC applications. My users want me to make these
>scripts more PC friendly

Good call! Tk is nice and all, but it's not very pretty. And pretty counts 
for non-geeks, so in order to make Perl look good you need to make the GUI 
look good. That means Win32::GUI or wxPerl.


>so I have decided to byte the bullet and learn Win32:GUI.

Good read:
http://www.jeb.ca/faq/Win32-GUI-FAQ.html

Subscribe to the Win32::GUI::Users mailing list:



> Are all of the modules associated with Win32:GUI loadable with PPM
>as a single package or do they all have to be loaded separately?

Not _all_. Installing Win32::GUI will set you up with the basics. There are 
a number of other Win32::GUI modules. Check the archives:


> And when they are loaded is all of the HTML documentation loaded
>also or do I have to get that from some other place?

PPMs are nice, but you need sample scripts, docs and stuff also, so 
download the source from SourceForge:
http://sourceforge.net/projects/perl-win32-gui

The documentation is also available (with a little nicer ToC IMHO) if you 
download The GUI Loft, a Win32::GUI window designer:
http://www.bahnhof.se/~johanl/perl/Loft/


/J

 --  --- -- --  --  -- -  - -
Johan LindströmSourcerer @ Boss Casinos [EMAIL PROTECTED]

Latest bookmark: "Conference Presentation Judo"
http://perl.plover.com/yak/judo/presentation/
dmoz (1 of 10): ...cial_Intelligence/Natural_Language/Conferences/ 6


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Setting your dos window size, title and colour!

2002-10-04 Thread Beckett Richard-qswi266

Guys,

After much trawling google.com, I have found out how to resize and set the
colours for the dos window that your perl script runs in.

Try this:

system ("color 17"); # Type help color at the dos prompt to see what the
colours are
# the 1 is the foreground colour (white) and 7 is the background colour
(blue)

system ("title My Title"); # This titles the window
system ("mode con: cols=80 lines=50"); # this sets the size of the window.

Share and Enjoy! :-)

Now, does anyone know what else you can do with:

system ("mode con:...

I'd like to be able to set the buffer size, too.

Thanks.

R.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs