RE: Problem with recursive routine

2011-11-28 Thread Tobias Hoellrich
You are not changing the directory while traversing. Whenever you access 
$nxtfile, you'll need to access it as $targetdir/$nxtfile. So, this (among 
other things):
$fileTotalSize += (-s $nxtfile);# THIS IS LINE 61 REFERRED TO IN 
THE ERROR MSG.
Needs to become:
$fileTotalSize += (-s $targetdir/$nxtfile);# THIS IS LINE 61 
REFERRED TO IN THE ERROR MSG.

Cheers - Tobias

-Original Message-
From: perl-win32-users-boun...@listserv.activestate.com 
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Barry 
Brevik
Sent: Monday, November 28, 2011 4:39 PM
To: perl Win32-users
Subject: Problem with recursive routine

I'm having a problem with a recursive routine that enumerates a directory tree 
and all of its files. It works well, except when it goes down 1 level from the 
top directory, I get this message: Use of uninitialized value in addition (+) 
at test61.pl line 61.

I've been fighting this thing for a couple of hours, and I thought that it was 
a variable scoping problem, but now I'm not so sure.

The code:

use strict;
use warnings;
use Cwd;

# Target directory is the current directory. For consistency, # convert '\' 
into '/' and add a trailing '/' to the directory # path if it is missing.
(my $targetdir = cwd()) =~ s/\\/\//g;
unless ($targetdir =~ /\/$/) {$targetdir .= '/';}

my $prefixFactor = 0;

enumerateDirectory($targetdir, $prefixFactor);

# -
# This routine enumerates the files in the target directory # and traverses the 
directory tree downwards no matter how # far it goes. The routine does this by 
being RECURSIVE.
#
# While processing directories, maintain a prefix factor which # controls the 
indention of the file and directory display.
#
sub enumerateDirectory($$)
{
  my ($targetdir, $prefixFactor) = @_;
  my ($filename, $filesize) = ('', 0);
  my $fileTotalSize = 0;

  if (opendir(my $currentDir, $targetdir))
  {
my $nxtfile = '';

# Enumerate each file in the current directory.
#
while (defined($nxtfile = readdir($currentDir)))
{
  # If the current file is a directory, follow this logic.
  if (-d $nxtfile)
  {
# If the directory is '.' or '..' then ignore it.
if ($nxtfile eq '.' || $nxtfile eq '..') {next;}

# If the directory name returned by readdir() is
# missing a trailing '/', add it here.
unless ($nxtfile =~ /\/$/) {$nxtfile .= '/';}

# Display the directory name then increment the prefix factor.
print \n, ' ' x $prefixFactor, $nxtfile\n;

$prefixFactor += 2;

# Call ourself with the directory name that we are following down.
enumerateDirectory($targetdir.$nxtfile, $prefixFactor);

# Upon return from the recursive call, de-increment the prefix factor.
$prefixFactor -= 2 if $prefixFactor  0;
  }
  else
  {
# If here, we have an ordinary file. Display it.
$fileTotalSize += (-s $nxtfile);# THIS IS LINE 61 REFERRED TO IN 
THE ERROR MSG.
print ' ' x $prefixFactor, $nxtfile, '  ', (-s $nxtfile), \n;
  }
}

# After completely enumerating each directory, be sure to
# close the directory entity.
close $currentDir;
print \n, ' ' x $prefixFactor, $fileTotalSize)\n;
  }
}
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with recursive routine

2011-11-28 Thread Barry Brevik
Thanks. That is a cool observation.

-Original Message-
From: Tobias Hoellrich [mailto:thoel...@adobe.com] 
Sent: Monday, November 28, 2011 3:47 PM
To: Barry Brevik; perl Win32-users
Subject: RE: Problem with recursive routine

You are not changing the directory while traversing. Whenever you access
$nxtfile, you'll need to access it as $targetdir/$nxtfile. So, this
(among other things):
$fileTotalSize += (-s $nxtfile);# THIS IS LINE 61 REFERRED
TO IN THE ERROR MSG.
Needs to become:
$fileTotalSize += (-s $targetdir/$nxtfile);# THIS IS LINE
61 REFERRED TO IN THE ERROR MSG.

Cheers - Tobias

-Original Message-
From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Barry Brevik
Sent: Monday, November 28, 2011 4:39 PM
To: perl Win32-users
Subject: Problem with recursive routine

I'm having a problem with a recursive routine that enumerates a
directory tree and all of its files. It works well, except when it goes
down 1 level from the top directory, I get this message: Use of
uninitialized value in addition (+) at test61.pl line 61.

I've been fighting this thing for a couple of hours, and I thought that
it was a variable scoping problem, but now I'm not so sure.

The code:

use strict;
use warnings;
use Cwd;

# Target directory is the current directory. For consistency, # convert
'\' into '/' and add a trailing '/' to the directory # path if it is
missing.
(my $targetdir = cwd()) =~ s/\\/\//g;
unless ($targetdir =~ /\/$/) {$targetdir .= '/';}

my $prefixFactor = 0;

enumerateDirectory($targetdir, $prefixFactor);

# -
# This routine enumerates the files in the target directory # and
traverses the directory tree downwards no matter how # far it goes. The
routine does this by being RECURSIVE.
#
# While processing directories, maintain a prefix factor which #
controls the indention of the file and directory display.
#
sub enumerateDirectory($$)
{
  my ($targetdir, $prefixFactor) = @_;
  my ($filename, $filesize) = ('', 0);
  my $fileTotalSize = 0;

  if (opendir(my $currentDir, $targetdir))
  {
my $nxtfile = '';

# Enumerate each file in the current directory.
#
while (defined($nxtfile = readdir($currentDir)))
{
  # If the current file is a directory, follow this logic.
  if (-d $nxtfile)
  {
# If the directory is '.' or '..' then ignore it.
if ($nxtfile eq '.' || $nxtfile eq '..') {next;}

# If the directory name returned by readdir() is
# missing a trailing '/', add it here.
unless ($nxtfile =~ /\/$/) {$nxtfile .= '/';}

# Display the directory name then increment the prefix factor.
print \n, ' ' x $prefixFactor, $nxtfile\n;

$prefixFactor += 2;

# Call ourself with the directory name that we are following
down.
enumerateDirectory($targetdir.$nxtfile, $prefixFactor);

# Upon return from the recursive call, de-increment the prefix
factor.
$prefixFactor -= 2 if $prefixFactor  0;
  }
  else
  {
# If here, we have an ordinary file. Display it.
$fileTotalSize += (-s $nxtfile);# THIS IS LINE 61 REFERRED
TO IN THE ERROR MSG.
print ' ' x $prefixFactor, $nxtfile, '  ', (-s $nxtfile), \n;
  }
}

# After completely enumerating each directory, be sure to
# close the directory entity.
close $currentDir;
print \n, ' ' x $prefixFactor, $fileTotalSize)\n;
  }
}
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with regex

2011-11-10 Thread Gabor Szabo
Hi Barry,

On Thu, Nov 10, 2011 at 2:34 AM, Barry Brevik bbre...@stellarmicro.com wrote:
 Below is some test code that will be used in a larger program.

 In the code below I have a regular expression who's intent is to look
 for   1 or more characters , 1 or more characters  and replace the
 comma with |. (the white space is just for clarity).

 IAC, the regex works, that is, it matches, but it only replaces the
 final match. I have just re-read the camel book section on regexes and
 have tried many variations, but apparently I'm too close to it to see
 what must be a simple answer.

 BTW, if you guys think I'm posting too often, please say so.

 Barry Brevik
 
 use strict;
 use warnings;

 my $csvLine = qq|  col , 1  ,  col___'2' ,  col-3, col,4|;

 print before comma substitution: $csvLine\n\n;

 $csvLine =~ s/(\x22.+),(.+\x22)/$1|$2/s;

 print after comma substitution.: $csvLine\n\n;


Tobias already gave you a solution and
I also think using Text::CSV or Text::CSV_XS is way better for this task
thank plain regexes, For example one day you might encounter
a line that has an embedded  escaped using \.
Then even if your regex worked  earlier this can kill it.
And what if there was an | in the original string?


Nevertheless let me also try to explain the issue that you had
with the regex as this can come up in other situations.

First, I'd probably use plain  instead of \x22 as that will be
probably easier to the reader to know what are you looking for.

Second, the /s has probably no value at the end. That only changes
the behavior of . to also match newlines.If you don't have newlines in
your string (e.g. because you are processing a file line by line)
then the /s has no effect. That makes this expression:

$csvLine =~ s/(.+),(.+)/$1|$2/;

Then, before going on you need to check what does this really match so
I replaced
the above with

 if ($csvLine =~ s/(.+),(.+)/$1|$2/s ){
   print match: $1$2\n;
 }

and got

match: col , 1  ,  col___'2' ,  col-3, col4

You see, the .+ is greedy, it match from the first  as much as it could.
You'd be better of telling it to match as little as possible by adding
an extra ? after the quantifier.
 if ($csvLine =~ /(.+?),(.+?)/ ){
   print match: $1$2\n;
 }

prints this:
match: col  1

Finally you need to do the substitution globally, so not only once but
as many times
as possible:

 $csvLine =~ s/(.+?),(.+?)/$1|$2/g;

And the output is

after comma substitution.:   col | 1  ,  col___'2' ,  col-3, col|4


But again, for CSV files that can have embedded, it is better to use
one of the real CSV parsers.

regards
  Gabor

-- 
Gabor Szabo
http://szabgab.com/perl_tutorial.html
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with regex

2011-11-09 Thread Tobias Hoellrich
The whitespaces around the separator characters are not allowed in strict CSV. 
Try this below.

Cheers - Tobias

use strict;
use warnings;
use Text::CSV;

my $csv = Text::CSV-new({ allow_whitespace = 1 });
open my $fh, DATA or die Can't access DATA: $!\n;
while (my $row = $csv-getline($fh)) {
print join(\n,@$row),\n;
}
$csv-eof or $csv-error_diag();

__END__
col , 1  ,  col___'2' ,  col-3, col,4

-Original Message-
From: perl-win32-users-boun...@listserv.activestate.com 
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Barry 
Brevik
Sent: Wednesday, November 09, 2011 5:35 PM
To: perl Win32-users
Subject: Problem with regex

Below is some test code that will be used in a larger program.

What I am trying to do is process lines from a CSV file where some of the 
'cells' have commas embedded in the (see sample code below). I might have used 
text::CSV but as far as I can tell that module also can not deal with embedded 
commas.

In the code below I have a regular expression who's intent is to look for   1 
or more characters , 1 or more characters  and replace the comma with |. 
(the white space is just for clarity).

IAC, the regex works, that is, it matches, but it only replaces the final 
match. I have just re-read the camel book section on regexes and have tried 
many variations, but apparently I'm too close to it to see what must be a 
simple answer.

BTW, if you guys think I'm posting too often, please say so.

Barry Brevik

use strict;
use warnings;
 
my $csvLine = qq|  col , 1  ,  col___'2' ,  col-3, col,4|;
 
print before comma substitution: $csvLine\n\n;
 
$csvLine =~ s/(\x22.+),(.+\x22)/$1|$2/s;
 
print after comma substitution.: $csvLine\n\n;

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with Tk Frame not filling the whole frame.

2009-08-03 Thread Daniel Burgaud
Hi

Thanks Jack for the example.

here is where the problem i am encountering.

In your example the Left Frame was declared with -expand = 0:
my $frameLeft = $mainFrame-Frame( -bg='red',-borderwidth = 1, -width =
50, )-pack( -side = 'left',  -expand = 0, -fill = 'y');

expand = 0 implies it will not expand to fill available space right?
yet when I execute it, it did what I want to do.

Naturally, I would code it with expand = 1, fill = 'y'
Accordingly, this should fill only the vertical and not horizontal. And
when I did so, its not doing what I want it.

This is where I am very confused!!!


Anyway, assuming I want is to have a Frame clerk.right.
And in this frame, I want to divide it into 5 namely: North, South, West,
East and X
The N, S, are top/bottom border with predefined height of 50.
the W, E are Left, Right border with predefined width of 50 also.
the rest is X and X (yellow) is to occupy the whole remaining frame.


###
use Tk;

my $mw = MainWindow-new( );
$mw-minsize();

$TK{'clerk.right'}= $mw-Frame( )-pack( -side = 'right', -expand = 1,
-fill = 'both');


$TK{'clerk.N'}= $TK{'clerk.right'}-Frame( -height = 50, -background =
'blue'  )-pack( -side = 'top', -expand = 1, -fill = 'x');
$TK{'clerk.S'}= $TK{'clerk.right'}-Frame( -height = 50, -background =
'green' )-pack( -side = 'bottom', -expand = 1, -fill = 'x');
$TK{'clerk.W'}= $TK{'clerk.right'}-Frame( -width =  50, -background =
'red'   )-pack( -side = 'left', -expand = 0, -fill = 'y');
$TK{'clerk.X'}= $TK{'clerk.right'}-Frame( -background =
'yellow')-pack( -side = 'left', -expand = 1, -fill = 'both');
$TK{'clerk.E'}= $TK{'clerk.right'}-Frame( -width =  50, -background =
'black' )-pack( -side = 'left', -expand = 0, -fill = 'y');

MainLoop;
###

The result is that the Frame X is just a thin horizontal line!
its not occupying the whole remaining space.

This code isnt doing what I want it to.

Where is my Error here?


Dan





On Sat, Aug 1, 2009 at 1:52 AM, Jack goodca...@hotmail.com wrote:

 Again - sorry for the top post..

 I'm not completely sure of what you want, but I think you want some sort of
 bar down the left side. You have to turn the expand option to off for
 that
 to not allocate anymore space in the x direction on a resize. Otherwise
 the packer will split it 50/50 with the righthand frame.

 This will do what I describe - which is yet to be decided what you really
 want:

 #
 use Tk;
 use strict;

 my $mw=tkinit;
 my $mainFrame = $mw-Frame()-pack(-expand=1, -fill = 'both');
 my $frameLeft = $mainFrame-Frame( -bg='red',-borderwidth = 1, -width =
 50, )-pack( -side = 'left',  -expand = 0, -fill = 'y');
 my $frameRight = $mainFrame-Frame( -bg='yellow', -borderwidth = 1,
 )-pack( -side = 'left', -expand = 1, -fill = 'both');

 MainLoop;
 #

 Suggestion..it would be easier to help if you provided fully working
 programs that show the problem as opposed to code snippets (which had some
 typos).

 Jack



 

 From: perl-win32-users-boun...@listserv.activestate.com
 [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
 Daniel Burgaud
 Sent: July-31-09 4:52 AM
 To: Perl-Win32-Users
 Subject: problem with Tk Frame not filling the whole frame.


 Hi,

 I have a Frame and within this Frame, I have 2 more Frames:

 $mainFrame = $mw-Frame()-pack(-expand=1, fill = 'both');

 $frameLeft = $mainFrame-Frame( -borderwidth = 1, width = 50, )-pack(
 -side = 'left',  -expand = 1, -fill = 'y');
 $frameRight = $mainFrame-Frame( -borderwidth = 1, )-pack( -side =
 'right', -expand = 1, -fill = 'both');


 How come the sub frames isnt filling the whole mainFrame?
 Why? What option/method must I use to force these two sub frames to fill
 the
 mainFrame?

 I also tried it within a Notebook (instead of main Frame) with same effect:

 $mainFrame = $TK{'notebook'}-add('item',-label = ' Main Frame ');
 $frameLeft = $mainFrame-Frame( -borderwidth = 1, width = 50, )-pack(
 -side = 'left',  -expand = 1, -fill = 'y');
 $frameRight = $mainFrame-Frame( -borderwidth = 1, )-pack( -side =
 'right', -expand = 1, -fill = 'both');

 Need Help. Thanks!

 Dan



___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: problem with Tk Frame not filling the whole frame.

2009-07-31 Thread Jack
Again - sorry for the top post..

I'm not completely sure of what you want, but I think you want some sort of
bar down the left side. You have to turn the expand option to off for that
to not allocate anymore space in the x direction on a resize. Otherwise
the packer will split it 50/50 with the righthand frame.

This will do what I describe - which is yet to be decided what you really
want:

#
use Tk;
use strict;

my $mw=tkinit;
my $mainFrame = $mw-Frame()-pack(-expand=1, -fill = 'both');
my $frameLeft = $mainFrame-Frame( -bg='red',-borderwidth = 1, -width =
50, )-pack( -side = 'left',  -expand = 0, -fill = 'y');
my $frameRight = $mainFrame-Frame( -bg='yellow', -borderwidth = 1,
)-pack( -side = 'left', -expand = 1, -fill = 'both');

MainLoop;
#

Suggestion..it would be easier to help if you provided fully working
programs that show the problem as opposed to code snippets (which had some
typos).

Jack

 



From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Daniel Burgaud
Sent: July-31-09 4:52 AM
To: Perl-Win32-Users
Subject: problem with Tk Frame not filling the whole frame.


Hi,

I have a Frame and within this Frame, I have 2 more Frames:

$mainFrame = $mw-Frame()-pack(-expand=1, fill = 'both');

$frameLeft = $mainFrame-Frame( -borderwidth = 1, width = 50, )-pack(
-side = 'left',  -expand = 1, -fill = 'y');
$frameRight = $mainFrame-Frame( -borderwidth = 1, )-pack( -side =
'right', -expand = 1, -fill = 'both');


How come the sub frames isnt filling the whole mainFrame?
Why? What option/method must I use to force these two sub frames to fill the
mainFrame?

I also tried it within a Notebook (instead of main Frame) with same effect:

$mainFrame = $TK{'notebook'}-add('item',-label = ' Main Frame ');
$frameLeft = $mainFrame-Frame( -borderwidth = 1, width = 50, )-pack(
-side = 'left',  -expand = 1, -fill = 'y');
$frameRight = $mainFrame-Frame( -borderwidth = 1, )-pack( -side =
'right', -expand = 1, -fill = 'both');

Need Help. Thanks!

Dan


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem iwth perl tk : Creation of file based on options

2009-05-27 Thread Brian Raven
From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Perl Perl
Sent: 27 May 2009 15:40
To: perl-win32-users@listserv.activestate.com
Subject: Problem iwth perl tk : Creation of file based on options

 Hi All,
  
I have to create files based on the ext1 - ext2 and write few
lines of code there. The created file 
 should have to option like like update and save so that user can edit
the file in future. 

Sorry, I didn't understand that.

 For this I choose the Radiobatton option of Perl/Tk. Here I am doing a
very silly mistake, and it is just due 
 to little knowlege towards Perl/TK (started learning Perl/TK for 2
days). 
 So Request you to let me know where I am doing the mistake. 
 It will great help, if you help me to overcome this issue. 
  
  
 #!/usr/bin/perl -w
 use  Tk;
 use strict;
 our ($filename);
 $filename = DMM;
 
 
 my $mw = MainWindow - new;
 my $rb_value = red;
 $mw - configure( -background = $rb_value);
 my $val;
 foreach ( qw ( ext1 ext2 ext3) ) {
  $mw - Radiobutton ( -text = $_,
 -value = $_,
 -variable = \$val,
 -command = \set_bg) - pack (-side = 'left');
 }
 MainLoop;
 
 sub set_bg {
  my $Data = Hello World;
  print  Selcted CPU is  : $val\n;
  #$mw - configure ( - background = $rb_value);
  $mw - configure ( -textvariable = $rb_value);

This is clearly the line that is causing the problem. It is complaining
that -textvariable is not a valid configuration option for that widget.
As I have no idea what you are trying to do, the best I can say is don't
do that.

  print  File name is : $filename\n;
 if ( $rb_value eq ext1 ) {
   $filename = $filename . \_ . $rb_value;
   print  Edited name is : $filename \n;
   open ( FILE, $filename ) or die  Can't open the $filename $!;
   print FILE $Data; 
  }
 
 } 
 
  
 
 /Perl/GUIperl Radio.pl
  Selcted CPU is  : ext1
 Tk::Error: Can't set -textvariable to `red' for
MainWindow=HASH(0x982af0): unknown option -textvariable at 
 /apps/perl/modules-0812/lib/x86_64-linux-thread-multi/Tk/Configure.pm
line 46.
  at
/apps/perl/modules-0812/lib/x86_64-linux-thread-multi/Tk/Derived.pm line
294
 
  Tk callback for .
  Tk::Derived::configure at
/apps/perl/modules-0812/lib/x86_64-linux-thread-multi/Tk/Derived.pm line
306
  main::set_bg at Radio.pl line 26
  Tk::BackTrace at
/apps/perl/modules-0812/lib/x86_64-linux-thread-multi/Tk.pm line 124
  Tk::Derived::configure at
/apps/perl/modules-0812/lib/x86_64-linux-thread-multi/Tk/Derived.pm line
306
  main::set_bg at Radio.pl line 26
  Tk callback for .radiobutton
  Tk::__ANON__ at
/apps/perl/modules-0812/lib/x86_64-linux-thread-multi/Tk.pm line 250
  Tk::Radiobutton::Invoke at
/apps/perl/modules-0812/lib/x86_64-linux-thread-multi/Tk/Radiobutton.pm
line 42
  Button-1
  (command bound to event)

HTH

-- 
Brian Raven 
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient or have received this e-mail in error, please advise 
the sender immediately by reply e-mail and delete this message and any 
attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: problem with Komodo

2008-09-15 Thread Brian Raven
HeadHuntYourNextJob.com:Three Search Engines. Lots of Jobs!



*HeadHuntYourNextJob.com  http://headhuntyournextjob.com/*lets you find
opportunities that fit your experience--no matter what that experience
is--anywhere in the world.

We provide you with several search engines to provide the deep penetration
of the job market to make sure that you miss no opportunity (we've just
changed one of them to provide even better results).

That means even more jobs can be launched in seconds and no stone left
unturned.

Whether you are a beginner or very experienced, we are confident that you
will never run out of jobs that fit your experience!

*
To search, go to www.headhuntyournextjob.com*

--~--~-~--~~~---~--~~
Do not Spam!
Do some social Good : Donate Blood 

http://www.orkut.com/AppInfo.aspx?appUrl=http%3A%2F%2Fopensocial.techmastiff.com%2Flogin_doner.xmlautoAuth=52R8%2BOGPoQ%---
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient or have received this e-mail in error, please advise 
the sender immediately by reply e-mail and delete this message and any 
attachments without retaining a copy. Any unauthorised copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: problem with Komodo

2008-09-15 Thread Jan Dubois
On Fri, 12 Sep 2008, Spencer Chase wrote:
 I have been having computer problems with updates and had to do system
 restore etc after which my Komodo does not run any scripts that use
 the file browsing method of the following. If I compile the script
 into an exe with PerlApp they all work fine. Running in the debugger
 in Komodo, clicking the button in this sample terminates the script
 instead of opening the file browser. This has happened at a most
 unfortunate time, just prior to a demonstration. I can hard code
 sample files and avoid the browser but I really need to get this
 working again ASAP. I have no idea what options or environment
 variables might have changed. Re-installing Komodo has not fixed the
 problem. If there is a more appropriate forum, please suggest one.

I have no idea why the file browsing dialogs stopped working correctly
on your machines. The fact that the programs work when they are
PerlAppified may be due to PerlApp always requesting the XP style of
common dialogs. You can get the same effect for regular Perl by storing
the attached perl.exe.manifest file in your C:\Perl\bin directory right
next to perl.exe itself.

Not sure if it will work, but if you are desperate it may be
worth a try. :)

Cheers,
-Jan
 


perl.exe.manifest
Description: Binary data
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: problem with print

2008-08-11 Thread Brian Raven
Tobias Hoellrich  wrote:
 Try:
 $|++;
 to unbuffer STDOUT.
 
 Hope this helps - Tobias

Not quite. pedant_mode That variable activates autoflush, which isn't
quite the same as unbuffered output, on the currently selected
filehandle, which may not actually be STDOUT (see 'perldoc perlvar').
/pedant_mode

Also, it is usually better to localise the use of such special
variables. For example:

print Doing stuff ;
for (1..20) {
local $| = 1;
select undef, undef, undef, 0.5;
print .;
}
print \n;

Also, consider a more 'sophisticated' alternative to ., that I
sometimes use.

print Doing some more stuff  ;
my $i = 0;
for (1..20) {
local $| = 1;
select undef, undef, undef, 0.5;
print \b . qw{| / - \\}[$i++ % 4]; } print \b \n;

HTH

--
Brian Raven 


Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.
If you have received this communication in error, please notify the sender 
immediately by replying to the message, and please delete it from your system. 
Thank you.  NYSE Group, Inc.


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with print

2008-08-11 Thread Justin Allegakoen
2008/8/11 Brian Raven [EMAIL PROTECTED]

 Tobias Hoellrich  wrote:
  Try:
  $|++;
  to unbuffer STDOUT.
 
  Hope this helps - Tobias

 Not quite. pedant_mode That variable activates autoflush, which isn't
 quite the same as unbuffered output, on the currently selected
 filehandle, which may not actually be STDOUT (see 'perldoc perlvar').
 /pedant_mode

 Also, it is usually better to localise the use of such special
 variables. For example:

 print Doing stuff ;
 for (1..20) {
local $| = 1;
select undef, undef, undef, 0.5;
print .;
 }
 print \n;

 Also, consider a more 'sophisticated' alternative to ., that I
 sometimes use.

 print Doing some more stuff  ;
 my $i = 0;
 for (1..20) {
local $| = 1;
select undef, undef, undef, 0.5;
print \b . qw{| / - \\}[$i++ % 4]; } print \b \n;

 HTH

 --
 Brian Raven


 Visit our website at http://www.nyse.com


Or consider an OO approach, without the sneaky 3 undefs:-

package Spinner;

sub new
{
return bless { position = 0, picture = [ qw( | / - \ ) ] }, shift;
}

sub spin
{
my $obj = shift;

$obj-{position} = ( ++$obj-{position} ) % @{ $obj-{picture} };

print \b$obj-{picture}[ $obj-{position} ];
}

DESTROY
{
print \b \n;
}


package main;

use Win32;

local $| = 1;

print Doing even more stuff . . .  ;

my $spinner = new Spinner;

for ( 1 .. 26 )
{
$spinner-spin();

Win32::Sleep(50);
}




[OT]: Changed jobs then Brian?


Just in
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with print

2008-08-10 Thread Tobias Hoellrich
Try:
$|++;
to unbuffer STDOUT.

Hope this helps - Tobias



On Aug 10, 2008, at 4:16 PM, Daniel Burgaud [EMAIL PROTECTED] wrote:

 Hi

 I have a simple script that uses print in a loop to update the
 screen something like this:

 for ( ) {
 .
 .
 .
 print .;
 }
 print \n;

 The problem, while within the loop, the screen does not update. Only
 once print \n is encountered
 will the screen display the whole printout.

 How do I ensure that each print gets displayed immediately without
 having to wait for the newline?

 Dan
 ___
 Perl-Win32-Users mailing list
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with lanman

2008-08-06 Thread Sisyphus

- Original Message - 
From: Barry Brevik [EMAIL PROTECTED]
To: perl-win32-users@listserv.ActiveState.com
Sent: Thursday, August 07, 2008 7:36 AM
Subject: Problem with lanman


 I'm runing Perl v5.8.8 build 819 on Windows XP. I'm all excited about a
 couple of books I bought: Win32 Perl Programming the Standard
 Extensions, and Win32 Perl Scripting the Administrator's Handbook.

 Some of the sample code from the book have:

  use Win32::NetAdmin;

 ...at the beginning of the program. I have no trouble with those
 programs.

 However, some of the examples have:

  use Win32::Lanman;

 The very presence of that line causes my program to crash immediately
 with that ubiquitous Windows 2-tone gray dialog saying that Perl has
 committed a heinous crime, etc. Perl itself never issues any error
 despite use strict; use warnings;, and the cmd window is never closed.

How did you install it ?
There's a PPM for it at the bribes repository that could be worth a try
(assuming it's not what you've already got).

Just:

  ppm remove Win32-Lanman

and then:

  ppm install http://www.bribes.org/perl/ppm/Win32-Lanman.ppd

There's also a PPM (at the same repository) for Win32API::Net which,
according to its description is a Perl interface to the Windows NT
LanManager API account management functions. It could be worth trying as an
alternative to Win32::Lanman if all else fails:

   ppm install http://www.bribes.org/perl/ppm/Win32API-Net.ppd

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with Win32::ToolHelp module

2008-06-19 Thread Stuart Arnold
Did you copy/paste or type the error in? There seems to be a typo:
TollHelp.dll
ToolHelp/TollHelp.dll  


---Stuart Arnold
w: [EMAIL PROTECTED]
w: 678.297.1027
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Michael Ellery
Sent: Thursday, June 19, 2008 9:00 AM
To: 'perl-win32-users'
Subject: Problem with Win32::ToolHelp module

apologies if this is not the right place for module specific 
questions...but here goes...

I'm running 5.8.8 and have had Win32::ToolHelp installed for some time. 
  Just recently, I started getting a failure when trying to use the 
package - specifically:

Can't load 'C/Perl/site/lib/auto/Win32/ToolHelp/TollHelp.dll for 
module Win32::ToolHelp: load_file: The specified module could not be 
found at C:/Perl/lib/DynaLoader.pm line 230

I've looked on the filesystem, and ToolHelp.dll is there in the location 
mentioned.  I've even tried ppm install --force Win32::ToolHelp to see 
if that would fix it, but it hasn't.

Any idea what might be wrong and what else I could try to fix it?

TIA,
Mike Ellery

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with Win32::ToolHelp module

2008-06-19 Thread Michael Ellery
Stuart Arnold wrote:
 Did you copy/paste or type the error in? There seems to be a typo:
 TollHelp.dll
 ToolHelp/TollHelp.dll  
 

typo -- sorry.  That is ToolHelp.dll.

Thanks,
Mike

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with Win32::ToolHelp module

2008-06-19 Thread Brian Raven
Michael Ellery  wrote:
 Stuart Arnold wrote:
 Did you copy/paste or type the error in? There seems to be a typo:
 TollHelp.dll ToolHelp/TollHelp.dll
 
 
 typo -- sorry.  That is ToolHelp.dll.

This is why cutpaste is preferred for error messages and code. Typing
mistakes are likely to be obstacles to anybody trying to help you. And
thats the last thing you need.

If it used to work and now doesn't, then presumably something has
changed. For example, if the library is still in the right place, has
its contents or permissions changed, or perhaps any library that it
depends on?

You can also get more detailed info on diagnostic messages like that
from 'perldoc perldiag'.

HTH

-- 
Brian Raven 

=
Atos Euronext Market Solutions Disclaimer
=

The information contained in this e-mail is confidential and solely for the 
intended addressee(s). Unauthorised reproduction, disclosure, modification, 
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message do not 
necessarily reflect those of Atos Euronext Market Solutions.

Atos Euronext Market Solutions Limited - Registered in England  Wales with 
registration no. 3962327.  Registered office address at 25 Bank Street London 
E14 5NQ United Kingdom. 
Atos Euronext Market Solutions SAS - Registered in France with registration no. 
425 100 294.  Registered office address at 6/8 Boulevard Haussmann 75009 Paris 
France.

L'information contenue dans cet e-mail est confidentielle et uniquement 
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. 
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail 
vous parvient par erreur, nous vous prions de bien vouloir prevenir 
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre 
systeme. Le contenu de ce message electronique ne represente pas necessairement 
la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Société de droit anglais, enregistrée au 
Royaume Uni sous le numéro 3962327, dont le siège social se situe 25 Bank 
Street E14 5NQ Londres Royaume Uni.

Atos Euronext Market Solutions SAS, société par actions simplifiée, enregistré 
au registre dui commerce et des sociétés sous le numéro 425 100 294 RCS Paris 
et dont le siège social se situe 6/8 Boulevard Haussmann 75009 Paris France.
=

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with Win32::ToolHelp module

2008-06-19 Thread Michael Ellery
Michael Ellery wrote:
 apologies if this is not the right place for module specific 
 questions...but here goes...
 
 I'm running 5.8.8 and have had Win32::ToolHelp installed for some time. 
   Just recently, I started getting a failure when trying to use the 
 package - specifically:
 
 Can't load 'C/Perl/site/lib/auto/Win32/ToolHelp/TollHelp.dll for 
 module Win32::ToolHelp: load_file: The specified module could not be 
 found at C:/Perl/lib/DynaLoader.pm line 230
 
 I've looked on the filesystem, and ToolHelp.dll is there in the location 
 mentioned.  I've even tried ppm install --force Win32::ToolHelp to see 
 if that would fix it, but it hasn't.
 
 Any idea what might be wrong and what else I could try to fix it?
 

after some investigation, it appears to be a case of installation of 5.8 
on top of 5.6 without cleanly reinstalling all packages. I generally 
only do clean installs, but I was dealing with an inherited system and 
wasn't as careful as I should have been.

Thanks,
Mike Ellery

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with Win32::GetOSVersion()

2007-05-23 Thread Steven Manross

C:\Perl\Scriptsperl -e @s = Win32::GetOSVersion; print \$s[-1] $s[1]
$s[2]\

On a X86 2K3 system, I get 

3 5 2

And on a X86 W2K Server,

3 5 0

Steven
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Sisyphus
Sent: Wednesday, May 23, 2007 9:39 AM
To: perl-win32-users
Subject: Problem with Win32::GetOSVersion()

Hi,
The Win32 documentation (wrt Win32::GetOSVersion) states:

-
 Win32::GetOSVersion()
 [CORE] Returns the list (STRING, MAJOR, MINOR, BUILD, ID), ...
.
.
Currently known values for ID MAJOR and MINOR are as follows:

OSIDMAJOR   MINOR
Win32s 0  -   -
Windows 95 1  4   0
Windows 98 1  4  10
Windows Me 1  4  90
Windows NT 3.512  3  51
Windows NT 4   2  4   0
Windows 2000   2  5   0
Windows XP 2  5   1
Windows Server 20032  5   2
Windows Vista  2  6   0
-

I'm running Vista64, so I expect the following one liner to print out 2
6
0:

C:\_64\Cperl -e @s = Win32::GetOSVersion; print \$s[-1] $s[1]
$s[2]\

But it prints out 1 6 0.

Does anyone know what's going on ? (This is using the 64-bit build of AS
820 on an AMD64 box.)

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with Win32::GetOSVersion()

2007-05-23 Thread Jan Dubois
On Wed, 23 May 2007, Sisyphus wrote:
 The Win32 documentation (wrt Win32::GetOSVersion) states:
 
 -
  Win32::GetOSVersion()
  [CORE] Returns the list (STRING, MAJOR, MINOR, BUILD, ID), ...
 .
 .
 Currently known values for ID MAJOR and MINOR are as follows:
 
 OSIDMAJOR   MINOR
 Win32s 0  -   -
 Windows 95 1  4   0
 Windows 98 1  4  10
 Windows Me 1  4  90
 Windows NT 3.512  3  51
 Windows NT 4   2  4   0
 Windows 2000   2  5   0
 Windows XP 2  5   1
 Windows Server 20032  5   2
 Windows Vista  2  6   0

You are overlooking this part of the docs:

   On Windows NT 4 SP6 and later this function returns the following
   additional values: SPMAJOR, SPMINOR, SUITEMASK, PRODUCTTYPE.

 -
 
 I'm running Vista64, so I expect the following one liner to print out 2 6
 0:
 
 C:\_64\Cperl -e @s = Win32::GetOSVersion; print \$s[-1] $s[1] $s[2]\
 
 But it prints out 1 6 0.
 
 Does anyone know what's going on ? (This is using the 64-bit build of AS 820
 on an AMD64 box.)

You are printing the PRODUCTTYPE value instead of the ID.  Use $s[4] instead
of $s[-1].

Cheers,
-Jan


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with Win32::GetOSVersion()

2007-05-23 Thread Bill Luebkert
Jan Dubois wrote:
 
 You are printing the PRODUCTTYPE value instead of the ID.  Use $s[4] instead
 of $s[-1].

Also note, if you're running in XP compatibility mode, you'll get 5 instead
of 6 for major.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with Win32::GetOSVersion()

2007-05-23 Thread Sisyphus

- Original Message - 
From: Bill Luebkert [EMAIL PROTECTED]
To: 'perl-win32-users' perl-win32-users@listserv.ActiveState.com
Sent: Thursday, May 24, 2007 4:22 AM
Subject: Re: Problem with Win32::GetOSVersion()


 Jan Dubois wrote:

 You are printing the PRODUCTTYPE value instead of the ID.  Use $s[4] 
 instead
 of $s[-1].

 Also note, if you're running in XP compatibility mode, you'll get 5 
 instead
 of 6 for major.

Doh!!!
I thought I must have been going mad  seems I was right.

Thanks, guys.

Cheers,
Rob 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with printing messages to the screen

2007-05-21 Thread Deane . Rothenmaier
'print  Done\n;'

Jagdish,

You don't need all those spaces, either. Without them, the 'Done' will 
print right next to the 'please wait.'. It's probable you're running 
into line-wrap on your screen--and that's what's causing the 'Done' text 
to appear on the next line.

Deane Rothenmaier
Programmer/Analyst
Walgreens Corp.
847-914-5150

Reality is whatever refuses to go away when I stop believing in it. -- 
Philip K. Dick___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with printing messages to the screen

2007-05-20 Thread Foo JH
You can turn off buffering:
$|=1;

jagdish eashwar wrote:
 Hi,

 I have written a script which accesses each file in a directory and 
 processes them in turn. While it is doing so, I want it to put out 
 status message like:

 Processing $filename, please wait..

 And then when the script has finished processing a file, I want it to 
 say Done  at the end of the same line.

 For this, I have put
  
 'print Processing $filename, please wait..; '

 near the top of the loop, and

 'print  Done\n;'

 at the bottom.

 When I do this, both the messages are put out at the same time after 
 the file is processed. If I put a \n at the end of the first message, 
 the messages are output one by one with the requisite time lag in 
 between, but the  Done comes on the next line. How can I get Perl to 
 put out the messages on the same line with the time lag?

 jagdish eashwar
 

 ___
 Perl-Win32-Users mailing list
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
   

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with error Can't call method Select on an undefined value in Win32::OLE Excel script

2007-02-01 Thread Jan Dubois
On Thu, 1 Feb 2007 10:22:55 -0800, Glen Plantz
[EMAIL PROTECTED] wrote:

# ***

I get the error  Can't call method Select on an undefined value on
the line:

 
$excel_Retrieve_Workbook-ActiveSheet-Range(A4)-Select();

# 

I don't understand what I'm doing wrong. I've done things similar to
this many times.

This means that the call to the Range() method is failing.  You should
run your program with t`perl -w myscript.pl` to get more informative
error messages from Win32::OLE whenever something goes wrong.

Cheers,
-Jan
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with write fucntion in Spreadsheet::WriteExcel

2007-01-25 Thread Bill Luebkert
raj esh wrote:
 Dear Gurus,
  
 I want to write some data into the Excel sheet. I have written code 
 can you people guide me where i am going wrong!
  
 All code is working fine but data is not getting written in the result.xls
  
 Here is the code..
  
 ==
 This is the Excel.pl file code
 ==
 use ExcelEdit;
 use strict;
 use warnings;
 my $obj=new ExcelEdit();
 my $worksheet=$obj-ExcelEdit::CreateSpreadSheet();
 $obj-ExcelEdit::WriteRecord($worksheet,2,3,1,Y,N);

Try saving the workbook object ref in your ExcelEdit object and do a
workbook close here.  Normally you would have the object open and in
scope and it would close automatically.  I think that either it's
closing before you do your write or it's not properly closing at exit.

 ===
  
 
 Here is the ExcelEdit.pm code
 
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with SSL and Windows 2003 Server

2006-12-20 Thread Sisyphus

- Original Message - 
From: Briggs, Larry [EMAIL PROTECTED]
.
.

 Event Type: Error
 Event Source: Application Error
 Event Category: (100)
 Event ID: 1000
 Date: 12/11/2006
 Time: 10:41:56 AM
 User: N/A
 Computer: EIPW2003-7
 Description:
 Faulting application perl.exe, version 5.6.1.638, faulting module
 ssleay32.dll, version 0.9.8.1, fault address 0x00017e6c.


Can you provide a *minimal* script that produces this error ?
It may be helpful if you can do that.

Do you get the same error with perl 5.8.8 ? (Assuming you have the
capability to test with perl 5.8.8  )

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with Win32::Perfmon API

2006-12-14 Thread ankit . mehrotra
Hi,

I had tried doing it  but the ppm is giving up !!

It gives an error of Cannot connect to the host www.bribes.org  Bad host 
name


Ankit Arun Mehrotra
Tata Consultancy Services
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com
=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with Win32::Perfmon API

2006-12-14 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote:

 
 Hi,
 
 I had tried doing it  but the ppm is giving up !!
 
 It gives an error of Cannot connect to the host www.bribes.org  Bad
 host name

It worked ok for me.
http://www.bribes.org/perl/ppm/
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with Win32::Perfmon API

2006-12-13 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote:

 
 Hi,
 I had been trying to install win32::Perfmon API . hile installation it
 is giving warning of some libraries from lib/CORE missing (eg
 PDH.lib,msr.lib .) . but makes the Makefile on proceeding
 for making the binaries from it, it gives an error that 'cl is not found
 as an internal or external command '.
 
 I have tried to lacate the missing libraries on the net  but to no
 avail !!
 
 Please guide for installing the API ..

I'd use PPM from the Bribes repository.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with tar.gz read

2006-11-16 Thread Sisyphus

- Original Message - 
From: Dan Jablonsky [EMAIL PROTECTED]
To: perl-win32-users@listserv.ActiveState.com
Sent: Friday, November 17, 2006 8:55 AM
Subject: problem with tar.gz read


 Hi everybody,
 I guess I still have a problem with my reading of
 tar.gz files. Everything work jst great with the
 code below until I happened to hit a corrupted file
 and I can't see a way to jump over it. My point is
 that in a list with hundreds of tar.gz files all of
 them are valid, less one (of small size which also
 happens to be quite at the top of the list) which
 makes the script to go kaboom.

 File::Find::find( sub {
  #traversing a file structure
  if($_ =~/\.tar\.gz/)
   {
#if you found a tar.gz file - open and read
#build an Archive::Tar object
my $tar = Archive::Tar-new($_);

Check that $tar is a true value. (Judging by what you said it *will* be true
even if $_ is corrupt ... so that's not going to help ... but check anyway.)

Otherwise, how about something like:

my $tar = Archive::Tar-new();

eval{ $tar-read($_, 1)};
if($@) {
  warn $_ is a corrupt file: [EMAIL PROTECTED];
  # Don't do anything else with this file
}

else {

my @files = $tar-list_files() or die Can't read
 TAR.GZ file!\n;
#go thru the array and look for the pattern
foreach my $tar_member (@files)
 {
  if($tar_member =~/$search_pattern/)
   {
 print \nI FOUND 1 file!\n;
 #must extract the found file from the archive
 $tar-extract_file($tar_member, $some_path);
   }
 }
   }

} # close else block

 }, $search_directory);


If the read() succeeds on corrupt files (which I think is unlikely) then you
might have to eval{} some of the other method calls that *are* failing.

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem returning empty Safearray from OLE Component

2006-10-16 Thread Joe Discenza



Kevin Godden wrote, on Monday, October 16, 2006 10:21 
AM

: saBound.cElements = 
elementCount;
: 
SAFEARRAY* pA = SafeArrayCreate(VT_I4, 1, 
saBound);

While the loop is 
protected by checking elementCount, the SafeArrayCreate call is not, so it is 
almost surely the source of the error. Is it legal to pass an saBound struct 
with cElements set to 0 (I have no idea)? Should you simply return NULL if 
elementCount is 0, or do you have to return a SafeArray even with no 
elements?

Joe
Joseph Discenza, Senior Programmer/Analystmailto:[EMAIL PROTECTED]Carleton 
Inc. http://www.carletoninc.com574.243.6040 
ext. 300Fax: 574.243.6060
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem loading Archive::Tar

2006-10-10 Thread Sisyphus

- Original Message - 
From: Sisyphus [EMAIL PROTECTED]
To: perl-win32-users perl-win32-users@listserv.ActiveState.com
Sent: Monday, October 09, 2006 1:16 PM
Subject: Problem loading Archive::Tar


 Hi,
 On AS build 817:

 ---
  E:\perl -MArchive::Tar -e print $Archive::Tar::VERSION
 Config::AUTOLOAD failed on Config::launcher at E:/Perl817/lib/Config.pm
 line 72.
 BEGIN failed--compilation aborted at E:/Perl817/site/lib/Archive/Tar.pm
line
 34.

 Compilation failed in require.
 BEGIN failed--compilation aborted.
 -


Finally remembered that I have another 817 installation on my laptop - and
it I find it works fine. It's just the desktop version that's broken.
Both the desktop and laptop have identical renditions of both Config.pm and
Config_heavy.pl (according to 'diff -u').

It seems to come down to sub AUTOLOAD in Config.pm:

sub AUTOLOAD {
my $config_heavy = 'Config_heavy.pl';
if (defined ActivePerl::_CONFIG_HEAVY) {
   $config_heavy = ActivePerl::_CONFIG_HEAVY();
}
require $config_heavy;
goto \launcher unless $Config::AUTOLOAD =~ /launcher$/;
die Config::AUTOLOAD failed on $Config::AUTOLOAD;
}

If I comment out the 'require $Config_heavy;' in that sub on the laptop's
Config.pm, then I get an identical error to that which I get on the
desktop - presented in my original post and reproduced above, in *this*
post.

I've also verified that on the (broken) desktop, Config_heavy.pl's
launcher() subroutine is never run - even though $Config::AUTOLOAD does not
match /launcher$/ .

Go figure ... it's beat the hell out of me. Something is jiggered (possibly
by me), but I'm damned if I can (yet) work out what.

I get the feeling that if I can get Config_heavy.pl's launcher() subroutine
to load, then my problem will go away. But I haven't yet worked out what
could possibly be preventing it from being run.

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem loading Archive::Tar

2006-10-10 Thread $Bill Luebkert
Sisyphus wrote:

 I get the feeling that if I can get Config_heavy.pl's launcher() subroutine
 to load, then my problem will go away. But I haven't yet worked out what
 could possibly be preventing it from being run.

Give it up and re-install.  :)

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem loading Archive::Tar

2006-10-10 Thread Sisyphus

- Original Message - 
From: $Bill Luebkert [EMAIL PROTECTED]
.
.

 Give it up and re-install.  :)


I actually made some progress - found that if I set
$ENV{ACTIVEPERL_CONFIG_DISABLE} then the problem goes away. But I didn't get
much beyond that, and as I need the ActivePerl/Config.pm values, I ended up
taking that advice and re-installing over the top - which fixes the problem.

Bit of a pity - means I'll probably never find out how the directive 'goto
\launcher;' manages to neither run launcher() nor produce an error.

There's another account of this at
http://www.perlmonks.org/index.pl?node_id=577375 . (It's more expansive, and
perhaps better expresed, than what I presented here.)

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with regex

2006-05-12 Thread Karl-Heinz Kuth

Hello,



my $Data = Hello, i am a litte String.$ Please format me.$$$ I am the end
of the String.$$ And i am the last!

The regex should replace $ with the string br, $$ with p and $$$ with
brbr (please don't think about the why)

If tried to use the following:
$data =~ s/\$\$\$/brbr/gm; #should catch every occurrence of $$$
$data =~ s/\$\$/p/gm; #should catch $$
$data =~ s/\$/br/gm; #the rest

So data should look after the first regex:
Hello, i am a litte String.$Please format me.brbrI am the end of the
String.$$And i am the last!
And after the second:
Hello, i am a litte String.$Please format me.brbrI am the end of the
String.pAnd i am the last!
And the last:
Hello, i am a litte String.brPlease format me.brbrI am the end of the
String.pAnd i am the last!

But all regexes i tried (the one above are only one try) failed! When i
print out the string it looks like:

Hello, i am a litte String. Please format me. I am the end of the
String.3398 And i am the last!

Where the number after String. differs between every run.

Can someone help me ?


This works at least on my machine:

use strict;
use warnings;

my $Data = 'Hello, i am a litte String.$ Please format me.$$$ I am the 
end of the String.$$ And i am the last!';


$Data =~ s/([^\$]*)\${3,3}([^\$]+)/$1\br\\br\$2/gm;
$Data =~ s/([^\$]*)\${2,2}([^\$]+)/$1\p\$2/gm;
$Data =~ s/([^\$]*)\${1,1}([^\$]+)/$1\br\$2/gm;
print Data: $Data \n;

___END___

Notice, I change the double quotes to single quotes for $Data.
For me, the regex is clear. But if not for you, I can explain.
There are maybe some better solution, this is just a quick one.

Regards
Karl-Heinz


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with regex

2006-05-12 Thread Yekhande, Seema \(MLITS\)
Holger,

Actually $ is a special character in string in perl. So, if the $ is there in 
the input,
you will have to always write it with the leading escape character. 

So, make your input will be like this,
my $data = Hello, i am a litte String.$ Please format me.$$$ I am the end
of the String.$$ And i am the last!;

It will solve your problem.

Thanks,
Seema
GPCT|TDDS|AIS|SPCM3


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Holger Wöhle
Sent: Friday, May 12, 2006 6:09 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Problem with regex 


 
Hello,
under Windows with ActiveState Perl i have a strange problem with a regex:
Assuming the following String:

my $Data = Hello, i am a litte String.$ Please format me.$$$ I am the end
of the String.$$ And i am the last!

The regex should replace $ with the string br, $$ with p and $$$ with
brbr (please don't think about the why)

If tried to use the following:
$data =~ s/\$\$\$/brbr/gm; #should catch every occurrence of $$$
$data =~ s/\$\$/p/gm; #should catch $$
$data =~ s/\$/br/gm; #the rest

So data should look after the first regex:
Hello, i am a litte String.$Please format me.brbrI am the end of the
String.$$And i am the last!
And after the second:
Hello, i am a litte String.$Please format me.brbrI am the end of the
String.pAnd i am the last!
And the last:
Hello, i am a litte String.brPlease format me.brbrI am the end of the
String.pAnd i am the last!

But all regexes i tried (the one above are only one try) failed! When i
print out the string it looks like:

Hello, i am a litte String. Please format me. I am the end of the
String.3398 And i am the last!

Where the number after String. differs between every run.

Can someone help me ?

With regars
Holger

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Click here for important additional terms relating to this 
e-mail. http://www.ml.com/email_terms/


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with regex

2006-05-12 Thread Andy Speagle
Holger,

This worked for me note that you need to escape the $ characters in your string. The 3398 numberis actually the PID of the perl process returned from the special variable $$ ... since you didn't escape the $ characters..


my $Data = "" i am a litte String.\$ Please format me.\$\$\$ I am the endof the String.\$\$ And i am the last!;
$Data =~ s/[\$]{3}/brbr/;$Data =~ s/[\$]{2}/p/;$Data =~ s/\$/br/;
print $Data .\n;
Hope that helps...

Andy Speagle

-
On 5/12/06, Holger Wöhle [EMAIL PROTECTED] wrote:
Hello,under Windows with ActiveState Perl i have a strange problem with a regex:Assuming the following String:
my $Data = "" i am a litte String.$ Please format me.$$$ I am the endof the String.$$ And i am the last!The regex should replace $ with the string br, $$ with p and $$$ with
brbr (please don't think about the why)If tried to use the following:$data =~ s/\$\$\$/brbr/gm; #should catch every occurrence of data =~ s/\$\$/p/gm; #should catch $$
$data =~ s/\$/br/gm; #the restSo data should look after the first regex:Hello, i am a litte String.$Please format me.brbrI am the end of theString.$$And i am the last!And after the second:
Hello, i am a litte String.$Please format me.brbrI am the end of theString.pAnd i am the last!And the last:Hello, i am a litte String.brPlease format me.brbrI am the end of the
String.pAnd i am the last!But all regexes i tried (the one above are only one try) failed! When iprint out the string it looks like:Hello, i am a litte String. Please format me. I am the end of the
String.3398 And i am the last!Where the number after String. differs between every run.Can someone help me ?With regarsHolger___Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.comTo unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with regex

2006-05-12 Thread John Deighan

At 09:47 AM 5/12/2006, Yekhande, Seema \(MLITS\) wrote:

Holger,

Actually $ is a special character in string in perl. So, if the $ is 
there in the input,

you will have to always write it with the leading escape character.

So, make your input will be like this,
my $data = Hello, i am a litte String.$ Please format me.$$$ I am the end
of the String.$$ And i am the last!;

It will solve your problem.


$ is only special in strings with double quote marks (  ) around 
them. I think you meant to say:


my $data = Hello, i am a little String.\$ Please format me.\$\$\$ I 
am the end of the String.\$\$ And i am the last!;


That works, but, you can also use:

my $data = 'Hello, i am a little String.$ Please format me.$$$ I am 
the end of the String.$$ And i am the last!';


(Note the type of quote mark used)

If you were to print out the original string data like this:

my $data = Hello, i am a litte String.$ Please format me.$$$ I am 
the end of the String.$$ And i am the last!;

print($data\n);

you would get this:

Hello, i am a litte String. format me. I am the end of the 
String.1896 And i am the last!


i.e., the original string did not have any '$' characters in it at all.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with print function

2006-05-09 Thread Karl-Heinz Kuth

Timothy,


How about this:

print $char x $number_of_chars . \n  for 1..$number_of_lines;


that's another way to do it. Thanks for the hint. This looks a little 
more smarter than the other solution, but that's only my opinion. I find 
it more readable.


Thanks
Karl-Heinz

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with print function

2006-05-09 Thread Karl-Heinz Kuth

Suresh,


  Why not use brackets?:
  
  print (($char x $number_of_chars . \n ) x  $number_of_lines, \n);


that's one way to do it. I did not set the outer brackets.  :-*

Thanks
Karl-Heinz

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with print function

2006-05-08 Thread Timothy Johnson
How about this:

print $char x $number_of_chars . \n  for 1..$number_of_lines;



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Karl-Heinz Kuth
Sent: Monday, May 08, 2006 4:30 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Problem with print function

Hi,

I've got the following problem:

use strict;
use warnings;

my $char = -;
my $number_of_lines = 3;
my $number_of_chars = 20;

print This is the output I want: \n;
my $line = $char x $number_of_chars . \n;
print $line x $number_of_lines, \n;

# I do not want to use the var $line. So how to write
# it in one statement?
# My try isn't correct.
print The output with 1 statement: \n;
print  $char x $number_of_chars . \n  x  $number_of_lines, \n;

Regards
Karl-Heinz

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with print function

2006-05-08 Thread Suresh Govindachar

   Karl-Heinz Kuth wrote:
  
   I've got the following problem:
   
   use strict;
   use warnings;
   
   my $char = -;
   my $number_of_lines = 3;
   my $number_of_chars = 20;
   
   print This is the output I want: \n;
   my $line = $char x $number_of_chars . \n;
   print $line x $number_of_lines, \n;
   
   # I do not want to use the var $line. So how to write
   # it in one statement?
   # My try isn't correct.
   print The output with 1 statement: \n;
   print  $char x $number_of_chars . \n  x  $number_of_lines, \n;
  
  Why not use brackets?:
  
  print (($char x $number_of_chars . \n ) x  $number_of_lines, \n);
  
  --Suresh 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem loading OLE.dll on Windows 98

2006-02-09 Thread Sisyphus

- Original Message - 
From: Thomas Mostrup Nymand [EMAIL PROTECTED]
.
.


 Can't load
 '/usr/lib/perl5/vendor_perl/5.8/cygwin/auto/Win32/OLE/OLE.dll' for
 module Win32::OLE: Permission denied at
 /usr/lib/perl5/5.8/cygwin/DynaLoader.pm line 230. at r.pl line 2


As you're subsequent post points out, the error occurs simply from trying to
load Win32::OLE. I doubt that you even have to specify 'qw(EVENTS)' to
trigger the error. I presume you could get a similar error by running:

perl -MWin32::OLE -e 'print ok\n'

I don't have Cygwin ... but I don't believe I've heard of the situation
where an error message that starts with Permission denied ... has ever
meant anything other than there is a permissions problem. Could it be a
problem with directory permissions (if file permissions are ok) ?

What other modules have dll's under the
'/usr/lib/perl5/vendor_perl/5.8/cygwin/auto/' tree ? Can you load those
modules successfully ?

Cheers,
Rob


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem loading OLE.dll on Windows 98

2006-02-09 Thread Sisyphus
Ooops  sent the following to Thomas, but failed to CC the list:

- Original Message - 
From: Thomas Mostrup Nymand [EMAIL PROTECTED]
To: Sisyphus [EMAIL PROTECTED]
Cc: perl-win32-users@listserv.ActiveState.com
Sent: Thursday, February 09, 2006 9:58 PM
Subject: SV: Problem loading OLE.dll on Windows 98


 Hi Rob
 You are absolutely right,  perl -MWin32::OLE -e 'print ok\n' triggers
 the same error:

 $ perl -MWin32::OLE -e 'print ok'
 Can't load
 '/usr/lib/perl5/vendor_perl/5.8/cygwin/auto/Win32/OLE/OLE.dll' for
 module Win32::OLE: Permission denied at
 /usr/lib/perl5/5.8/cygwin/DynaLoader.pm line 230.
  at -e line 0

 I checked permissions in the path, and they are drwxr-xr-x on all
 directories in the path.

 Under /usr/lib/perl5/vendor_perl/5.8/cygwin/auto/ I have Tk installed
 and Im perfectly able to generate windows from perl using Tk.
 Proc::Processtable also has a dll in that path, and I can instantiate
 that also...


Clutching at straws:

Does the OLE.dll file have the same permissions as Tk.dll ?

Are there any other (Win32) dll's installed under the
'/usr/lib/perl5/vendor_perl/5.8/cygwin/auto/Win32/' tree ? If so, can those
modules be successfully loaded ?

There must surely be something different about the Win32::OLE dll, or the
directory that houses it  but it's hard to spot from here :-)

You might have to consult a Cygwin-specific list ... actually ... try the
'libwin' list first. I think there are some Cygwin people subscribed there
who probably aren't on *this* list - and since Win32::OLE is part of libwin,
it would be a reasonable place to post. You can subscribe by sending an
email to [EMAIL PROTECTED] .

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem loading OLE.dll on Windows 98

2006-02-09 Thread Jan Dubois
On Thu, 09 Feb 2006, Sisyphus wrote:
  I checked permissions in the path, and they are drwxr-xr-x on all
  directories in the path.

I know that cygwin doesn't (or at least older versions didn't) set the
correct file and directory permissions.  You'll have to right-click
on the directory or file object and inspect the Security settings
to get the real picture; the simulated Unix security bits don't contain
enough information.  I still see this problem with rsync from cygwin.

You may also want to google for CYGWIN=nontsec.

 You might have to consult a Cygwin-specific list ... actually ... try
 the 'libwin' list first. I think there are some Cygwin people
 subscribed there who probably aren't on *this* list - and since
 Win32::OLE is part of libwin, it would be a reasonable place to post.
 You can subscribe by sending an email to [EMAIL PROTECTED] .

Since doesn't seem to be a problem with Win32::OLE but with local security
settings I would argue that this is off-topic for the libwin32 list,
which is a development and not a general support list.

Cheers,
-Jan


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem identifying Win32 Type

2006-02-08 Thread Sturdevant, Robert W. C-E LCMC SEC-Lee SSC
Hi Howard, thanks for the response. This ought to be pretty simple, BUT...

I looked at Win32::GetOSVersion() several months ago but it doesn't seem to
differentiate between Win 2000 Svr and Pro. Here is a quick example that
provides the same output for both Svr and Pro. It doesn't appear to pull
SPMAJOR, SPMINOR, SUITEMASK, or PRODUCTTYPE. Am I missing something?

Thanks again, Sturdy

Example follows:

my @List = Win32::GetOSVersion();
foreach my $Item (@List)
{
print Item: $Item\n;
}
exit;

OUTPUT:
(STRING)Item: Service Pack 4
(MAJOR) Item: 5
(MINOR) Item: 0
(BUILD) Item: 2195
(ID)Item: 2

-Original Message-
From: Bullock, Howard A. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006 2:14 PM
To: [EMAIL PROTECTED]; perl-win32-users
Subject: RE: Problem identifying Win32 Type

Why not use ...

Win32::GetOSVersion()
 
[CORE] Returns the list (STRING, MAJOR, MINOR, BUILD, ID), where the
elements are, respectively: An arbitrary descriptive string, the major
version number of the operating system, the minor version number, the
build number, and a digit indicating the actual operating system. For
the ID, the values are 0 for Win32s, 1 for Windows 9X/Me and 2 for
Windows NT/2000/XP/2003. In scalar context it returns just the ID.
Currently known values for ID MAJOR and MINOR are as follows:
OSIDMAJOR   MINOR
Win32s 0  -   -
Windows 95 1  4   0
Windows 98 1  4  10
Windows Me 1  4  90
Windows NT 3.512  3  51
Windows NT 4   2  4   0
Windows 2000   2  5   0
Windows XP 2  5   1
Windows Server 20032  5   2
Windows Vista  2  6   0

On Windows NT 4 SP6 and later this function returns the following
additional values: SPMAJOR, SPMINOR, SUITEMASK, PRODUCTTYPE.
SPMAJOR and SPMINOR are are the version numbers of the latest installed
service pack.
SUITEMASK is a bitfield identifying the product suites available on the
system. Known bits are:

VER_SUITE_SMALLBUSINESS 0x0001
VER_SUITE_ENTERPRISE0x0002
VER_SUITE_BACKOFFICE0x0004
VER_SUITE_COMMUNICATIONS0x0008
VER_SUITE_TERMINAL  0x0010
VER_SUITE_SMALLBUSINESS_RESTRICTED  0x0020
VER_SUITE_EMBEDDEDNT0x0040
VER_SUITE_DATACENTER0x0080
VER_SUITE_SINGLEUSERTS  0x0100
VER_SUITE_PERSONAL  0x0200
VER_SUITE_BLADE 0x0400
VER_SUITE_EMBEDDED_RESTRICTED   0x0800
VER_SUITE_SECURITY_APPLIANCE0x1000

The VER_SUITE_xxx names are listed here to crossreference the Microsoft
documentation. The Win32 module does not provide symbolic names for
these constants.
PRODUCTTYPE provides additional information about the system. It should
be one of the following integer values:
1 - Workstation (NT 4, 2000 Pro, XP Home, XP Pro)
2 - Domaincontroller
3 - Server
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem loading OLE.dll on Windows 98

2006-02-08 Thread Foo Ji-Haw



When I try to use Win32::OLE as in the following script:

#!/usr/bin/perl
use Win32::OLE qw(EVENTS);
my $IE  = Win32::OLE-new(InternetExplorer.Application)
   || die Could not start Internet Explorer.Application\n;

I get the following error:

Can't load
'/usr/lib/perl5/vendor_perl/5.8/cygwin/auto/Win32/OLE/OLE.dll' for
module Win32::OLE: Permission denied at
/usr/lib/perl5/5.8/cygwin/DynaLoader.pm line 230. at r.pl line 2

Permissions seem to be OK on OLE.dll, and Im running the same Cygwin
version on XP without problems.

Any hints would be greatly appreciated!
 

A shot in the dark: different versions of IE may have different object 
names? After all, IE3 on Win98 is pretty far off.


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem identifying Win32 Type

2006-02-07 Thread Bullock, Howard A.
Why not use ...

Win32::GetOSVersion()
 
[CORE] Returns the list (STRING, MAJOR, MINOR, BUILD, ID), where the
elements are, respectively: An arbitrary descriptive string, the major
version number of the operating system, the minor version number, the
build number, and a digit indicating the actual operating system. For
the ID, the values are 0 for Win32s, 1 for Windows 9X/Me and 2 for
Windows NT/2000/XP/2003. In scalar context it returns just the ID.
Currently known values for ID MAJOR and MINOR are as follows:
OSIDMAJOR   MINOR
Win32s 0  -   -
Windows 95 1  4   0
Windows 98 1  4  10
Windows Me 1  4  90
Windows NT 3.512  3  51
Windows NT 4   2  4   0
Windows 2000   2  5   0
Windows XP 2  5   1
Windows Server 20032  5   2
Windows Vista  2  6   0

On Windows NT 4 SP6 and later this function returns the following
additional values: SPMAJOR, SPMINOR, SUITEMASK, PRODUCTTYPE.
SPMAJOR and SPMINOR are are the version numbers of the latest installed
service pack.
SUITEMASK is a bitfield identifying the product suites available on the
system. Known bits are:

VER_SUITE_SMALLBUSINESS 0x0001
VER_SUITE_ENTERPRISE0x0002
VER_SUITE_BACKOFFICE0x0004
VER_SUITE_COMMUNICATIONS0x0008
VER_SUITE_TERMINAL  0x0010
VER_SUITE_SMALLBUSINESS_RESTRICTED  0x0020
VER_SUITE_EMBEDDEDNT0x0040
VER_SUITE_DATACENTER0x0080
VER_SUITE_SINGLEUSERTS  0x0100
VER_SUITE_PERSONAL  0x0200
VER_SUITE_BLADE 0x0400
VER_SUITE_EMBEDDED_RESTRICTED   0x0800
VER_SUITE_SECURITY_APPLIANCE0x1000

The VER_SUITE_xxx names are listed here to crossreference the Microsoft
documentation. The Win32 module does not provide symbolic names for
these constants.
PRODUCTTYPE provides additional information about the system. It should
be one of the following integer values:
1 - Workstation (NT 4, 2000 Pro, XP Home, XP Pro)
2 - Domaincontroller
3 - Server


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem (bug?) in Perl/Tk

2005-12-08 Thread Geoff Horsnell
Thanks, Jack. I will try the patch

Cheers

Geoff


-Original Message-
From: Jack D. [mailto:[EMAIL PROTECTED]
Sent: 08 December 2005 05:24
To: 'perl-win32-users'
Cc: [EMAIL PROTECTED]
Subject: RE: Problem (bug?) in Perl/Tk




 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On
 Behalf Of Sisyphus
 Sent: December 7, 2005 1:00 AM
 To: perl-win32-users
 Cc: [EMAIL PROTECTED]
 Subject: Fw: Problem (bug?) in Perl/Tk


 - Original Message -
 From: Geoff Horsnell [EMAIL PROTECTED]
 To: Sisyphus [EMAIL PROTECTED]
 Sent: Wednesday, December 07, 2005 7:53 AM
 Subject: RE: Problem (bug?) in Perl/Tk


  Thanks for your comment. I first tried updating the version
 of Perl to
 5.8.7
  to see if that cured the problem. It didn't. So, here is a
 cut down perl
  script that demonstrates the problem. I attach the file.
 Feel free to
 submit
  it to the user group - I wasn't sure how to link it with my earlier
 text
 

 Best way is to just reply to the list in the same thread and
 provide the
 script in the body of the email (not as an attachment).
 No problem  this post does it for you :-)

 If you still don't get help, try the 'ptk' mailing list. (For
 details, go to
 http://lists.cpan.org and click on the link to ptk. Search
 their archive
 first, as the problem might already have been covered.)

 Here's the script folks :

 use Tk;
 use Tk::Button;
 use Tk::Canvas;
 use Tk::DialogBox;
 use Tk::Tiler;

 use strict;
 use warnings;

 # TEXT: Run this simple program. It creates a window entitled
 Tryit. It
 has one
 # menu item, entitled Select. If you left click on
 Select, a sub-menu
 appears
 # with Enter. Left click on Enter and an Entry sub-window
 appears,entitled
 # Single Entry, with both an entry line, and two buttons,
 entitledAccept
 # and Cancel. Selecting the Cancel button closes the
 window. However,
 selecting
 # the Close button on the title bar should also close the
 window. It does
 for
 # the main window (tryit), but NOT for the sub-window
 (Single Entry).

 # Why is this?

 $::mWin = MainWindow-new;
 $::mcanvas = $::mWin-Canvas(-height=5.c, -width= 5.c);
 $::mcanvas-pack(-expand = 1, -fill = both);
 $::topl = $::mWin-toplevel;
 $::menub1 = $::topl-Menu(-type = menubar);
 $::topl-configure(-menu = $::menub1);
 $::menu1 = $::menub1-cascade(-label = Select, -underline
 = 0, -tearoff
 = 0);
 $::menu1-pack;
 $::menu1-command(-label = Enter, -underline = 0, -command =
 \setEnter);
 $::menu1-pack;
 ::MainLoop;
 exit;

 sub setEnter {
 my ($dialogb, $t1, $t1a, $t1b, $diagb, $val);
 $dialogb = $::mWin-DialogBox (-title = Single Entry, -buttons =
 [Accept, Cancel]);
 $t1 = $dialogb-Tiler (-columns = 2, -rows = 1);
 $t1a = $t1-Message (-justify = right, -text = Enter
 Value, -width =
 100);
 $t1b = $t1-Entry (-textvariable = \$val);
 $t1b-get;
 $t1-Manage ($t1a, $t1b);
 $t1-pack;
 $diagb = $dialogb-Show;
 return;
 }

 __END__

Thanks for forwarding this on Rob. I was going to reply to the first post -
but wasn't sure if Geoff was using a dialog or not (..however, I did suspect
so)

Geoff can do one of two things:

1) Patch the Dialogbox.pm. It can be found at:

http://groups.google.ca/group/comp.lang.perl.tk/msg/716684a805e27143

or

2) Bind the WM_DELETE_WINDOW protocol to invoke the cancel button in the
program itself. To do this put the following code directly after the
creation of the dialogbox.

$dialogb-protocol('WM_DELETE_WINDOW'= sub {
 $dialogb-Subwidget(B_Cancel)-invoke;
 });

HTH.

Jack


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem (bug?) in Perl/Tk

2005-12-07 Thread Jack D.
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Sisyphus
 Sent: December 7, 2005 1:00 AM
 To: perl-win32-users
 Cc: [EMAIL PROTECTED]
 Subject: Fw: Problem (bug?) in Perl/Tk
 
 
 - Original Message -
 From: Geoff Horsnell [EMAIL PROTECTED]
 To: Sisyphus [EMAIL PROTECTED]
 Sent: Wednesday, December 07, 2005 7:53 AM
 Subject: RE: Problem (bug?) in Perl/Tk
 
 
  Thanks for your comment. I first tried updating the version 
 of Perl to
 5.8.7
  to see if that cured the problem. It didn't. So, here is a 
 cut down perl
  script that demonstrates the problem. I attach the file. 
 Feel free to
 submit
  it to the user group - I wasn't sure how to link it with my earlier
 text
 
 
 Best way is to just reply to the list in the same thread and 
 provide the
 script in the body of the email (not as an attachment).
 No problem  this post does it for you :-)
 
 If you still don't get help, try the 'ptk' mailing list. (For 
 details, go to
 http://lists.cpan.org and click on the link to ptk. Search 
 their archive
 first, as the problem might already have been covered.)
 
 Here's the script folks :
 
 use Tk;
 use Tk::Button;
 use Tk::Canvas;
 use Tk::DialogBox;
 use Tk::Tiler;
 
 use strict;
 use warnings;
 
 # TEXT: Run this simple program. It creates a window entitled 
 Tryit. It
 has one
 # menu item, entitled Select. If you left click on 
 Select, a sub-menu
 appears
 # with Enter. Left click on Enter and an Entry sub-window
 appears,entitled
 # Single Entry, with both an entry line, and two buttons, 
 entitledAccept
 # and Cancel. Selecting the Cancel button closes the 
 window. However,
 selecting
 # the Close button on the title bar should also close the 
 window. It does
 for
 # the main window (tryit), but NOT for the sub-window 
 (Single Entry).
 
 # Why is this?
 
 $::mWin = MainWindow-new;
 $::mcanvas = $::mWin-Canvas(-height=5.c, -width= 5.c);
 $::mcanvas-pack(-expand = 1, -fill = both);
 $::topl = $::mWin-toplevel;
 $::menub1 = $::topl-Menu(-type = menubar);
 $::topl-configure(-menu = $::menub1);
 $::menu1 = $::menub1-cascade(-label = Select, -underline 
 = 0, -tearoff
 = 0);
 $::menu1-pack;
 $::menu1-command(-label = Enter, -underline = 0, -command =
 \setEnter);
 $::menu1-pack;
 ::MainLoop;
 exit;
 
 sub setEnter {
 my ($dialogb, $t1, $t1a, $t1b, $diagb, $val);
 $dialogb = $::mWin-DialogBox (-title = Single Entry, -buttons =
 [Accept, Cancel]);
 $t1 = $dialogb-Tiler (-columns = 2, -rows = 1);
 $t1a = $t1-Message (-justify = right, -text = Enter 
 Value, -width =
 100);
 $t1b = $t1-Entry (-textvariable = \$val);
 $t1b-get;
 $t1-Manage ($t1a, $t1b);
 $t1-pack;
 $diagb = $dialogb-Show;
 return;
 }
 
 __END__
 
Thanks for forwarding this on Rob. I was going to reply to the first post -
but wasn't sure if Geoff was using a dialog or not (..however, I did suspect
so)

Geoff can do one of two things:

1) Patch the Dialogbox.pm. It can be found at:

http://groups.google.ca/group/comp.lang.perl.tk/msg/716684a805e27143

or

2) Bind the WM_DELETE_WINDOW protocol to invoke the cancel button in the
program itself. To do this put the following code directly after the
creation of the dialogbox.

$dialogb-protocol('WM_DELETE_WINDOW'= sub {
 $dialogb-Subwidget(B_Cancel)-invoke;
 }); 

HTH.

Jack
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with Win32::Service in sub

2005-12-06 Thread Reinhard Pagitsch



Denis Peuziat wrote:


Hi,

I'm a newbie with perl and I don't know much about programming either. I
wrote a script to manipulate services on Windows, and it works fine :


sub Stop_Service {
print LOGFILE Stopping $_[0] on $_[1] ...\n;
Win32::Service::StopService($_[1], '$_[0]');
 


That shall be:
Win32::Service::StopService($_[1], $_[0]);


sleep(5);
Win32::Service::GetStatus($_[1], '$_[0]', \%status);
 


And that shall be:
Win32::Service::GetStatus($_[1], $_[0], \%status);

What you  are doing in your orignial code is to pass the string $_[0] to 
GetStatus and StopService,

and not the value of $_[0].

regards,
Reinhard
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem (bug?) in Perl/Tk

2005-12-03 Thread Sisyphus

- Original Message - 
From: Geoff Horsnell [EMAIL PROTECTED]
To: Perl Win 32 Users Group perl-win32-users@listserv.ActiveState.com
Sent: Sunday, December 04, 2005 7:30 AM
Subject: Problem (bug?) in Perl/Tk


 I am currently writing an application in Perl/Tk. I have found an annoying
 problem to which I cannot find an answer in the documentation. It is this.


[description snipped]

Best chance for help is to supply a complete (but minimal) script that
demonstrates the problem (and does little else) - something that we can all
run and check out.

You've provided a good description of the problem, so someone *might* be
able to help on the strength of that description ... but you're chances are
definitely improved if you provide a demo script. Make sure to 'use strict;'
and 'use warnings;' in that demo script. (Often you'll find that, in the
writing of the demo script, you'll come to a better understanding of the
problem - perhaps even a solution.)

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem With Win32::OLE and InternetExplorer.Application

2005-08-31 Thread Steven Manross
Sorry for the late reply..  I kind of forgot about Activestate for a
month.. :(

I have absolutely no problems with IE.Application scripts...  I'd be
available for personal requests for help if necessary.  I create a lot
of IE scripts.

I'd probably suggest that you take your Navigate method down to
$IE-Navigate('http://192.168.7.1') and see if the error goes away.

Steven

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
StoneBeat
Sent: Thursday, July 14, 2005 3:35 PM
To: perl-win32-users@listserv.ActiveState.com
Cc: $Bill Luebkert
Subject: Re: Problem With Win32::OLE and InternetExplorer.Application

It must be with InternetExplorer.Application.

I have tryed with Microsoft.XMLHTTP and it works but, this object dont
use Internet Explorer and for my project i must use it.

Thanks Bill

El Jueves 14 Julio 2005 03:30, $Bill Luebkert escribio:
 StoneBeat wrote:
  Hi, i am triying to do a POST request with 
  InternetExplorer.Application but the object refuses to do it and
always does a GET request.
 
  Searching in MSDN i have found :
 
  
 http://msdn.microsoft.com/workshop/browser/webbrowser/reference/metho
 ds/n
 avigate.asp
 
  and my Code is :
 
  use Win32::OLE qw(EVENTS);
  use strict ;
 
  my $IE  = Win32::OLE-new(InternetExplorer.Application);
 
  my $respuesta = X x 2000 ;
 
 
  $IE-Navigate('http://192.168.7.1',0,'_BLANK',$respuesta,undef);

 Why not use LWP instead or do you need the browser window ?

 Maybe a little background on what you're trying to do.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with NetResource::CancelConnection

2005-07-27 Thread Gianvittorio Negri
Hi Chris.
Sorry for my english, probably it is the cause of your doubts, anyway you have 
centered the the core of the question, establishing and deleting windows null 
session.
I've looked about Win32::Lanman and it seems to address my needs.
 
many many tank's for help.
 
 regards

-Original Message- 
From: [EMAIL PROTECTED] on behalf of Chris Wagner 
Sent: Wed 7/27/2005 5:54 AM 
To: perl-win32-admin@listserv.ActiveState.com; 
perl-win32-users@listserv.ActiveState.com 
Cc: 
Subject: Re: Problem with NetResource::CancelConnection



I'm not totally sure what u want to do here but if it's just logging 
into a 
remote server u can use Win32::AdminMisc::LogonAsUser or 
Win32::Lanman:NetUseAdd. 

At 01:43 PM 7/26/05 +0200, Gianvittorio Negri wrote: 
I have the need to be able to submit remote administration command to 
a 
remote server (listing active process and services etc..) and till 
today 
I've used the 
windows internal command  net.exe to establish a connection (net 
use 
\\server\ipc$ /user:domain\user password) and for delete it at the end 
(net use  \\server\ipc$ /d) and all work fine. 





-- 
REMEMBER THE WORLD TRADE CENTER ---= WTC 911 =-- 
...ne cede males 

0100 

___ 
Perl-Win32-Users mailing list 
Perl-Win32-Users@listserv.ActiveState.com 
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs 


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with NetResource::CancelConnection

2005-07-26 Thread Chris Wagner
I'm not totally sure what u want to do here but if it's just logging into a
remote server u can use Win32::AdminMisc::LogonAsUser or
Win32::Lanman:NetUseAdd.

At 01:43 PM 7/26/05 +0200, Gianvittorio Negri wrote:
I have the need to be able to submit remote administration command to a
remote server (listing active process and services etc..) and till today
I've used the 
windows internal command  net.exe to establish a connection (net use
\\server\ipc$ /user:domain\user password) and for delete it at the end
(net use  \\server\ipc$ /d) and all work fine.





--
REMEMBER THE WORLD TRADE CENTER ---= WTC 911 =--
...ne cede males

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with attaching valid .xls files to emails...

2005-07-21 Thread $Bill Luebkert
Scott Overstreet wrote:

 I am having a problem with properly attaching a file to an email in a
 Perl script.  The file that I am attaching to each email is a simple tab
 delimited text file.  The problem is that the text file looks horrible
 because the columns don't line up evenly.  Because this is a mass
 mailer script that sends mail requesting that a bunch of people read
 the attachment and reply, it needs to be easy or people won't do
 it.  (It's a work thing...but where I work, people will simply ignore
 the message if there is anything more to it than double-clicking the
 attachment.)  So what I am trying to find out is how I can get a tab
 delimited excel spreadsheet into my emails; allowing the recipient to
 simply double-click the .xls file and pull up the information.
 
 I have been dabbling with Spreadsheet::WriteExcel::Simple and toying
 with the MIME types set by MIME::Lite and I can't find the correct
 combination of the two.  What I typically end up with is a blah.xls file
 attached to the email and when you double-click it, you get the
 following error message:  Unable to read file.
 
 Any help/suggestions are greatly appreciated.  I apologize in advance if
 this is a newbie question.  I have only been doing Perl for about four
 months now.  Thanks.
 
 -Scott
 
 
  Here is sample code -- I won't paste the entire script to save you
 the pain of having to read it all.  Notice the two lines where I have
 commented like this:  #--- I don't know what to put here. 

Your script didn't compile - always compile snippets before sending.

This works for me, but I have a modified MIME::Lite - if it fails for
you, email me for a possible code patch.  Make sure you make your changes
to addresses and mailserver and filename.

use strict;
use warnings;
use MIME::Lite;

my $filename = shift || 'fubar.xls';
my $recommended_filename = 'something.xls';
my $mime_type = 'application/vnd.ms-excel';
my $message = Sending a .xls file for test\n;

my $from_address = '[EMAIL PROTECTED]';
my $to_address = '[EMAIL PROTECTED]';
my $subject = 'yadda yadda yah';
my $message_body = $message;

MIME::Lite-send('smtp', 'mymailserver.mynetwork.com', Timeout = 60);

# Create the initial text of the message

print new msg\n;
my $msg = MIME::Lite-new(
   From = $from_address,
   To = $to_address,
   Subject = $subject,
   Data = $message_body,
) or die Error creating MIME body: $!\n;

# Attach the file

print attach file\n;
$msg-attach(
   Type = $mime_type,
   Path = $filename,
   Filename = $recommended_filename,
   Disposition = 'attachment',
) or die Error attaching test file: $!\n;

print send\n;
$msg-send;

__END__

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem With Win32::OLE and InternetExplorer.Application

2005-07-14 Thread StoneBeat
It must be with InternetExplorer.Application.

I have tryed with Microsoft.XMLHTTP and it works but, this object dont use 
Internet Explorer and for my project i must use it.

Thanks Bill

El Jueves 14 Julio 2005 03:30, $Bill Luebkert escribió:
 StoneBeat wrote:
  Hi, i am triying to do a POST request with InternetExplorer.Application
  but the object refuses to do it and always does a GET request.
 
  Searching in MSDN i have found :
 
  http://msdn.microsoft.com/workshop/browser/webbrowser/reference/methods/n
 avigate.asp
 
  and my Code is :
 
  use Win32::OLE qw(EVENTS);
  use strict ;
 
  my $IE  = Win32::OLE-new(InternetExplorer.Application);
 
  my $respuesta = X x 2000 ;
 
 
  $IE-Navigate('http://192.168.7.1',0,'_BLANK',$respuesta,undef);

 Why not use LWP instead or do you need the browser window ?

 Maybe a little background on what you're trying to do.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem With Win32::OLE and InternetExplorer.Application

2005-07-13 Thread $Bill Luebkert
StoneBeat wrote:
 Hi, i am triying to do a POST request with InternetExplorer.Application but 
 the object refuses to do it and always does a GET request.
 
 Searching in MSDN i have found :
 
 http://msdn.microsoft.com/workshop/browser/webbrowser/reference/methods/navigate.asp
 
 and my Code is :
 
 use Win32::OLE qw(EVENTS); 
 use strict ;
 
 my $IE  = Win32::OLE-new(InternetExplorer.Application);
 
 my $respuesta = X x 2000 ;
 
 
 $IE-Navigate('http://192.168.7.1',0,'_BLANK',$respuesta,undef);

Why not use LWP instead or do you need the browser window ?

Maybe a little background on what you're trying to do.

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem setting repository

2005-07-12 Thread Chris

 try
 rep add RothConsulting http://www.roth.net/perl/packages

 -- 
 С уважением,
  Сергейmailto:[EMAIL PROTECTED]



This works. Thanks everyone.


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem setting repository

2005-07-12 Thread Peter Eisengrein

 
 ppm set repository RothConsulting http://www.roth.net/perl/packages
 Unknown or ambiguous setting 'repository'. See 'help settings'.
 


Try

ppm repository add RothConsulting http://www.roth.net/perl/packages 
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with DBI and Test::More

2005-05-09 Thread David Dick
Problem solved.  The issue was to do with threading support in 
Test::Builder.  Unfortunately, ActiveState perl 5.8 does not support the 
most recent Test::Builder.  When i pasted in the most recent 
Test::Builder code, the issue described below vanished.  Where are 
requests lodged for modules to be updated?

uru
-Dave
David Dick wrote:
G'day all,
i've been porting an application from linux to see if it would run under 
windows.

i encountered the an error with ActiveState perl 5.8 when using 
Test::More and DBI.

I managed to replicate the problem with DBD::mysql and DBD::SQLite so i 
don't think it's a DBD issue.

The error occurs when the test script exits and reads as so.
Attempt to free unreferenced scalar: SV 0x1b23e34, Perl interpreter: 
0x15d402c at C:/Perl/lib/Test/Builder.pm line 1329.

the error can be generated a number of ways with this code snippet, 
including changing the number of tests to be the (in this case) correct 
value of 1 (or 2), commenting out the 'FetchHashKeyName' parameter and 
commenting out the fetchrow_hashref loop.

Can anyone else replicate the issue?
Uru
-David Dick

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem with DBI and Test::More

2005-05-09 Thread Sisyphus

- Original Message - 
From: David Dick [EMAIL PROTECTED]
To: perl-win32-users@listserv.ActiveState.com
Sent: Tuesday, May 10, 2005 7:38 AM
Subject: Re: Problem with DBI and Test::More


  Where are requests lodged for modules to be updated?

This particular module will be updated as a matter of course. (AS
periodically update their ppm packages, but I don't know much about the
actual scheduling of these updates.)

Is that good enough ? If there's some urgency then we can probably find
someone to contact about it  though I  would think that if you need a
ppm package with the latest version, then the quickest solution would be to
build it yourself.

For instructions on how to build a ppm package browse to your:
 Perl/html/faq/ActivePerl-faq2.html#how_to_make_ppm_distribution

Cheers,
Rob


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with OLE Excel SaveAs Method

2005-04-18 Thread Jan Dubois
On Sat, 16 Apr 2005, amar reddy wrote:
 
 Hai All-
 I Have problem with OLE Excel SaveAs method, if its
 sounds too silly forgive me.we need to create a HTML
 Doc from Excel Worlsheet. We are able to save
 the file as Excel with the follwoing statement
   $xl-ActiveWorkbook-SaveAs( {
 FileName =  $xlfile });
 
 But, unable to save it as HTML doc directly with the
 following statement.
   $xl-ActiveWorkbook-SaveAs( {FileName =
 xlfile, FileFormat = 'xlHTML' });

xlHtml is a symbolic name. You either need to look up the name in the
VBA Editor inside Excel (Alt-F11 to start VBA Editor, F2 to open
object browser), or use Win32::OLE::Const.  Try this one:

$xl-ActiveWorkbook-SaveAs({
FileName   = xlfile,
FileFormat = 44,
});

You should specify the full path name for xlfile, as the current
directory inside Excel may sometimes be surprising. :)

Cheers,
-Jan



___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with TERM::ReadKey

2005-03-30 Thread Chuck Somerville
Unfortunately, that link points to the new .NET compiler.

If you want to compile and link to a  .EXE  executable, those are not
the tools.

.NET doesn't make .EXE executables - it makes things which require
the 21 megabyte .NET runtime. Just one of the reasons I've decided to
just say .NO to .NET.

Interesting reading...

  http://www.joelonsoftware.com/articles/PleaseLinker.html 

Chuck Somerville
Software Engineer, Global Customer Support Services
Kodak Versamark Inc

 Lyle Kopnicky [EMAIL PROTECTED] 3/29/05 15:50 
Jezebel wrote:

problem is, i can not compile the TERM::ReadKey from
source.  whoever wrote it thought that Microsoft's
Visual C++ was a good build environment.  Since I
don't have Visual C++, my nmake always fails at the
cl.exe command.  I tried spoofing it to my c++.exe and
removing some switches, but then it fails on the
link.exe command.  I am not a C++ programmer, so now
I'm stuck.  (My work is also not going to buy me
MSVC++ just so i can compile one stinkin perl module
either.)
  

You can download the Visual C++ compiler for free from Microsoft.  Only

the IDE costs money.

http://msdn.microsoft.com/visualc/vctoolkit2003/ 

Regards,
Lyle Kopnicky

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with TERM::ReadKey

2005-03-29 Thread Lyle Kopnicky
Jezebel wrote:
problem is, i can not compile the TERM::ReadKey from
source.  whoever wrote it thought that Microsoft's
Visual C++ was a good build environment.  Since I
don't have Visual C++, my nmake always fails at the
cl.exe command.  I tried spoofing it to my c++.exe and
removing some switches, but then it fails on the
link.exe command.  I am not a C++ programmer, so now
I'm stuck.  (My work is also not going to buy me
MSVC++ just so i can compile one stinkin perl module
either.)
 

You can download the Visual C++ compiler for free from Microsoft.  Only 
the IDE costs money.

   http://msdn.microsoft.com/visualc/vctoolkit2003/
Regards,
Lyle Kopnicky
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with TERM::ReadKey

2005-03-29 Thread Rhesa Rozendaal
Jezebel wrote:
okay, i have a perl script that sends a text file as
serial data records out an I/O port at variable
baudrates, etc..  
 
I need to have a way to interrupt the data
transmission *cleanly* (not via CTRL-C), so that the
current data string completes to the next CR/LF
terminator before stopping.
 
therefore, i need some sort of unbuffered input so the
program can check whether a character has been pressed
(say, the ESC key), and stops the program, otherwise
it will carry on normally.  
 
I havent been able to get the getc() function to work
as i wanted; i dont have stty.  cygwin is not an
option as this is going to be used by other windows
users who just point to my perl build on a networked
drive.
Have you tried Win32::Console? I remember having written something that did 
exactly this.
/me rummages through large stacks of paper...
Ah yes, there we are:
use Win32::Console;
$|++;  ### this sets STDOUT to auto flush
$STDIN  = new Win32::Console(STD_INPUT_HANDLE);
print Enter something! ;
while($event[0] != 1 or $event[1]) # wait for key up event
{
 @event = $STDIN-Input();
}
print Got: , chr($event[5]), $/;
print Event:$/, map { $i++ . ' ' . $_ . '' . $/ } @event;

I have found what i think is what I need:  The
TERM::ReadKey module and/or the TERM::GetKey module
(which depends on ReadKey)
 
problem is, i can not compile the TERM::ReadKey from
source.  whoever wrote it thought that Microsoft's
Visual C++ was a good build environment.  Since I
don't have Visual C++, my nmake always fails at the
cl.exe command.  I tried spoofing it to my c++.exe and
removing some switches, but then it fails on the
link.exe command.  I am not a C++ programmer, so now
I'm stuck.  (My work is also not going to buy me
MSVC++ just so i can compile one stinkin perl module
either.)
Do you need to compile from source? My ppm finds a precompiled package here:
PPM search ReadKey
Packages available from 
http://ppm.ActiveState.com/cgibin/PPM/ppmserver-5.8-windows.pl?urn:/PPMServer:
TermReadKey [2.30] A perl module for simple terminal control
can anyone help me out?  Is there a better way to
solve my original problem?
 
thanks
 
Jez
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with TERM::ReadKey

2005-03-29 Thread Jezebel

--- Rhesa Rozendaal wrote:
 Have you tried Win32::Console? I remember having
 written something that did exactly this.
  
 [code]

thank you!  i will definitely try that.

 

 
 Do you need to compile from source? My ppm finds a
 precompiled package here:
 
 PPM search ReadKey
 Packages available from

http://ppm.ActiveState.com/cgibin/PPM/ppmserver-5.8-windows.pl?urn:/PPMServer:
 TermReadKey [2.30] A perl module for simple terminal
 control
 

yeah, i never really got that to work right for some
reason.  somehow i managed to compile my perl from
source, and ive been doing it this way ever since.  I
keep thinkin ill get the PPM to work right some day,
but never get around to it

thanks again for all of your help!  :)





__ 
Do you Yahoo!? 
Make Yahoo! your home page 
http://www.yahoo.com/r/hs
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with TERM::ReadKey

2005-03-29 Thread Lloyd Sartor

For information on building AS Perl
under Windows, see http://aspn.activestate.com/ASPN/docs/ActivePerl/lib/Pod/perlwin32.html.

All the tools are available on the internet
at no cost - including MSVC++. The link explains where to get them.

Lloyd






Jezebel [EMAIL PROTECTED]

Sent by: [EMAIL PROTECTED]
03/29/2005 03:03 PM




To
perl-win32-users@listserv.ActiveState.com


cc



Subject
problem with TERM::ReadKey








okay, i have a perl script that sends a text file
as
serial data records out an I/O port at variable
baudrates, etc.. 
 
I need to have a way to interrupt the data
transmission *cleanly* (not via CTRL-C), so that the
current data string completes to the next CR/LF
terminator before stopping.
 
therefore, i need some sort of unbuffered input so the
program can check whether a character has been pressed
(say, the ESC key), and stops the program, otherwise
it will carry on normally. 
 
I havent been able to get the getc() function to work
as i wanted; i dont have stty. cygwin is not an
option as this is going to be used by other windows
users who just point to my perl build on a networked
drive.
 
I have found what i think is what I need: The
TERM::ReadKey module and/or the TERM::GetKey module
(which depends on ReadKey)
 
problem is, i can not compile the TERM::ReadKey from
source. whoever wrote it thought that Microsoft's
Visual C++ was a good build environment. Since I
don't have Visual C++, my nmake always fails at the
cl.exe command. I tried spoofing it to my c++.exe and
removing some switches, but then it fails on the
link.exe command. I am not a C++ programmer, so now
I'm stuck. (My work is also not going to buy me
MSVC++ just so i can compile one stinkin perl module
either.)
 
can anyone help me out? Is there a better way to
solve my original problem?
 
thanks
 
Jez





__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: problem with TERM::ReadKey

2005-03-29 Thread $Bill Luebkert
Jezebel wrote:

 okay, i have a perl script that sends a text file as
 serial data records out an I/O port at variable
 baudrates, etc..  
  
 I need to have a way to interrupt the data
 transmission *cleanly* (not via CTRL-C), so that the
 current data string completes to the next CR/LF
 terminator before stopping.
  
 therefore, i need some sort of unbuffered input so the
 program can check whether a character has been pressed
 (say, the ESC key), and stops the program, otherwise
 it will carry on normally.  
  
 I havent been able to get the getc() function to work
 as i wanted; i dont have stty.  cygwin is not an
 option as this is going to be used by other windows
 users who just point to my perl build on a networked
 drive.
  
 I have found what i think is what I need:  The
 TERM::ReadKey module and/or the TERM::GetKey module
 (which depends on ReadKey)
  
 problem is, i can not compile the TERM::ReadKey from
 source.  whoever wrote it thought that Microsoft's
 Visual C++ was a good build environment.  Since I
 don't have Visual C++, my nmake always fails at the
 cl.exe command.  I tried spoofing it to my c++.exe and
 removing some switches, but then it fails on the
 link.exe command.  I am not a C++ programmer, so now
 I'm stuck.  (My work is also not going to buy me
 MSVC++ just so i can compile one stinkin perl module
 either.)
  
 can anyone help me out?  Is there a better way to
 solve my original problem?

Just install Term::Readkey using PPM - it works fine on Win32
and the compiling is already done for you.

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: problem with TERM::ReadKey

2005-03-29 Thread Robert Johnson
 Jezebel wrote:
 I have found what i think is what I need:  The
 TERM::ReadKey module and/or the TERM::GetKey module
 (which depends on ReadKey)
  
 problem is, i can not compile the TERM::ReadKey from
 source.  


I found an alternative on CPAN:  TERM::GETCH  -- apparently the author
also had trouble with READKEY, and hacked out a reduced version.  It
doesn't require C++.

http://cpan.uwinnipeg.ca/dist/Term-Getch

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem compiling VC++ module with XS

2005-02-23 Thread thomas . hoffmann
 
 Without knowing the specifics, could you do a
#ifdef problem_function
#undef problem_function
#endif
 at an appropriate place in the xs file?
 
 --
 best regards,
 randy kobes
 

Hi Randy,

that did it!

Thanks a lot
Thomas

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem compiling VC++ module with XS

2005-02-22 Thread thomas . hoffmann
Hi Rob,

Thanks for the hint. But the option -TP directs vc++ to handle all files as
C++. The problems are maros defined in lib\CORE\win32iop.h that redefine
standard C function declarations. The same functions (i.e. eof) are declared
in some standard classes but with a different signature. The preprocessor
output causing the errors istream.h(108 - 110):

class __declspec(dllimport) istream : virtual public ios {
...
istream win32_read(char *,int,);
inline istream win32_read(unsigned char *,int,);
inline istream win32_read(signed char *,int,);
...

Regards
Thomas

-Original Message-
From: Sisyphus [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 21, 2005 10:02 PM
To: [EMAIL PROTECTED]
Cc: perl-win32-users@listserv.ActiveState.com
Subject: Re: Problem compiling VC++ module with XS

[EMAIL PROTECTED] wrote:
 Hi List,
  
 I'm trying to compile a C++ XS module with MS VC++ 6.0. Due to defines 
 (redifinition of standard c funktions like eof) in win32iop.h several 
 VC++ standard headers throw errors:
 
  cl -c -I. -TP -MD -Zi -DNDEBUG -O1 -DVERSION=\0.01\
-DXS_VERSION=\0.01\
 -ID:\Perl\lib\CORE -DWIN32 MyPackage.c MyPackage.c

I *think* that if it's C++ code, then 'MyPackage.c' needs to be called
'MyPackage.cpp' with VC++ 6.0.

Cheers,
Rob
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem compiling VC++ module with XS

2005-02-22 Thread Sisyphus
[EMAIL PROTECTED] wrote:
Hi Rob,
Thanks for the hint. But the option -TP directs vc++ to handle all files as
C++.
Sorry - missed that, but *did* notice the syntax errors - and thought 
they might be arising because the cpp files were being treated as c files.

I don't think I can help. Try the comp.lang.perl.modules Newsgroup, if 
you can't find a satisfactory answer elsewhere.

Cheers,
Rob
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem compiling VC++ module with XS

2005-02-22 Thread Randy Kobes
On Tue, 22 Feb 2005 [EMAIL PROTECTED] wrote:

 Hi Rob,

 Thanks for the hint. But the option -TP directs vc++ to
 handle all files as C++. The problems are maros defined in
 lib\CORE\win32iop.h that redefine standard C function
 declarations. The same functions (i.e. eof) are declared
 in some standard classes but with a different signature.
 The preprocessor output causing the errors istream.h(108 -
 110):

 class __declspec(dllimport) istream : virtual public ios {
   ...
 istream win32_read(char *,int,);
 inline istream win32_read(unsigned char *,int,);
 inline istream win32_read(signed char *,int,);
   ...

Without knowing the specifics, could you do a
   #ifdef problem_function
   #undef problem_function
   #endif
at an appropriate place in the xs file?

-- 
best regards,
randy kobes
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem compiling VC++ module with XS

2005-02-21 Thread Sisyphus
[EMAIL PROTECTED] wrote:
Hi List,
 
I'm trying to compile a C++ XS module with MS VC++ 6.0. Due to defines
(redifinition of standard c funktions like eof) in win32iop.h several VC++
standard headers throw errors:

 cl -c -I. -TP -MD -Zi -DNDEBUG -O1 -DVERSION=\0.01\ -DXS_VERSION=\0.01\
-ID:\Perl\lib\CORE -DWIN32 MyPackage.c
MyPackage.c
I *think* that if it's C++ code, then 'MyPackage.c' needs to be called 
'MyPackage.cpp' with VC++ 6.0.

Cheers,
Rob
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with Net::Perl::SSH (and SFTP)

2004-12-30 Thread DePriest, Jason R.
On Thursday, December 23, 2004 10:50 AM, []BAM[] wrote

 Hi everyone,
 
 I'm trying to use SFTP on windows XP to send files to a SUN solaris
 machine. When I create the SFTP object I specify to use protocol 2.
 However I get this warning message:  
 
 Use of uninitialized value in concatenation (.) or string at
 /usr/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 264, GEN0 line
 1.  
 
 I added a print statement in Perl.pm to display the variable
 $remote_id where the problem occurs and I get the following: 
 
  sshd[13590]: WARNING: DNS lookup failed for xxx.xx.xx.xx
 
 where xxx.xx.xx.xx is actually the ip address for my pc.
 
 Does anyone have any clue what the problem could be? I can run the
 same program without problem from a sun workstation. 
 
 On XP I'm running from cygwin using the perl 5.8.5 that comes with
 the distribution.  I can ssh without problem from cygwin. 
 
 Thanks,
 
 Alain

Alain,

Is your system listed in your host file?  If so, is it just listed as
localhost or do you actually have your system name.
Try adding it in if it isn't there.
So you would have something like:
localhost   127.0.0.1
mybox.mydomain.com  xxx.xx.xx.xx

If you are using DHCP for your IP address, this could get tricky; but it
could at least help you identify the problem.

-Jason

PS - I apologize in advance for the legal disclaimer at the bottom of my
email message.  This is tacked on by our SMTP gateway and I have no
control over it.
-- 

--
Confidentiality notice:
This e-mail message, including any attachments, may contain legally privileged 
and/or confidential
information. If you are not the intended recipient(s), or the employee or agent 
responsible for delivery
of this message to the intended recipient(s), you are hereby notified that any 
dissemination,
distribution, or copying of this e-mail message is strictly prohibited. If you 
have received this message
in error, please immediately notify the sender and delete this e-mail message 
from your computer.

==


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem w/ Perl 5 to Perl 8 Update

2004-11-18 Thread Sisyphus
Swartwood, Larry H wrote:
Hello, all.
I see some strange differences in behavior when running my Perl Tk
script with Perl 5.8. 

My script uses DKW's ComboEntry widget that contains a list of host PC
names. If executed with Perl 5.6, the user is able to enter the name of
a host PC that doesn't appear in the list. This capability vanishes if I
install Perl 5.8. If I run the script with Perl 5.8, the user can no
longer edit the ComboEntry list.
Is there some new option in ComboEntry that I need to specify with Perl
5.8.3 in order to regain this functionality?
I don't know the answer but it sounds more like something that would be 
explained in terms ofdifferent versions of ComboEntry widget code 
rather than different versions of perl.

Is the ComboEntry widget code the same in both cases ?
I can imagine that it might be undesirable (under some circumstances) to
allow users to specify *any* PC - and it could simply be that a later
version has removed that option.
Perhaps someone else on this list can provide a more definitive answer. 
If not, then you could try a 'Tk' forum - see http://lists.perl.org . (I 
guess the 'ptk' list is the appropriate list there.) There might also be 
a Tk-specific Usenet newsgroup.

Cheers,
Rob
Cheers,
Rob

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


Re: Problem installing DBD::DB2

2004-10-27 Thread Sisyphus
Dave Kazatsky wrote:
Hey Perlers,
Trying to install Bundle::DBD::DB2 but getting the following error:
removing previously used \.cpan\build\DBD-DB2-0.78 Couldn't find a Bundle
in \.cpan\build\DBD-DB20.78 at D:\Perl\lib\cpan.pm line2081
Using perl -MCPAN install Bundle::DBD:DB2
Windows 2000 Server
Perl v5.8.3
DBI v1.45
Any pointers appreciated.
If you want to try for a ppm package try Googling for DBD-DB2 ppd 
(without the quotes).

I don't know if that helps or not.
Other than that, in the absence of a response from anyone familiar with 
the use of CPAN.pm for building modules, you might like to try building 
the module by the old fashioned manual method - where you download the 
module source from CPAN, extract the source to some folder, cd to that 
folder and run (successively) 'perl makefile.pl', 'nmake test' and 
'nmake install' (after first checking the README that comes with the 
source). That way there might be a chance that you (and/or I) are able 
to make sense of any errors produced :-)

I certainly can't make sense of the errors that CPAN.pm reports ... and 
I've no interest in trying.

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


Re: Problem using Win32::API::Struct properly with SetWindowPlacement

2004-10-08 Thread $Bill Luebkert
Robert Melton wrote:

 I am trying to reposition a window using Win32::API.  I believe my
 struct in this case is malformed but I don't know what is malformed
 about it -- and the WinAPI just gives me a genertic The parameter is
 incorrect..  Any advise would be great -- thanks.

Took a while to get it working, there are bugs in the struct module,
so I usually don't use it.  Added a get to display previous pos.
You can use a more generic window find in the Win32::GuiTest module.
sizeof fails on the untied version.  Use the 'S' type arg if you use
a struct typedef.

use warnings;
use strict;

use Win32;
use Win32::API;
use Win32::API::Struct;

my $debug = 0;
my $FindWindow = new Win32::API('user32', 'FindWindow', 'PP', 'N');
my $GetWindowPlacement = new Win32::API('user32', 'GetWindowPlacement', 'NS',
  'N') or die get GetWindowPlacement: $!;
my $SetWindowPlacement = new Win32::API('user32', 'SetWindowPlacement', 'NS',
  'N') or die get SetWindowPlacement: $!;

$Win32::API::DEBUG = $debug;

Win32::API::Struct-typedef('POINT', qw(
 LONG x;
 LONG y;
)); # 8 bytes

Win32::API::Struct-typedef('RECT', qw(
 LONG left;
 LONG top;
 LONG right;
 LONG bottom;
)); # 16 bytes

Win32::API::Struct-typedef('WINDOWPLACEMENT', qw(
 UINT length;
 UINT flags;
 UINT showCmd;
 POINT ptMinPosition;
 POINT ptMaxPosition;
 RECT rcNormalPosition;
)); # 4+4+4+8+8+16=44 bytes

my $window = $FindWindow-Call(Notepad, 'Untitled - Notepad');
print Window: $window\n if $debug;

# use the tied hash to get sizeof struct since it fails on regular call

my %WindowPlacement;
tie %WindowPlacement, 'Win32::API::Struct', 'WINDOWPLACEMENT' or
  die tie WINDOWPLACEMENT struct: $!;
my $WPsize = $WindowPlacement{sizeof};

my $WindowPlacement = Win32::API::Struct-new('WINDOWPLACEMENT') or
  die new WINDOWPLACEMENT struct: $!;
# my $WPsize = $WindowPlacement-{sizeof};  # no workey - hash works
$WindowPlacement-{length} = $WPsize;   # init struct to avoid some warnings
$WindowPlacement-{flags} = 0;
$WindowPlacement-{showCmd} = 0;
$WindowPlacement-{ptMinPosition}-{x} = 0;
$WindowPlacement-{ptMinPosition}-{y} = 0;
$WindowPlacement-{ptMaxPosition}-{x} = 0;
$WindowPlacement-{ptMaxPosition}-{y} = 0;
$WindowPlacement-{rcNormalPosition}-{left} = 0;
$WindowPlacement-{rcNormalPosition}-{top} = 0;
$WindowPlacement-{rcNormalPosition}-{right} = 0;
$WindowPlacement-{rcNormalPosition}-{bottom} = 0;

print Data::Dumper-Dump([$WindowPlacement], [qw($WindowPlacement-Before)]) if
  $debug;

# get window placement

my $ret = $GetWindowPlacement-Call($window, $WindowPlacement) or
  die GetWindowPlacement-Call: $!;
printf len=%u, flags=%08X, show=%d, MinX=%d, MinY=%d, MaxX=%d, MaxY=%d,  .
  Pos=[%d,%d,%d,%d]\n,
  $WindowPlacement-{length},
  $WindowPlacement-{flags},
  $WindowPlacement-{showCmd},
  $WindowPlacement-{ptMinPosition}-{x},
  $WindowPlacement-{ptMinPosition}-{y},
  $WindowPlacement-{ptMaxPosition}-{x},
  $WindowPlacement-{ptMaxPosition}-{y},
  $WindowPlacement-{rcNormalPosition}-{left},
  $WindowPlacement-{rcNormalPosition}-{top},
  $WindowPlacement-{rcNormalPosition}-{right},
  $WindowPlacement-{rcNormalPosition}-{bottom};

print Data::Dumper-Dump([$ret, $WindowPlacement],
  [qw($GWP-ret $WindowPlacement-After)]) if $debug;

use constant WPF_SETMINPOSITION = 1;
use constant WPF_RESTORETOMAXIMIZED = 2;

use constant SW_HIDE = 0x;
use constant SW_SHOWNORMAL = 0x0001;
use constant SW_SHOWMINIMIZED = 0x0002;
use constant SW_SHOWMAXIMIZED = 0x0003;
use constant SW_SHOWNOACTIVATE = 0x0004;
use constant SW_SHOW = 0x0005;
use constant SW_MINIMIZE = 0x0006;
use constant SW_SHOWMINNOACTIVE = 0x0007;
use constant SW_SHOWNA = 0x0008;
use constant SW_RESTORE = 0x0009;

if (0) {# set to 1 to use struct vs tied hash

$WindowPlacement-{length} = $WPsize;
$WindowPlacement-{flags} = WPF_SETMINPOSITION;
$WindowPlacement-{showCmd} = SW_SHOW;
$WindowPlacement-{ptMinPosition}-{x} = 1;
$WindowPlacement-{ptMinPosition}-{y} = 1;
$WindowPlacement-{ptMaxPosition}-{x} = 100;
$WindowPlacement-{ptMaxPosition}-{y} = 100;
$WindowPlacement-{rcNormalPosition}-{left} = 1;
$WindowPlacement-{rcNormalPosition}-{top} = 1;
$WindowPlacement-{rcNormalPosition}-{right} = 1000;
$WindowPlacement-{rcNormalPosition}-{bottom} = 1000;
print Data::Dumper-Dump([$WindowPlacement],
  [qw($WindowPlacement-Before)]) if $debug;
my $ret = $SetWindowPlacement-Call($window, $WindowPlacement) or
  die SetWindowPlacement-Call: $!;
print Data::Dumper-Dump([$WindowPlacement],
  [qw($WindowPlacement-After)]) if $debug;
printf len=%u, flags=%08X, show=%d, MinX=%d, MinY=%d, MaxX=%d,  .
  MaxY=%d, Pos=[%d,%d,%d,%d]\n,
  $WindowPlacement-{length},
  $WindowPlacement-{flags},
  

Re: Problem using Win32::API::Struct properly with SetWindowPlacement

2004-10-08 Thread Rhesa Rozendaal
Robert Melton wrote:
I am trying to reposition a window using Win32::API.  I believe my
struct in this case is malformed but I don't know what is malformed
about it -- and the WinAPI just gives me a genertic The parameter is
incorrect..  Any advise would be great -- thanks.
Hi Robert, 

I posted this on ExpertsExchange as well.
- sizeof is not an attribute of Win32::API::Structs, but a method, so to set the 
length, you need to do:
   $WindowPlacement-{'length'} = $WindowPlacement-sizeof;
- you should define the struct WINDOWPLACEMENT *after* you define POINT and RECT, since it depends on those. 
- worst of all, the error message at the end is grossly misleading. Don't call it unless SetWindowPlacement returns false.

OK, here's what I changed:
- I moved the struct definitions up towards the start of the script;
- I imported the API's instead of doing Win32::API-new
- your creation of the struct objects was flawed, you called new struct-new(), but that should 
of course simply be struct-new()
Here's my version of your script.
   use warnings;
   use strict;
   use Data::Dumper;
   use Win32;
   use Win32::API;
   use Win32::API::Struct;
   Win32::API::Struct-typedef( 'POINT' = qw(
LONG x;
LONG y;
   ));
   Win32::API::Struct-typedef( 'RECT' = qw(
LONG left; 
LONG top; 
LONG right; 
LONG bottom;
   ));

   Win32::API::Struct-typedef( 'WINDOWPLACEMENT' = qw(
UINT length;
UINT flags;
UINT showCmd;
POINT ptMinPosition;
POINT ptMaxPosition;
RECT rcNormalPosition;
   ));
   my $FindWindow = new Win32::API('user32', 'FindWindow', 'PP', 'N');
   ### using Import instead of new
   Win32::API-Import('user32', 'INT SetWindowPlacement(HWND hWnd, WINDOWPLACEMENT 
lpwndplc)');
   Win32::API-Import('user32', 'INT GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT 
lpwndplc)');
   my $window = $FindWindow-Call(ThunderRT6FormDC, Perl); # Quickpost for EE
   my $UpperLeftPoint = Win32::API::Struct-new( 'POINT' );
   $UpperLeftPoint-{'x'} = 1;
   $UpperLeftPoint-{'y'} = 1;
   my $LeftPoint = Win32::API::Struct-new( 'POINT' );
   $LeftPoint-{'x'} = 1;
   $LeftPoint-{'y'} = 1;
   my $WindowSize = Win32::API::Struct-new( 'RECT' );
   $WindowSize-{'left'} = 1;
   $WindowSize-{'top'} = 1;
   $WindowSize-{'right'} = 1000;
   $WindowSize-{'bottom'} = 1000;
   my $WindowPlacement = Win32::API::Struct-new( 'WINDOWPLACEMENT' );
   $WindowPlacement-{'length'} = sizeof $WindowPlacement;
   print Window: $window\n;
   my $ret = GetWindowPlacement($window, $WindowPlacement);
   print GetWindowPlacement: $ret\n\n;
   print Dumper($WindowPlacement);
   printf Errors (if any): [%0x] %s, Win32::GetLastError(), 
Win32::FormatMessage(Win32::GetLastError()) unless $ret;
   $WindowPlacement-{'flags'} = 0;
   $WindowPlacement-{'showCmd'} = 6;
   $WindowPlacement-{'ptMinPosition'} = $UpperLeftPoint;
   $WindowPlacement-{'ptMaxPosition'} = $LeftPoint;
   $WindowPlacement-{'rcNormalPosition'} = $WindowSize;
   $ret = SetWindowPlacement($window, $WindowPlacement);
   print SetWindowPlacement: $ret\n\n;
   print Dumper($WindowPlacement);
   printf Errors (if any): [%0x] %s, Win32::GetLastError(), 
Win32::FormatMessage(Win32::GetLastError()) unless $ret;
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Problem using Win32::API::Struct properly with SetWindowPlacement

2004-10-07 Thread Sisyphus
Robert Melton wrote:
I am trying to reposition a window using Win32::API.  I believe my
struct in this case is malformed but I don't know what is malformed
about it -- and the WinAPI just gives me a genertic The parameter is
incorrect..  Any advise would be great -- thanks.
--- CODE BELOW ---
use warnings;
use strict;
use Win32;
use Win32::API;
use Win32::API::Struct;
my $FindWindow = new Win32::API('user32', 'FindWindow', 'PP', 'N');
my $SetWindowPlacement = new Win32::API('user32',
'SetWindowPlacement', 'NP', 'N');
Win32::API::Struct-typedef( 'WINDOWPLACEMENT', qw(
 UINT length;
 UINT flags;
 UINT showCmd;
 POINT ptMinPosition;
 POINT ptMaxPosition;
 RECT rcNormalPosition;
));
Win32::API::Struct-typedef( 'POINT', qw(
 LONG x;
 LONG y;
));
Win32::API::Struct-typedef( 'RECT', qw(
 LONG left;
 LONG top;
 LONG right;
 LONG bottom;
));
my $window = $FindWindow-Call(Notepad, 'Untitled - Notepad');
Every time you create a new Struct below you've written 'new' twice. 
Looking at the docs, you could omit the first 'new' ... I don't know if 
that matters. I was unable to detect any effect.

my $UpperLeftPoint = new Win32::API::Struct-new( 'POINT' );
$UpperLeftPoint-{'x'} = 1;
$UpperLeftPoint-{'y'} = 1;
my $WindowSize = new Win32::API::Struct-new( 'RECT' );
$WindowSize-{'left'} = 1;
$WindowSize-{'top'} = 1;
$WindowSize-{'right'} = 1000;
$WindowSize-{'bottom'} = 1000;
my $WindowPlacement = new Win32::API::Struct-new( 'WINDOWPLACEMENT' );
$WindowPlacement-{'flags'} = 0;
$WindowPlacement-{'showCmd'} = 0;
That hides the window and activates another window. Is that what you 
want ? I thought maybe you want SW_SHOWNORMAL which is:
$WindowPlacement-{'showCmd'} = 1;

$WindowPlacement-{'ptMinPosition'} = $UpperLeftPoint;
$WindowPlacement-{'ptMaxPosition'} = $UpperLeftPoint;
$WindowPlacement-{'rcNormalPosition'} = $WindowSize;
I wonder whether it's permissible to assign a typedef to another typedef 
like that. I'm not altogether sure what typedef does. The docs mention 
that it defines an LPNAME type, which holds a pointer to your 
strucure, so it might be that passing a typedef to another typedef is 
not doing what you think it is. Instead, I thought I'd try:

$WindowPlacement-{'ptMinPosition'} = pack('LL', 1, 1);
$WindowPlacement-{'ptMaxPosition'} = pack('LL', 1, 1);
$WindowPlacement-{'rcNormalPosition'}=pack('',1,1,1000,1000);
But that made absolutely no difference, so I'm none the wiser. I'm not 
all that familiar with Win32::API, but I *think* that what I tried there 
is a viable alternative.

$WindowPlacement-{'length'} = $WindowPlacement-{'sizeof'};
I don't think this is right. I find that $WindowPlacement-{'sizeof'} 
returns an empty value (which would equate to zero). For me, the value 
is 44. That would be 4 bytes for 'flags', 4 bytes for 'showCmd', 8 bytes 
for 'ptMinPosition', 8 bytes for 'ptMaxPosition', 16 bytes for 
'rcNormalPosition' and 4 bytes for 'length' - which (I hope) sums to 44. 
I would therefore have it as:

$WindowPlacement-{'length'} = 44;
In C, you just have it as sizeof(WINDOWPLACEMENT), but I don't know how 
you're supposed to emulate that with Win32::API. The docs suggest to me 
that you're expected to use 
Win32::API::Struct-sizeof('WINDOWPLACEMENT'), but for me that returns 0.

print Window: $window\n;
print SetWindowPlacement: .$SetWindowPlacement-Call($window,
$WindowPlacement).\n\n;
print Errors (if any): .Win32::FormatMessage(Win32::GetLastError());
That will always show an error message, even if the current script has 
not produced an error - but the error I keep getting (The parameter is 
incorrect) is certainly being produced by the preceding line of code.

It looks to me that with those changes (or some sort of combination 
thereof) the script should work - but I'm damned if I can get it to do 
the job.

I do have a perl script (using Inline::C) that wraps 'FindWindow' and 
'SetWindowPlacement'. It works fine for repositioning a window - but 
it's not much use to you if you don't have a compiler.

Hope there's something there that helps - or, better still, that someone 
 else can have more success than either you or I have managed :-)

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


Re: Problem: Send Mail with MIME::Lite

2004-07-22 Thread Rhesa Rozendaal
Karl-Heinz Kuth wrote:
List,
if I start a script (code at the end of the mail) with a correct/incorrect
smpt server address I get the following output:
Output correct smpt-server address:
D:\tempperl -w send_mail.pl
Send mail...
OK - RC: 0
Output incorrect smpt-sever address:
D:\tempperl -w send_mail.pl
Send mail...
Failed to connect to mail server: Invalid argument
My problem: The script seems to die, but I don't want that. I want
that the script terminates correctly, because I want to set a special
returncode and write a logfile. So the output should be:
Send mail...
Error - RC: $?
Any suggestions? Is there a way to check the server before?
The general approach to this is to treat the die as an exception. The 
perl analogy to try-catch blocks is this:

eval {
   # code that might die here
};
if($@) {
   # catch block here.
};
If there is an exception, $@ will contain the error message (in your 
case, the Failed to connect...), or - in more sophisticated 
environments, for instance using the Error or Exception::Class module - 
an exception object.

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


RE: problem with length()

2004-04-26 Thread George Gallen
Title: RE: problem with length()






You need to make the answer to the division an

integer before you raise it to the power. You are

getting numbers with a lot of decimal places.


Only the number raised to an integer power are coming

out as whole numbers.


0 4 5 6 7 8 9 10


10 x 10 ^ ( (2-1)/4) = 10 x 10 ^ .25 

10 x 10 ^ ( (2-1)/5) = 10 x 10 ^ .2

10 x 10 ^ ( (2-1)/6) = 10 x 10 ^ .166

10 x 10 ^ ( (2-1)/7) = 10 x 10 ^ .14285

10 x 10 ^ ( (2-1)/8) = 10 x 10 ^ .125

10 x 10 ^ ( (2-1)/9) = 10 x 10 ^ .11

10 x 10 ^ ( (2-1)/10) = 10 x 10 ^ .1


is that the way you want the formula to work?


George


-Original Message-

From: Shain Edge [mailto:[EMAIL PROTECTED]]

Sent: Monday, April 26, 2004 4:00 PM

To: perl

Subject: problem with length()





This program is supposed to set up colums and rows of numbers, 

much like a

spreadsheet would look like. If the number has a length 

greater then 6 digits

long then print a block of x's in place of the number. The 

wierd tyhing is that

with the program below, it only correctly prints prints 

numbers that are

divisble by 10. It is counting any numbers not divisible by 10 

as length 16.



Can anyone show me where I'm going wrong?



Shain



---



for ($a = 0.0; $a = 40; ++$a) {

 print sprintf(%2d,$a);

 for ($b=4.0; $b=10; $b++) {

  if ($a==0) {

   print sprintf( %6d, $b); #display 

power levels in colums for each $b

  } else {

   $speed = 10*10**( ($a-1)/$b );

   if (length($speed)6) {

print sprintf( x%4dx, 

length($speed));

   } else {

print sprintf( %6d, $speed); 

# display speed in even colums for each $b

   }

  }

 }

 print \n; # End row

}



STDIN



=

Mekton Compendium: http://groups.yahoo.com/group/mekton-c/

Subscribe: http://groups.yahoo.com/subscribe/mekton-c



Nothing is impossible. the supposidly impossible can be made 

possible by anyone who determines what you need to do to make 

it a reality. -Shain Edge





 

  

__

Do you Yahoo!?

Yahoo! Photos: High-quality 4x6 digital prints for 25¢

http://photos.yahoo.com/ph/print_splash

___

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: problem with length()

2004-04-26 Thread George Gallen
Title: RE: problem with length()



I'm 
wondering if you want

$speed 
= (10*10**($a-1))/$b

1000 / 
4
1000 / 
5
1000 / 
6
1000 / 
7
1000 / 
8
1000 / 
9
1000 / 
10

2000 / 
4
2000 / 
5
2000 / 
6
.
.


George

  -Original Message-From: George Gallen 
  [mailto:[EMAIL PROTECTED]Sent: Monday, April 26, 2004 4:26 
  PMTo: Shain Edge; perlSubject: RE: problem with 
  length()
  You need to make the answer to the division an 
  integer before you raise it to the power. You are 
  getting numbers with a lot of decimal places. 
  Only the number raised to an integer power are coming 
  out as whole numbers. 
  0 4 5 
  6 7 8 9 10 
  10 x 10 ^ ( (2-1)/4) = 10 x 10 ^ .25 10 x 10 ^ ( (2-1)/5) = 10 x 10 ^ .2 10 x 10 ^ ( 
  (2-1)/6) = 10 x 10 ^ .166 10 x 10 ^ ( (2-1)/7) = 
  10 x 10 ^ .14285 10 x 10 ^ ( (2-1)/8) = 10 x 10 ^ 
  .125 10 x 10 ^ ( (2-1)/9) = 10 x 10 ^ .11 
  10 x 10 ^ ( (2-1)/10) = 10 x 10 ^ .1 
  is that the way you want the formula to work? 
  George 
  ---  
   
   $speed = 10*10**( ($a-1)/$b 
  );   

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


RE: problem with length()

2004-04-26 Thread George Gallen
Title: RE: problem with length()






OK. I ran this in another language.


All the answers except those that come out to 100

are longer than 6 digits including decimals.


Your program is looking for #'s = 6 length, NOT 16


   if (length($speed)6) {


but your description says you want 16 length.


divisble by 10. It is counting any numbers not divisible by 10 

as length 16.


George


my answers for the first 10 cycles are: (skiping 0)


17.7828 15.8489 14.678 13.895 13.3352 12.9155 12.5893

31.6228 25.1189 21.5443 19.307 17.7828 16.681 15.8489

56.2341 39.8107 31.6228 26.827 23.7137 21.5443 19.9526

100 63.0957 46.4159 37.2759 31.6228 27.8256 25.1189

177.8279 100 68.1292 51.7947 42.1697 35.9381 31.6228

316.2278 158.4893 100 71.9686 56.2341 46.4159 39.8107

562.3413 251.1886 146.7799 100 74.9894 59.9484 50.1187

1000 398.1072 215.4435 138.9495 100 77.4264 63.0957

1778.2794 630.9573 316.2278 193.0698 133.3521 100 79.4328 


-Original Message-

From: Shain Edge [mailto:[EMAIL PROTECTED]]

Sent: Monday, April 26, 2004 4:00 PM

To: perl

Subject: problem with length()





This program is supposed to set up colums and rows of numbers, 

much like a

spreadsheet would look like. If the number has a length 

greater then 6 digits

long then print a block of x's in place of the number. The 

wierd tyhing is that

with the program below, it only correctly prints prints 

numbers that are

divisble by 10. It is counting any numbers not divisible by 10 

as length 16.



Can anyone show me where I'm going wrong?



Shain



---



for ($a = 0.0; $a = 40; ++$a) {

 print sprintf(%2d,$a);

 for ($b=4.0; $b=10; $b++) {

  if ($a==0) {

   print sprintf( %6d, $b); #display 

power levels in colums for each $b

  } else {

   $speed = 10*10**( ($a-1)/$b );

   if (length($speed)6) {

print sprintf( x%4dx, 

length($speed));

   } else {

print sprintf( %6d, $speed); 

# display speed in even colums for each $b

   }

  }

 }

 print \n; # End row

}



STDIN



=

Mekton Compendium: http://groups.yahoo.com/group/mekton-c/

Subscribe: http://groups.yahoo.com/subscribe/mekton-c



Nothing is impossible. the supposidly impossible can be made 

possible by anyone who determines what you need to do to make 

it a reality. -Shain Edge





 

  

__

Do you Yahoo!?

Yahoo! Photos: High-quality 4x6 digital prints for 25¢

http://photos.yahoo.com/ph/print_splash

___

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: problem with length()

2004-04-26 Thread $Bill Luebkert
Shain Edge wrote:

 This program is supposed to set up colums and rows of numbers, much like a
 spreadsheet would look like. If the number has a length greater then 6 digits
 long then print a block of x's in place of the number. The wierd tyhing is that
 with the program below, it only correctly prints prints numbers that are
 divisble by 10. It is counting any numbers not divisible by 10 as length 16.
 
 Can anyone show me where I'm going wrong?
 
 Shain
 
 ---
 
 for ($a = 0.0; $a = 40; ++$a) {
   print sprintf(%2d,$a);
   for ($b=4.0; $b=10; $b++) {
   if ($a==0) {
   print sprintf( %6d, $b); #display power levels in colums for 
 each $b
   } else {
   $speed = 10*10**( ($a-1)/$b );
   if (length($speed)6) {
   print sprintf( x%4dx, length($speed));
   } else {
   print sprintf( %6d, $speed); # display speed in even 
 colums for each $b
   }
   }
   }
   print \n; # End row
 }
 
 STDIN

Maybe this is closer to what you want:

use strict;
for (my $a = 0.0; $a = 40; ++$a) {

printf %2d, $a;
for (my $b = 4.0; $b = 10; $b++) {

if ($a == 0) {
printf  %6d, $b;
} else {
#   my $speed = 10 * (10 ** (($a - 1) / $b));
my $speed = sprintf '%u', 10 * (10 ** (($a - 1) / $b));
if (length ($speed)  6) {
#   printf  x%4dx, length $speed;
printf  %s, 'x' x 6;
} else {
printf  %6d, $speed;
}
}
}
print \n; # End row
}

__END__


-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

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


Re: problem with Geo::Shapelib

2004-04-16 Thread Randy Kobes
On Fri, 16 Apr 2004, TELARO BARTOLOMEO wrote:

 Hy all  I'm new of the list.

 I'm trying to compile Geo::Shapelib module from CPAN, after same littles
 changes to Makefile.PL I successfully compiled it with Visual C 6.0, but the
 test.pl crashes and makes
 perl crash to.

 Here the error:
 Free to wrong pool 222770 not 80100 at C:/Perl/site/lib/Geo/Shapelib.pm
 line 333

 At that line the lib call a c-function (_SHPCreateObject) in shapelib.dll

 I found in the list's archive that this kind of problem is created by bugs
 in Perl's multithread support.

 How could I bypass it?

 Thank you in advanced

 Bart

This is a generic type of error - are you using the latest
ActivePerl (based on perl-5.8.3)? This has improved
threading support. If that doesn't help, it might mean
something in the module itself needs fixing.

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


Re: Problem with rename function call in perl

2004-04-12 Thread $Bill Luebkert
Thutika, Srinivas (ODC - Satyam) wrote:

 HI,
 
   The rename function  in perl having some limitation as below.(Will
 not work across file system boundaries).
 rename OLDNAME,NEWNAME 
   Changes the name of a file. Returns 1 for success, 0 otherwise. Will
 not work across file system boundaries.
   I would like to is there any any other rename function that would
 work across file system boundaries.
 
  Actually rename function call in perl can not span across the drives.
 Wanted to know is there any solution for this. 
 
   Pls let me know is there any solution for this.

Have you tried :

use File::Copy;
move ($path, $newpath);

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

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


Re: Problem installing modules

2004-03-18 Thread Sisyphus
Carl Reynolds wrote:

One of the modules I am trying to install is DB_File. After installing, 
when I run a test program I get the following message:

   Can't load 'C:/Perl/lib/auto/DB_File/DB_File.dll' for module DB_File

I gather that this module needs the Berkeley DB C library. If you don't 
have that library then that's probably the reason that the failure occurs.

Note that the error message is a failure to load, not a failure to 
locate - so the file is being found, it just can't be loaded.

Which other modules did you try ? 'Bit::Vector' is one that comes to 
mind that has no dependency on any third party software. Does it produce 
the same error when you install and use it ?

Cheers,
Rob
--
Any emails containing attachments will be deleted from my ISP's mail 
server before I even get to see them. If you wish to email me an 
attachment, please provide advance warning so that I can make the 
necessary arrangements.

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


Re: Problem installing modules

2004-03-18 Thread Carl Reynolds
Thanks for your response. After you sent me the message I experimented 
with several other modules and found they would install properly. So I 
complete remove DB_File from the system and re-installed the 
multi-threaded version. It works now.

Apparently I had tried to install an earlier version before. Then when I 
installed the multi-threaded version of DB_File, perl was still finding 
DB_File.dll from the earlier version instead of the one from the 
multi-threaded version. Removing DB_File and re-installing seems to have 
done the trick.

Thanks for your help.

Carl.



Sisyphus wrote:

Carl Reynolds wrote:

One of the modules I am trying to install is DB_File. After 
installing, when I run a test program I get the following message:

   Can't load 'C:/Perl/lib/auto/DB_File/DB_File.dll' for module DB_File

I gather that this module needs the Berkeley DB C library. If you 
don't have that library then that's probably the reason that the 
failure occurs.

Note that the error message is a failure to load, not a failure to 
locate - so the file is being found, it just can't be loaded.

Which other modules did you try ? 'Bit::Vector' is one that comes to 
mind that has no dependency on any third party software. Does it 
produce the same error when you install and use it ?

Cheers,
Rob



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


Re: Problem to pass WORD value to DLL using Win32::API

2004-02-07 Thread Sisyphus
bogdan.kowalczyk wrote:
All-

Did not received any valuable response for the problem so posted it again.
Maybe someone know how correctly pass WORD value to DLL function
using Win32::API.
Since last e-mail I have created my own DLL to play with different functions
and have not any problem to pass INT or DWORD but once I  pass WORD
I see an exception. It looks to be on a DLL function entry.
Maybe someone saw something about above/below problem.
I checked various archives but did not find anything valuable.
I see also that Aldo Calpini original tests does not check at all WORD parameter
passing.
Thanks,
Bogdan


To:   [EMAIL PROTECTED]
cc:
Fax to:
Subject:  Can't pass WORD value to DLL using Win32::API
All-

Does anybody know how shall I pass WORD value to the Win32 DLL function using
Win32:API?
I need to call DLL function which I import using its prototype as:

Win32::API-Import(adc, BYTE Init1AnalogOutput(DWORD dw_DriverHandle,WORD
w_ChannelNumber,BYTE b_VoltageMode,BYTE b_Polarity));
but once I call it with

$Result2=Init1AnalogOutput($DriverHandle,0x00,0x00,0x02);

I receive run time exception because of memory access violation.

I suppose it is because of the WORD value which I am going to pass to the
function as with other functions from this dll and with other
value types I do not have any problems.
That could be so.
What is this thing that MS call a 'WORD' ?
(Anyone got a link to web page where this info is divulged ?)
Cheers,
Rob
--
Any emails containing attachments will be deleted from my ISP's mail 
server before I even get to see them. If you wish to email me an 
attachment, please provide advance warning so that I can make the 
necessary arrangements.

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


RE: Problem with Win32::Clipboard

2004-01-30 Thread Guay Jean-Sébastien
Hello $Bill et al,

[...]
 # ** This part is the problem **
 if (!$clip-Empty) {

 Empty doesn't check for empty, it clears the clipboard.
 So you're always going to see a null result.
 Just skip the if and check $input for length.

 my $input = $clip-Get();
[...]

Yep, that was it... I should know by now that it isn't just R-ing the FM
that counts, but also _how well_ you R it!

Thanks,

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


RE: Problem running different versions of Perl

2004-01-07 Thread ashish srivastava
Hi Paula,

We tried to use both the approaches i.e. perl script.pl and script.pl . 
But no luck. I have included the entire @INC of perl5.8 in my script.
I really dont understand why this is happening. :(

Ashish


From: Capacio, Paula J [EMAIL PROTECTED]
To: ashish srivastava 
[EMAIL PROTECTED],[EMAIL PROTECTED]
Subject: RE: Problem running different versions of Perl
Date: Tue, 6 Jan 2004 15:41:34 -0600

Ashish Srivastava wrote:
Sent: Monday, January 05, 2004 11:37 PM
We have perl 5.6 and perl 5.8 installed on our server. Perl 5.6 dosent
have
Telnet.pm module installed but perl 5.8 has. So in my script i have
used the
location of v5.8 and it is running fine. But the script errors out when
other user try it from their logins. The error they get is :

Can't locate Net/Telnet.pm in @INC (@INC contains:
/local/perl-5.6.1/lib/5.6.1/i686-linux /local/perl-5.6.1/lib/5.6.1
/local/perl-5.6.1/lib/site_perl/5.6.1/i686-linux
/local/perl-5.6.1/lib/site_perl/5.6.1 /local/perl-5.6.1/lib/site_perl .

The shebang line of my script is :
#!/local/perl5.8/bin/perl   (using perl 5.8 installation)
How to make the script run for other users? Do i need to change the
@INC?
Ashish,
How are the others executing your script?  It's been my experience that
the shebang line only counts when using the .pl association for
execution.
Meaning:
./script.pl ---will use the shebang line in the script
perl script.pl  ---will use whatever perl is related to regardless of
shebang
on my AIX server that is perl - /usr/opt/perl5/bin/perl5.00503
Perhaps the others are typing 'perl' and it relates to version 5.6.1 at
your
shop.  Just a stab in the dark...hope it helps.
Paula

_
Games, MMS cards, ringtones. Operator logos, picture messages  more. 
http://server1.msn.co.in/sp03/mobilesms/ Jazz up your mobile!

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


RE: Problem running different versions of Perl

2004-01-07 Thread Capacio, Paula J
 Ashish Srivastava wrote:
 Sent: Monday, January 05, 2004 11:37 PM
 We have perl 5.6 and perl 5.8 installed on our server. Perl 5.6
dosent
have
 Telnet.pm module installed but perl 5.8 has. So in my script i have
used the
 location of v5.8 and it is running fine. But the script errors out
when

 other user try it from their logins. The error they get is :
 
 Can't locate Net/Telnet.pm in @INC (@INC contains:
 /local/perl-5.6.1/lib/5.6.1/i686-linux /local/perl-5.6.1/lib/5.6.1
 /local/perl-5.6.1/lib/site_perl/5.6.1/i686-linux
 /local/perl-5.6.1/lib/site_perl/5.6.1 /local/perl-5.6.1/lib/site_perl
.
 
 The shebang line of my script is :
 #!/local/perl5.8/bin/perl   (using perl 5.8 installation)
 How to make the script run for other users? Do i need to change the
@INC?

Ashish,
How are the others executing your script?  It's been my experience that
the shebang line only counts when using the .pl association for
execution.
Meaning:
./script.pl ---will use the shebang line in the script
perl script.pl  ---will use whatever perl is related to regardless of
shebang
 on my AIX server that is perl - /usr/opt/perl5/bin/perl5.00503
Perhaps the others are typing 'perl' and it relates to version 5.6.1 at
your
shop.  Just a stab in the dark...hope it helps.
Paula

Ashish Srivastava wrote:
We tried to use both the approaches i.e. perl script.pl and
script.pl . 
But no luck. I have included the entire @INC of perl5.8 in my script.
I really don't understand why this is happening. :(

Me either but then, I don't know much about the X's (Unix/AIX/Linux).
What you are doing is totally possible; The AIX box at my site 
has both 5.004 and 5.05.003 installed on it.  When I want to use 
5.004 I use *perl4* script.pl and when I want 5.05.003 I
use *perl* script.pl.  I rarely rely on the shebang line because my
background is windows and it doesn't apply and therefore I tend to 
forget about it.

Just a thought though...do the others have permissions to read/execute
from the 5.8 file structure?  That's a long shot...but then
I really think this has more to do with your environment than perl
itself.  

I wonder if some other news list would be better able to
help; this being a win32 (Windows) list, it probably isn't drawing the
X crowd. (Unix/AIX/Linux).  Have you tried the google groups?
http://groups.google.com/groups?hl=enlr=ie=UTF-8group=comp.lang.perl
Perhaps the 'module' or 'misc' group could help.
Good Luck,  
Paula 

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


RE: problem in Stored procedure Returning curser

2003-10-16 Thread Moon, John
Note that the ? is not enclosed in quotation marks, even when the
placeholder represents a string. Some drivers also allow placeholders like
:name and :n (e.g., :1, :2, and so on) in addition to ?, but their use is
not portable. Undefined bind values or undef can be used to indicate null
values.

sub Compute_Charge {
my @passed = @_;
my $amt;
my @param = qw(:period :acct :product);
push @param, qw(:frequency :starts :expires :unit_qty :other_rate)
if $#passed  2;
my $call = join ',', @param;
my $sth = $dbh-prepare(
qq{BEGIN
:amt := frc_compute_charges($call);
END;})
or dienice2(__LINE__, $dbh-errstr);
$sth-bind_param_inout(':amt',\$amt, 17);
$sth-bind_param(':period',01-$passed[0]);
$sth-bind_param(':acct',$passed[1]);
$sth-bind_param(':product',$passed[2]);  

If I recall correctly you will need a length for :curref ...  

FUNCTION FRC_COMPUTE_CHARGES
(period IN t_charges_recurring.accounting_period%TYPE,
acctIN t_charges_recurring.account_num%TYPE,
product IN t_charges_recurring.product_key%TYPE,
frequency IN t_charges_recurring.billing_frequency_desc%TYPE default
NULL,
starts  IN t_charges_recurring.service_starts_date%TYPE default
NULL,
expires IN t_charges_recurring.service_expires_date%TYPE DEFAULT
NULL,
units_qty IN t_charges_recurring.billable_units_qty%TYPE DEFAULT NULL,
other_rate  IN  t_charges_recurring.agreed_cost%TYPE DEFAULT NULL)
RETURN
t_charges_recurring.last_charge_amt%TYPE
IS  

Hope this helps ...

jwm

 -Original Message-
 From: Thutika, Srinivas (ODC - Satyam) [mailto:[EMAIL PROTECTED]
 Sent: October 16, 2003 04:20
 To:   '[EMAIL PROTECTED]'
 Subject:   problem in Stored procedure Returning curser
 
 Hi Friends,
 
 My problem is as below.
 
 I am calling a stored procedure which returns Curser.
 
 I am calling the Stored procedure as below.
 
$sql=q ( BEGIN
   
 MLPKG_INBOUND.SPMLGETSOURCEDIRECTORIES(:curref);  //This is a stored
 procedure package.procedure name
   END;
);
   my $rref;
   my $sth = $dbh-prepare($sql);
   $sth-bind_param_inout(:curref, \$rref, 0, {ora_type =
 ORA_RSET});
   $sth-execute or die Can't execute SQL statement:
 $DBI::errstr\n;
 
 I am Getting the following Error
 
 Can't bind unknown placeholder ':curref' at InboundDAO_1.4.pl line 202.
 
 Pls help me out in solving this issue...
 
 --Thanks Regards
 Srinivas Thutika
 *  [EMAIL PROTECTED]
 
 
 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem with if statement

2003-09-10 Thread Moon, John
If($FORM{membername ne  }) {
should read if($FORM{membername} ne  ) {  

If you use CGI you wouldn't need from read ...
to line before $blank =  ;

use strict;
use CGI;
use vars qw(%FORM);
my $q=new CGI;
foreach ($q-param) {
$FORM{$_}=$q-param($_);
}
$blank=  ;

If(exists($FORM{membername})  $FORM{mmembername} ne  }) {
 $membername = $FORM{membername};
 }
else  {
 print stop\n;
}
sleep 60;

use DBI(); 
jwm

-Original Message-
From: upscope [mailto:[EMAIL PROTECTED]
Sent: September 10, 2003 13:04
To: Perl Win32 users
Subject: Problem with if statement


When I execute the following code I get an error that says there is a syntax
error on line 21 near } ). Can anyone see what I'm missing?
The sleep in  the print in the else statement and the sleep are just for
testing. I'm trying to check for a blank membername field, the else
statements will check the other fields. I also get same error with the ne 
 not in the if statement.

Snip
#!c:\perl\bin\perl

print Content-type:text/html\n\n;

#Parse the form data
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(//,$buffer);
foreach $pair (@pairs){
 ($name, $value) = split(/=/, $pair);
 $value =~ tr/+/ /;
 $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C,hex($1))/eg;
 $value =~ s/\n/ /g;
 $value =~ s/\r/ /g;
 $value =~ s/\cM/ /g;
 $name =~ tr/+/ /;
 $name =~ tr/_/ /;
 $FORM{$name} = $value;
 }
$blank=  ;

If($FORM{membername ne  }) {
 $membername = $FORM{membername};
 }
else  {
 print stop\n;
}
sleep 60;

use DBI();

Thanks for your help in advance!
Upscope

This email scanned by Trendmicro Internet Security Beta Version11

___
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: Problem with if statement

2003-09-10 Thread Dave Kazatsky

The if statement shouldn't be
capitalized. Give that a try.

Dave Kazatsky
Senior Middleware Administrator
W. (908) 575-6947
C. (973) 865-8106






upscope
[EMAIL PROTECTED]
Sent by:
[EMAIL PROTECTED]
09/10/2003 01:04 PM


To: 
  Perl Win32 users
[EMAIL PROTECTED]
cc: 
  
Subject: 
  Problem with if statement



When I execute the following code I get an
error that says there is a syntax
error on line 21 near } ). Can anyone see what I'm missing?
The sleep in the print in the else statement and the sleep are just
for
testing. I'm trying to check for a blank membername field, the else
statements will check the other fields. I also get same error with the ne

 not in the if statement.

Snip
#!c:\perl\bin\perl

print Content-type:text/html\n\n;

#Parse the form data
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(//,$buffer);
foreach $pair (@pairs){
 ($name, $value) = split(/=/, $pair);
 $value =~ tr/+/ /;
 $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C,hex($1))/eg;
 $value =~ s/\n/ /g;
 $value =~ s/\r/ /g;
 $value =~ s/\cM/ /g;
 $name =~ tr/+/ /;
 $name =~ tr/_/ /;
 $FORM{$name} = $value;
 }
$blank=  ;

If($FORM{membername ne  }) {
 $membername = $FORM{membername};
 }
else {
 print stop\n;
}
sleep 60;

use DBI();

Thanks for your help in advance!
Upscope

This email scanned by Trendmicro Internet Security Beta Version11

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




The information contained in this message may be CONFIDENTIAL and is for
the intended addressee only.  Any unauthorized use, dissemination of the
information, or copying of this message is prohibited.  If you are not the
intended addressee, please notify the sender immediately and delete this
message.


RE: Problem with if statement

2003-09-10 Thread Joseph Discenza
upscope wrote, on Wednesday, September 10, 2003 1:04 PM
:  When I execute the following code I get an error that says there 
:  is a syntax
:  error on line 21 near } ). Can anyone see what I'm missing?

:  If($FORM{membername ne  }) {

Try:

  if($FORM{membername} ne  ) {

Does that help any?

Joe

==
  Joseph P. Discenza, Sr. Programmer/Analyst
   mailto:[EMAIL PROTECTED]
 
  Carleton Inc.   http://www.carletoninc.com
  574.243.6040 ext. 300fax: 574.243.6060
 
Providing Financial Solutions and Compliance for over 30 Years
* Please note that our Area Code has changed to 574! *  




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


Re: Problem with if statement

2003-09-10 Thread eric-amick
 If($FORM{membername ne  }) {

if($FORM{membername} ne  ) {

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


RE: Problem with if statement

2003-09-10 Thread Peter C. Hugger
It looks like a simple syntax error. You have a capital I in your if
statement. It should be all lower case.



PCH

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
upscope
Sent: Wednesday, September 10, 2003 1:04 PM
To: Perl Win32 users
Subject: Problem with if statement


When I execute the following code I get an error that says there is a syntax
error on line 21 near } ). Can anyone see what I'm missing?
The sleep in  the print in the else statement and the sleep are just for
testing. I'm trying to check for a blank membername field, the else
statements will check the other fields. I also get same error with the ne 
 not in the if statement.

Snip
#!c:\perl\bin\perl

print Content-type:text/html\n\n;

#Parse the form data
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(//,$buffer);
foreach $pair (@pairs){
 ($name, $value) = split(/=/, $pair);
 $value =~ tr/+/ /;
 $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C,hex($1))/eg;
 $value =~ s/\n/ /g;
 $value =~ s/\r/ /g;
 $value =~ s/\cM/ /g;
 $name =~ tr/+/ /;
 $name =~ tr/_/ /;
 $FORM{$name} = $value;
 }
$blank=  ;

If($FORM{membername ne  }) {
 $membername = $FORM{membername};
 }
else  {
 print stop\n;
}
sleep 60;

use DBI();

Thanks for your help in advance!
Upscope

This email scanned by Trendmicro Internet Security Beta Version11

___
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


  1   2   >