OT -- text editors in windows (was: Good IDE's, either freeware or commercial, for debugging?)

2001-11-12 Thread Thiebaud Richard

>From: Jeffrey [mailto:[EMAIL PROTECTED]]
>Sent: Friday, November 09, 2001 10:06 PM
>To: [EMAIL PROTECTED]
>Subject: RE: Good IDE's, either freeware or commercial, for debugging?
>
> The main point that I am making is that *I* don't need
> an IDE for Perl -- so a simple, free (as in free beer
> or free speech, whichever you prefer) text editor is
> fine.  

Text editors are such a matter of habbit that I consider them basicly a
religious argument.

There are any number of free (in either sense) text editors for windows,
simple or complicated.
Nevertheless, many developers people find that, for their own particular
habits and preferences, 
a particular commercial text editor has a combination of features and
interface which makes it 
worth paying for.  I'm one of them.

Other people don't.  That's fine too.

I won't comment more on this because I don't have anything useful to say.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: How to omit lines from execution in a perl program

2001-11-12 Thread Johan Lindstrom

Nick wrote:
>I can currently set a debug variable that prevents output, but
>I would rather the debug statements were never executed for
>optimum speed.

use constant DEBUG => 1;  #or 0
print "Blah" if(DEBUG);

The if-statement should be resolved at compile time, not run-time AFAIK.


/J

--  --- -- -- -- -  -   ---
Johan LindströmBoss Casinos
Sourcerer [EMAIL PROTECTED]
  http://www.bahnhof.se/~johanl/
If the only tool you have is a hammer,
everything tends to look
like a nail 


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Catching a kill issued from WINDOWS TaskManager

2001-11-12 Thread William G. Hutchinson




Sorry for not searching the many useful past 
discussion lists...
 
Is there a way to catch a kill request, within a 
Perl script, issued from the Windows TaskManager so that a graceful exit 
can occur?  (i.e., the key is that the Perl wrapper will be specifically 
killed, by PID, from a foreign agent)
 
Any help will be useful..
 
thanks
Bill


RE: How to omit lines from execution in a perl program

2001-11-12 Thread Ron Hartikka

Just remove the debug statements once and put them in a second script to be
exec'd based on command line parameter.

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Nick Djurovich
> Sent: Monday, November 12, 2001 12:45 PM
> To: PERLMAILINGLIST
> Subject: How to omit lines from execution in a perl program
>
>
> Hi,
>
> I have a perl script with lots of debug statements. I want
> to be able to run the script without the debug statements.
> Is there a way to do this in runtime ?
>
> I can currently set a debug variable that prevents output, but
> I would rather the debug statements were never executed for
> optimum speed.
>
> I have thought of a way, in which at the start, if specified
> by a command line parameter, it slurps itself up into a large
> string, removing the debug statements and then evaluating
> the string, and then exits. Yuck.
>
> Regards
>
> Nick Djurovich
> 
> Software Development Manager
> mediaMailGroup
> Colchester
> UK
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
>
>


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: How to omit lines from execution in a perl program

2001-11-12 Thread Jeffrey

How much of a performance hit is an if statement?

Enclose everything that is a debug in an 'if ($debug)'
block, and all of the code will be skipped if $debug
is not defined or is set to 0.

Any reasons why this won't work out for you?

--- Nick Djurovich <[EMAIL PROTECTED]>
wrote:
> Hi,
> 
> I have a perl script with lots of debug statements.
> I want
> to be able to run the script without the debug
> statements.
> Is there a way to do this in runtime ?
> 
> I can currently set a debug variable that prevents
> output, but
> I would rather the debug statements were never
> executed for
> optimum speed.
> 
> I have thought of a way, in which at the start, if
> specified
> by a command line parameter, it slurps itself up
> into a large
> string, removing the debug statements and then
> evaluating
> the string, and then exits. Yuck.
> 
> Regards
> 
> Nick Djurovich
> 
> Software Development Manager
> mediaMailGroup
> Colchester
> UK 
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
>
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users


=

Jeffrey
[EMAIL PROTECTED]

__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



How to omit lines from execution in a perl program

2001-11-12 Thread Nick Djurovich

Hi,

I have a perl script with lots of debug statements. I want
to be able to run the script without the debug statements.
Is there a way to do this in runtime ?

I can currently set a debug variable that prevents output, but
I would rather the debug statements were never executed for
optimum speed.

I have thought of a way, in which at the start, if specified
by a command line parameter, it slurps itself up into a large
string, removing the debug statements and then evaluating
the string, and then exits. Yuck.

Regards

Nick Djurovich

Software Development Manager
mediaMailGroup
Colchester
UK 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Strange performance problem processing large files

2001-11-12 Thread Tim . Moose

I've run into a strange performance problem that has me stumped. When processing large files, in this case 30MB, the performance of my script drags to a crawl. I've boiled the original problem down to a much smaller size and included the code at the end of the message. Here is the main loop. The loop reads in a line, modifies and stores the line an a newly created object and pushes the object onto an array.

        # Read in the file and store some data in some objects.
        while () {

                if ($ARGV[0] eq 'weird') {
                        # No performance problem when deleting only two characters.
                        # This is very weird!
                        s/..//;
                } else {
                        # Delete three characters. Is that so bad?
                        s///;
                }

                # Create an object.
                $object = new Object();

                if ($ARGV[0] eq 'odd') {
                        # No performance problem when dummy object are created.
                        # This is very odd!
                        $dummy = new Dummy();
                        push @dummy, $dummy;
                }

                # Assign the modified line to a data member.
                $object->{V1} = $_;

                # Store the object away.
                push @objects, $object;

                # Every 2 lines, print out the line number and the time
                # elapsed since the previous line.
                if ($. % 2 == 0) {
                        $now = time();
                        print "$.\t${\($now - $last)}\t${average}\n";
                        $last = $now;
                }
        }

Every 2 lines, the script prints out the line number and the time elapsed from the previous print statement. Here is the output I get. Notice that processing slows down dramatically after 14 lines (it gets much worse with larger files).

        C:\tmp>perl slow.pl

        Reading input file.

        Line#   Sec
        =   ===
        2   2
        4   3
        6   3
        8   3
        10  2
        12  2
        14  15
        16  42
        18  88

Just for fun, I made some random changes and found the performance problem to mysteriously vanish. This can be seen by running with an argument of 'weird' or 'odd'. If you look at what 'weird' and 'odd' do in the code, it doesn't seem like it should matter. Here is the weird and odd output.

        C:\tmp>perl slow.pl weird

        Reading input file.

        Line#   Sec
        =   ===
        2   2
        4   3
        6   2
        8   2
        10  2
        12  1
        14  1
        16  1
        18  2

        C:\tmp>perl slow.pl odd

        Reading input file.

        Line#   Sec
        =   ===
        2   2
        4   3
        6   3
        8   3
        10  2
        12  2
        14  2
        16  1
        18  3

So, can anyone offer an explanation for this behaviour---or better yet, propose a solution? Thanks in advance!

BTW, I'm running ActivePerl v5.6.1 (build 626) on Windows 2000, 384MB RAM.

The input file can be found here in slow.zip. If you have problems retrieving file, I can email it.

        http://briefcase.yahoo.com/bc/wtmoose/lst?.dir=/My+Folder+(shared)&.view=l

The source code is below.

-Tim


###
# Just some object with several data members.
package Object;
sub new {
        my $class = shift;
        my $self = {
                'V1' => undef,  'V2' => undef,
                'V3' => undef,  'V4' => undef,
                'V5' => undef,  'V6' => undef,
                'V7' => undef,  'V8' => undef,
                'V9' => undef,  'V10' => undef,
                'V11' => undef, 'V12' => undef,
        };
        return bless $self, $class;
}

# Dummy object that makes it work, oddly enough.
package Dummy;
sub new {
        my $class = shift;
        my $self = {};
        $self->{DUMMY} = undef,
        return bless $self, $class;
}

package Main;

print "\nReading input file.\n\n";
print "Line#   Sec\n";
print "=   ===\n";
open FILE, "
$last = time();

# Read in the file and store some data in some objects.
while () {

        if ($ARGV[0] eq 'weird') {
                # No performance problem when deleting only two characters.
                # This is very weird!
                s/..//;
        } else {
                # Delete three characters. Is that so bad?
                s///;
        }

        # Create an object.
        $object = new Object();

        if ($ARGV[0] eq 'odd') {
                # No performance problem when dummy object are created.
                # This is very odd!
                $dummy = new Dummy();
                push @dummy, $dummy;
        }

        # Assign the modified line to a data member.
        $object->{V1} 

Re: Will write a Tutorial on Win32::GUI ...

2001-11-12 Thread Stephen Patterson

On Monday 12 November 2001 1:27 pm, Johannes Gamperl wrote:
> Hello all,
>
> i'm a german editor of webdevelopement. i' playing to write a
> documentation for the Win32::GUI and also a detailed tutorial for a
> planed Book to Perl Developement on Win32 and specialy for GUI
> Developement.
>
> My work will be published on Web, after doing ... but this could be
> taken a while ;.)
>
> Ok, what i do ist to check all available Widgets, but the
> documentation is a bit poor ;-) Any helps are welcome.

There are some tutorials at the win32::GUI home page 
http://sourceforge.net/docman/?group_id=16572
(the guitut1 is empty)
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: disk quota

2001-11-12 Thread Charbeneau, Chuck

> From: lonh SENG [mailto:[EMAIL PROTECTED]]
> Subject: disk quota


> Can you help me?

Yes, we can.  

> I want to write a script to create disk quota for all home 
> directories of all users.  Their sizes are the same.

As a matter of fact, I wrote exactly that for the ME department at Michigan
Tech.  But what have you tried already?  Many of us here would hardly want
to do either your job or your homework for you without first seeing what you
have already tried.  But we would be more than willing to help you along the
way to enlightenment.

Chuck
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Will write a Tutorial on Win32::GUI ...

2001-11-12 Thread Johannes Gamperl

Hello all,

i'm a german editor of webdevelopement. i' playing to write a
documentation for the Win32::GUI and also a detailed tutorial for a
planed Book to Perl Developement on Win32 and specialy for GUI
Developement.

My work will be published on Web, after doing ... but this could be
taken a while ;.)

Ok, what i do ist to check all available Widgets, but the
documentation is a bit poor ;-) Any helps are welcome.

My general questions:
  * Aldo, do you have some more documentation?
  * Will the Win32::GUI still develop?
  * Is ther a way to get all archived Mails of the old and
new MailingLists ... ?


First work i did is to play arround the Button-Widget. So this are my
up to now conclusion:



Question to options:
  * the background, foreground options seems not to be suppored
on the Button-Widget?
  * are this all available options for the Button-Widget?

  
Question to Styles:
  * Do you have any eg. for the usage of BS_BITMAP and BS_ICON?
  * Any eg. of the usage and description of BS_NOTIFY ,BS_OWNERDRAW
and BS_PUSHBUTTON?


Questions to Events:
  * Any Ideas to use GotFocus(), LostFocus(), MouseDown() and
MouseUp()?

something like that, doesn't work:

sub Button_MouseDown() {
  print "Mouse Down";
  return 1;
}



Eg. (hope this is correct ...)

1. Tabstop for Buttons

   * Set for all relevant Widgets the -tabstop option to 1.
   * Use $Your_window_name->{-dialogui} = 1;
 (You need this to realize Tabstop and ENTER Event)

2. Hit a Button on ENTER

   * Set for all relevant Widgets the -tabstop option to 1.
   * For commands set -ok option to 1

3. Set Button to default on loading

   * Set -default option to 1

4. Do action by click on ESC

   * Set -cancel option to 1

5. Get a dblClick Event

   * set -addstyle => BS_NOTIFY,
 



::AddButton();
-

*** Options ***

-name => name of the widget
-text => Caption
-titel=> same as -text
-left => x-pos in px
-top  => y-pos in px
-width=> width
-height   => height
-size => [width, height]
-pos  => [x-pos, y-pos]  
-align=> left/center/right (default left)
-valign   => top/center/bottom (default center)
-default  => 0/1 (default 0)
-ok   => 0/1 (default 0)
-cancel   => 0/1 (default 0)
-disabled => 0/1 (default 0)
-font => Fontobject (needs ::Font)
-addstyle => see Styles (more than one, separated by |)
-visible  => 0/1 (default 1)
-tabstop  => 0/1 (default 0)


*


*** Styles ***

BS_TOP|BS_VCENTER|BS_BOTTOM (use -valign option)
BS_CENTER|BS_LEFT|BS_RIGHT (use -align option)

BS_TEXT (no need to use)
I think this sytles will be called internal of the Modul to display
-text opitionl. Is this right?

BS_DEFPUSHBUTTON
Creates a push button that behaves like a BS_PUSHBUTTON style
button, but also has a heavy black border. If the button is in a
dialog box, the user can select the button by pressing the ENTER
key, even when the button does not have the input focus. This style
is useful for enabling the user to quickly select the most likely
(default) option.

BS_MULTILINE
Wraps the button text to multiple lines if the text string is
too long to fit on a single line in the button rectangle.

This seems only has a effect by wraping the lines with \n inside the
-text option. eg.

-text => "I'm a long Button text.\nSo i have to get a wrap.",

Problem: You have to adjust height and width of the Button.

BS_BITMAP
Specifies that the button displays a bitmap.

BS_ICON   
Specifies that the button displays an icon.

BS_USERBUTTON (obsolet, was only used for 16-bit Windows)


BS_NOTIFY
no exact idea .. any help for usage?
(ok, i found, that this style could used to get the dblClick
Event ...)

BS_OWNERDRAW
no exact idea .. any help for usage?

BS_PUSHBUTTON
no exact idea .. any help for usage?


*


*** Events ***

Click()
This event is sent by a click on the button.

DblClick()
This event is sent by a dbl-click on the button.


GotFocus()
no exact idea .. any help for usage?

LostFocus()
no exact idea .. any help for usage?

MouseDown()
no exact idea .. any help for usage?

MouseUp() 
no exact idea .. any help for usage?



*


*** Eg. of AddButton usage: ***


use Win32::GUI;

$MainWindow = new Win32::GUI::Window(
  -pos => [100, 100],
  -size=> [130, 110], 
  -name   => "Win",
  -text   => "AddButton - eg.",
  );

$MainWindow->{-dialogui} = 1;

$b1 = $MainWindow->AddButton(
   -name => "Button_1",
   -text => "I'm a normal-Button",
   -pos  => [10, 10],  
   -default  => 1,
   -ok   => 1,
   -tabstop  => 1,
   -addstyle => BS_NOTIFY,
  );
  
$b2 = $MainWindow->AddButton(
   -name => "Button_2",
   -text => "I'm a close-Button",
   -pos  => [10, 50],