[29390] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 634 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 8 16:09:55 2007

Date: Sun, 8 Jul 2007 13:09:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 8 Jul 2007     Volume: 11 Number: 634

Today's topics:
        "Pop" an alert of some sort in Windows <wheeledBob@yahoo.com>
    Re: "Pop" an alert of some sort in Windows <lambik@kieffer.nl>
    Re: "Pop" an alert of some sort in Windows <bik.mido@tiscalinet.it>
    Re: "Pop" an alert of some sort in Windows <wheeledBob@yahoo.com>
    Re: "Pop" an alert of some sort in Windows <kevin@vaildc.net>
    Re: How to check a form's field and exit Perl program i <cwilbur@chromatico.net>
        Pause Perl Program? <wheeledBob@yahoo.com>
    Re: Pause Perl Program? <mritty@gmail.com>
    Re: Pause Perl Program? <wheeledBob@yahoo.com>
    Re: Pause Perl Program? <bart.lateur@pandora.be>
    Re: Pause Perl Program? <bik.mido@tiscalinet.it>
    Re: Pause Perl Program? <lambik@kieffer.nl>
    Re: stopping spam with JavaScript (was: Re: validating  <bik.mido@tiscalinet.it>
    Re: stopping spam with JavaScript (was: Re: validating  <usenet-mail@markshroyer.com>
    Re: stopping spam with JavaScript (was: Re: validating  <tadmc@seesig.invalid>
    Re: The Modernization of Emacs: terminology buffer and  <lew@lewscanon.nospam>
    Re: The Modernization of Emacs: terminology buffer and  <borud-news@borud.no>
    Re: The Modernization of Emacs: terminology buffer and  <twisted0n3@gmail.com>
    Re: The Modernization of Emacs: terminology buffer and  <twisted0n3@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 08 Jul 2007 16:06:09 GMT
From: still me <wheeledBob@yahoo.com>
Subject: "Pop" an alert of some sort in Windows
Message-Id: <gf2293dlm8it7qjt02drn1h9gfi7fsdabs@4ax.com>

I have a program that I need to run at Windows startup (I can handle
that part, at least as a command line startup->run). But, in some
cases I'd like to pop a window/warning in MS-windows at completion.
I'm really only acquainted with Perl as a command line or cgi
interface. 

How can I pop something up in Windows? Do I need a completely
different strategy? I'd prefer not to end up in an MS language... I
just need some sort of alert for certain error conditions at
completion. 

Thanks, 


------------------------------

Date: Sun, 8 Jul 2007 18:42:07 +0200
From: "Lambik" <lambik@kieffer.nl>
Subject: Re: "Pop" an alert of some sort in Windows
Message-Id: <4691139f$0$37714$5fc3050@dreader2.news.tiscali.nl>

"still me" <wheeledBob@yahoo.com> wrote in message
news:gf2293dlm8it7qjt02drn1h9gfi7fsdabs@4ax.com...
> I have a program that I need to run at Windows startup (I can handle
> that part, at least as a command line startup->run). But, in some
> cases I'd like to pop a window/warning in MS-windows at completion.
> I'm really only acquainted with Perl as a command line or cgi
> interface.
>
> How can I pop something up in Windows? Do I need a completely
> different strategy? I'd prefer not to end up in an MS language... I
> just need some sort of alert for certain error conditions at
> completion.

#!/usr/bin/perl
use warnings;
use strict;
use Win32::GUI ();

my $main = Win32::GUI::Window->new(-name => 'Main',
                                -caption => "I have something to say",
                                -pos => [100,100],
                                -size => [300,100],

            );
my $label = $main->AddLabel(-text => "We are done running",
                         -pos => [10,10],
                         -size => [$main->ScaleWidth() - 100,
$main->ScaleHeight()-50]

        );
my $button= $main->AddButton(
                -text => 'Ok',
                -ok => 1,
                -default => 1,
                -tabstop => 1,
                -pos => [$main->ScaleWidth()-175, $main->ScaleHeight()-25],
                -size => [70,20],
                -onClick => sub { return -1; },
        );

$main->Center();
$main->Show();
Win32::GUI::Dialog();




------------------------------

Date: Sun, 08 Jul 2007 18:48:02 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: "Pop" an alert of some sort in Windows
Message-Id: <t852931o391of4lj85ujcuar30anlop3js@4ax.com>

On Sun, 08 Jul 2007 16:06:09 GMT, still me <wheeledBob@yahoo.com>
wrote:

>How can I pop something up in Windows? Do I need a completely
>different strategy? I'd prefer not to end up in an MS language... I
>just need some sort of alert for certain error conditions at
>completion. 

Well, just use some toolkit. The most popular one for Perl is Tk, but
there are alternatives.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Sun, 08 Jul 2007 18:00:10 GMT
From: still me <wheeledBob@yahoo.com>
Subject: Re: "Pop" an alert of some sort in Windows
Message-Id: <5g9293p84hfm4vgb7re8uurg57nmvoqgiv@4ax.com>

On Sun, 8 Jul 2007 18:42:07 +0200, "Lambik" <lambik@kieffer.nl> wrote:


>use Win32::GUI ();

Thanks... got me going where I need to be.




------------------------------

Date: Sun, 08 Jul 2007 19:48:18 GMT
From: Kevin Michael Vail <kevin@vaildc.net>
Subject: Re: "Pop" an alert of some sort in Windows
Message-Id: <kevin-43BD84.15481608072007@news.verizon.net>

In article <4691139f$0$37714$5fc3050@dreader2.news.tiscali.nl>,
 "Lambik" <lambik@kieffer.nl> wrote:

> "still me" <wheeledBob@yahoo.com> wrote in message
> news:gf2293dlm8it7qjt02drn1h9gfi7fsdabs@4ax.com...
> > I have a program that I need to run at Windows startup (I can handle
> > that part, at least as a command line startup->run). But, in some
> > cases I'd like to pop a window/warning in MS-windows at completion.
> > I'm really only acquainted with Perl as a command line or cgi
> > interface.
> >
> > How can I pop something up in Windows? Do I need a completely
> > different strategy? I'd prefer not to end up in an MS language... I
> > just need some sort of alert for certain error conditions at
> > completion.
> 
> #!/usr/bin/perl
> use warnings;
> use strict;
> use Win32::GUI ();

[]

Or even simpler, if nothing particularly special is needed:

#!/usr/bin/perl
use strict;
use warnings;
use Win32;

my $resp = Win32::MsgBox("I'm done!", MB_ICONINFORMATION, "Title");

(Use perldoc Win32 to find out the exact parameters for MsgBox.)
-- 
Bright eyes/burning like fire,           | Kevin Michael Vail
Bright eyes/how can you close and fail?  | kevin@vaildc.net
How can the light that shone so brightly | . . . . . . . . . .
Suddenly shine so pale?/Bright eyes      |  . . . . . . . . .


------------------------------

Date: 08 Jul 2007 11:22:03 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: How to check a form's field and exit Perl program if it has a value?
Message-Id: <87fy3yex9g.fsf@mithril.chromatico.net>

>>>>> "L" == Lambik  <lambik@kieffer.nl> writes:

    L> Lots of professions protect their profession. To be a lawyer
    L> you have to pass a bar exam. To be a doctor you have to be
    L> registered and follow certain guidelines. Why isn't there
    L> something like that in our business? Our business is being
    L> poisoned by 17 year old nephews who know how to use Frontpage
    L> or Word. And I regret to say: we let it happen.

Let the 17 year old nephews play with FrontPage, I say.  For the
people who think that's good enough, well, I wouldn't want to try to
justify why they need me instead.  They're the ones who
nickel-and-dime the hourly rate and nickel-and-dime the time, and pay
the invoices only when they're a month past due *anyway*.

And when they have a real programming problem that the 17-year-old
with FrontPage can't solve, that makes my services that much more
valuable to them.  Most businesses of any size that might consider a
17-year-old with FrontPage are now concerned about things like search
engine optimization and web analytics, and the 17-year-old can't do
much with that except install a hit counter.

And for that matter, I've seen quality work from 17-year-olds with
FrontPage, and shoddy work from people with degrees and years of
experience.  Caveat emptor, I say; it's the boss's budget, and if he
wants to waste it on shoddy work, whether it's the work of a
17-year-old high school dropout or a 40-year-old with degrees and
credentials is irrelevant.

Charlton



-- 
Charlton Wilbur
cwilbur@chromatico.net


------------------------------

Date: Sun, 08 Jul 2007 12:33:10 GMT
From: still me <wheeledBob@yahoo.com>
Subject: Pause Perl Program?
Message-Id: <lnl193572mp8lmqa4df9h6mai7aeip6gte@4ax.com>

Newbieish question: I have a program that I need to have pause for a
second (or less), then continue. 

I RTFM'ed and I found the Sleep function and Win32::Sleep. It seems
like the Win32::Sleep module is a better choice as it allows
millisecond intervals where as the Sleep module only accepts full
seconds. This program will run only on Windows. I also found
Time::HiRes but that looks like overkill for what I need to do this
time. 

Do I have this correct? Are there other functions that pause? Any
subtleties I need to know about? 


------------------------------

Date: Sun, 08 Jul 2007 05:44:41 -0700
From:  Paul Lalli <mritty@gmail.com>
Subject: Re: Pause Perl Program?
Message-Id: <1183898681.214221.164610@d55g2000hsg.googlegroups.com>

On Jul 8, 8:33 am, still me <wheeled...@yahoo.com> wrote:
> Newbieish question: I have a program that I need to have pause for a
> second (or less), then continue.
>
> I RTFM'ed and I found the Sleep function and Win32::Sleep. It seems
> like the Win32::Sleep module is a better choice as it allows
> millisecond intervals where as the Sleep module only accepts full
> seconds. This program will run only on Windows. I also found
> Time::HiRes but that looks like overkill for what I need to do this
> time.
>
> Do I have this correct? Are there other functions that pause? Any
> subtleties I need to know about?

$ perldoc -q sleep
Found in /software/perl-5.8.5-0/pkg/lib/5.8.5/pod/perlfaq8.pod
     How can I sleep() or alarm() for under a second?

     If you want finer granularity than the 1 second that the
     sleep() function provides, the easiest way is to use the
     select() function as documented in "select" in perlfunc.
     Try the Time::HiRes and the BSD::Itimer modules (available
     from CPAN, and starting from Perl 5.8 Time::HiRes is part of
     the standard distribution).

I see no reason to download a non-core non-portable module for such a
simple task.

Paul Lalli



------------------------------

Date: Sun, 08 Jul 2007 16:06:56 GMT
From: still me <wheeledBob@yahoo.com>
Subject: Re: Pause Perl Program?
Message-Id: <vs2293l7nfaaf32nmh716sq3jgk9or4qc0@4ax.com>

On Sun, 08 Jul 2007 05:44:41 -0700, Paul Lalli <mritty@gmail.com>
wrote:

>I see no reason to download a non-core non-portable module for such a
>simple task.
>
>Paul Lalli

Thanks


------------------------------

Date: Sun, 08 Jul 2007 17:06:29 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Pause Perl Program?
Message-Id: <sa62939dlkhdv406on7lah4stsbqic19ae@4ax.com>

still me wrote:

>I RTFM'ed and I found the Sleep function and Win32::Sleep. It seems
>like the Win32::Sleep module is a better choice as it allows
>millisecond intervals where as the Sleep module only accepts full
>seconds. This program will run only on Windows. I also found
>Time::HiRes but that looks like overkill for what I need to do this
>time. 

But Time::HiRes comes with perl.

Alternatively, you can try using the 4 argument select() call to produce
a sleep-like effect. That even doesn't need a module.

-- 
	Bart.


------------------------------

Date: Sun, 08 Jul 2007 18:46:49 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Pause Perl Program?
Message-Id: <575293lfbdhupsv5lj5vkighp88cvv3g4a@4ax.com>

On Sun, 08 Jul 2007 12:33:10 GMT, still me <wheeledBob@yahoo.com>
wrote:

>seconds. This program will run only on Windows. I also found
>Time::HiRes but that looks like overkill for what I need to do this

Why an overkill? It's also a core module now...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Sun, 8 Jul 2007 21:22:55 +0200
From: "Lambik" <lambik@kieffer.nl>
Subject: Re: Pause Perl Program?
Message-Id: <46913948$0$37753$5fc3050@dreader2.news.tiscali.nl>


"still me" <wheeledBob@yahoo.com> wrote in message
news:lnl193572mp8lmqa4df9h6mai7aeip6gte@4ax.com...
> Do I have this correct? Are there other functions that pause? Any
> subtleties I need to know about?

Is this like a JAPH? Who can come up with the most useless sleep? How about:

use strict;
use warnings;
use Win32::API;

my $Handler = Win32::API->new( 'kernel32', 'Sleep', 'L', 'V');
$Handler->Call (10000); # Milliseconds




------------------------------

Date: Sun, 08 Jul 2007 12:12:37 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: stopping spam with JavaScript (was: Re: validating a group of variables)
Message-Id: <d4d193h7bgol8bh7dogj2927b89bmec41v@4ax.com>

On Sun, 8 Jul 2007 10:50:03 +0200, "Dr.Ruud" <rvtol+news@isolution.nl>
wrote:

>> Good idea too ;-) But should be somewhere in the page some like this
>>
>> <noscript>
>> <big style="color: red">
>> Your browser have not enabled Javascript so this page will not work!
>> Are you paranoic?
>> </big>
>> </noscript>
>
>This has nothing to do with Perl.

Well, but it is appropriate, for once. Who's afraid of big bad JS
anymore, nowadays?!? OTOH sometimes I like to use textual browsers
too, and that I know none of them supports it at all. So a fallback
mechanism, should be provided. I was about to say: perhaps by means of
the damned captcha thing... but then I realized that that would be
hard with the textual browser too. (Unless it were in a terminal
emulator under a GUI, but then I would use a GUI-base browser...
(unless it were at a different location over a ssh connection (but
then if possible I would still use FF for the connection, whith a
local copy providing the guy (and finally I would really better stop
with these parentheses.))))


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Sun, 8 Jul 2007 11:24:20 +0000 (UTC)
From: Mark Shroyer <usenet-mail@markshroyer.com>
Subject: Re: stopping spam with JavaScript (was: Re: validating a group of variables)
Message-Id: <slrnf91ibc.2bu.usenet-mail@sed.homestarmy.dynalias.net>

On 2007-07-08, Michele Dondi <bik.mido@tiscalinet.it> wrote:
> On Sun, 8 Jul 2007 10:50:03 +0200, "Dr.Ruud" <rvtol+news@isolution.nl>
> wrote:
>
>>> Good idea too ;-) But should be somewhere in the page some like this
>>>
>>> <noscript>
>>> <big style="color: red">
>>> Your browser have not enabled Javascript so this page will not work!
>>> Are you paranoic?
>>> </big>
>>> </noscript>
>>
>>This has nothing to do with Perl.
>
> Well, but it is appropriate, for once. Who's afraid of big bad JS
> anymore, nowadays?!? OTOH sometimes I like to use textual browsers
> too, and that I know none of them supports it at all. So a fallback
> mechanism, should be provided. I was about to say: perhaps by means of
> the damned captcha thing... but then I realized that that would be
> hard with the textual browser too. (Unless it were in a terminal
> emulator under a GUI, but then I would use a GUI-base browser...
> (unless it were at a different location over a ssh connection (but
> then if possible I would still use FF for the connection, whith a
> local copy providing the guy (and finally I would really better stop
> with these parentheses.))))

I'm generally of the school of thought that none of a web site's
core functionality should completely depend on JavaScript; graceful
degradation and all that.  This is probably because I occasionally
use elinks, and use the NoScript extension when I'm browsing with
Firefox.

That said, I do use JavaScript to obfuscate the email addresses on
my personal web page, without providing any alternate means of
obtaining the address for the JavaScript impaired.  My justification
for this (aside from the fact that it's just a silly personal web
page and it doesn't really matter) is that almost everyone uses a
scripting-capable browser these days, and those who don't either (1)
are using a browser so outdated that they can't render my page
anyway, or (2) are technologically competent folks who are browsing
without scripting on purpose.

There's not much I can do for the former group.  For the latter, I
assume that if they really want to contact me they can temporarily
enable scripting for my site, or do a whois on my domain, or even
take a look at the JavaScript source and piece things together for
themselves.  Haven't had any complaints so far (though in hindsight
that's probably because if anyone were to have a valid complaint
about this, they wouldn't know how to contact me).

-- 
Mark Shroyer
http://markshroyer.com/


------------------------------

Date: Sun, 08 Jul 2007 12:10:55 GMT
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: stopping spam with JavaScript (was: Re: validating a group of variables)
Message-Id: <slrnf91kpe.63g.tadmc@tadmc30.sbcglobal.net>

Michele Dondi <bik.mido@tiscalinet.it> wrote:

> (and finally I would really better stop
> with these parentheses.))))


Else somebody may think that you are a spy:

   http://groups.google.com/group/rec.humor.funny.reruns/msg/65150659d28931bc


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Sun, 08 Jul 2007 08:50:43 -0400
From: Lew <lew@lewscanon.nospam>
Subject: Re: The Modernization of Emacs: terminology buffer and keybinding
Message-Id: <1_adnQOkD9Y-QA3bnZ2dneKdnZydnZ2d@comcast.com>

Twisted wrote:
> On Jul 7, 6:12 pm, Lew <l...@lewscanon.nospam> wrote:
>> Twisted wrote:
>> Edward Dodge wrote:
>>>> So -- what magical computer app illuminates the entire room and shows
>>>> you how to use everything at the flip of a switch?  This brilliant
>>>> discovery would put Sam's, O'Reilly, the for-Dummies series, and
>>>> virtually every other computer book publisher out of business in weeks.
>>>> Naturally, this would include the publishers of books on "easy-to-use"
>>>> Microsoft products.
>>> I don't know, but it sure as hell isn't emacs.
>> The reason you don't know, and Edward Dodge's point, is that there is no such
>> app, whether emacs or not.
> 
> Translation: since perfection is unattainable, we shouldn't even try,
> and just foist upon our poor users whatever awkward and hard-to-learn
> interface pops into our heads first?

Nice rhetoric but completely twisted the point.  Blaaaat!

-- 
Lew


------------------------------

Date: 08 Jul 2007 18:18:56 +0200
From: Bjorn Borud <borud-news@borud.no>
Subject: Re: The Modernization of Emacs: terminology buffer and keybinding
Message-Id: <m3ps32g973.fsf@borud.not>

[Twisted <twisted0n3@gmail.com>]
| 
| Translation: since perfection is unattainable, we shouldn't even try,
| and just foist upon our poor users whatever awkward and hard-to-learn
| interface pops into our heads first?

uh, I think the point here is that some think it might be an idea to
force *their* idea of the ideal interface upon others, refusing to
understand that people might have their own preferences.

-Bjørn


------------------------------

Date: Sun, 08 Jul 2007 19:46:37 -0000
From:  Twisted <twisted0n3@gmail.com>
Subject: Re: The Modernization of Emacs: terminology buffer and keybinding
Message-Id: <1183923997.160960.3080@q75g2000hsh.googlegroups.com>

On Jul 8, 4:28 am, Adriano Varoli Piazza <mora...@gmail.com> wrote:
> b) If you do want to keep an antediluvian copy of emacs -probably
> versioned in the negative numbers, for all you've said- please do. Do
> be so kind as to send a copy, since it might be quite valuable as an
> antique.

Judging by the existence of the newsgroup comp.emacs, emacs is indeed
considered by some to be a quite valuable antique. Otherwise why on
earth would it have an apparently fairly active newsgroup a full seven
years into the 21st century?



------------------------------

Date: Sun, 08 Jul 2007 19:48:34 -0000
From:  Twisted <twisted0n3@gmail.com>
Subject: Re: The Modernization of Emacs: terminology buffer and keybinding
Message-Id: <1183924114.414672.92430@n60g2000hse.googlegroups.com>

On Jul 8, 12:18 pm, Bjorn Borud <borud-n...@borud.no> wrote:
> uh, I think the point here is that some think it might be an idea to
> force *their* idea of the ideal interface upon others, refusing to
> understand that people might have their own preferences.

I, for one, have a strong preference for interfaces that let me see
what the hell I'm doing and make it easy to find commands, navigate
the interface, navigate the help, and so forth, while making me resort
to reaching for that help as infrequently as reasonably achievable.

But that's just me.



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 634
**************************************


home help back first fref pref prev next nref lref last post