[31573] in Perl-Users-Digest
Perl-Users Digest, Issue: 2832 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 23 18:09:27 2010
Date: Tue, 23 Feb 2010 15:09:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 23 Feb 2010 Volume: 11 Number: 2832
Today's topics:
Re: benchmarks for perl? <brian.d.foy@gmail.com>
OT, blowing off steam <cartercc@gmail.com>
Re: OT, blowing off steam <jurgenex@hotmail.com>
Re: OT, blowing off steam <tadmc@seesig.invalid>
Re: retrieve file after posting some data <ron.eggler@gmail.com>
Re: retrieve file after posting some data <ben@morrow.me.uk>
Re: retrieve file after posting some data <ron.eggler@gmail.com>
Re: Windows: How to sleep until key is pressed <dilbert1999@gmail.com>
Re: Windows: How to sleep until key is pressed <jurgenex@hotmail.com>
Re: Windows: How to sleep until key is pressed <tadmc@seesig.invalid>
Re: Windows: How to sleep until key is pressed <hjp-usenet2@hjp.at>
Re: Windows: How to sleep until key is pressed <ben@morrow.me.uk>
Re: Windows: How to sleep until key is pressed <ben@morrow.me.uk>
Re: wx question <john@castleamber.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 23 Feb 2010 13:52:06 -0600
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: benchmarks for perl?
Message-Id: <230220101352067480%brian.d.foy@gmail.com>
In article <29udnbY9VdqPPeLWnZ2dnUVZ8h-dnZ2d@brightview.co.uk>, bugbear
<bugbear@trim_papermule.co.uk_trim> wrote:
> brian d foy wrote:
> > In article <j8OdnWeEAuNg9ODWnZ2dnUVZ8nhi4p2d@brightview.co.uk>, bugbear
> > <bugbear@trim_papermule.co.uk_trim> wrote:
> > Use perlbench. It's a bit underdocumented, but I show some examples
> > in Mastering Perl. :)
> I installed perlbench, but it seems to have
> a frankly tiny test set (6 tests), as I posted
> in this thread.
Well, the idea is to write tests that matter to you and run them
against the perls that you want to use. You see how perl performs
against that stuff you are actually going ot use with it.
------------------------------
Date: Tue, 23 Feb 2010 12:37:57 -0800 (PST)
From: ccc31807 <cartercc@gmail.com>
Subject: OT, blowing off steam
Message-Id: <7708fa9d-f3ae-42a1-8be1-cdca6c9d3b08@g29g2000vbb.googlegroups.com>
For the past two days, I've been engaged in moving a CGI application
from Windows to Linux, and boy, have I gotten an education! I would
have undertaken the project if I had know how frustrating it would be,
but I would have been a lot less enthusiastic going in.
I have spend most of my time (so far) struggling with data input to
MySQL, both schema and data. After hours of blind groping, I figured
out the intricacies of mysqlimport, LOAD DATA FILE, and mysql -e
between different versions and different OSes. Thank God for Perl --
writing simple scripts to munge the input files to read them into
MySQL was both easy and fun, and effective.
Now, I'm dealing with the differences between Perl versions, the one
on the Linux server is a lot older than the Windows server, but that's
straightforward. If something doesn't work, it's easy enough to fix by
hand -- unless someone knows of a library that translates from one
version to another.
The point of this post, other than just to blow off steam and take a
break, is to share a couple of vi tips that I discovered. These have
proven useful to me, and may to others, and besides, if I forget them
I can simply google c.l.p.m.
First, how to insert a non-printable character in a (vim) regular
expression? Let's say you want to replace form feeds (^@) with
nothing. You can see the codes for characters by giving the
command :digraphs, and then insert the character in the regular
expression by doing Cntl-k, two letter code.
Second, how to convert a simple, ASCII text file from Windows to
Linux? The problem was an unfathomable premature end of script headers
error that I was at my wit's end to fix. In vi (vim), you give the
command :set fileformat:unix, and presto, chango, the premature end of
script headers error disappears!
Yeah, I know this is OT, but I thought this might help someone else,
and I needed to do something to relax anyway.
CC.
------------------------------
Date: Tue, 23 Feb 2010 12:50:40 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: OT, blowing off steam
Message-Id: <fpf8o5hq3rjl8gab8itnc2k34iortstb5f@4ax.com>
ccc31807 <cartercc@gmail.com> wrote:
>Now, I'm dealing with the differences between Perl versions, the one
>on the Linux server is a lot older than the Windows server,
Then why don't you upgrade the Linux version? Or install your own
version?
>First, how to insert a non-printable character in a (vim) regular
>expression? Let's say you want to replace form feeds (^@) with
>nothing.
Doesn't \f work?
>Second, how to convert a simple, ASCII text file from Windows to
>Linux?
man dos2unix
jue
------------------------------
Date: Tue, 23 Feb 2010 14:57:43 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: OT, blowing off steam
Message-Id: <slrnho8g38.cqr.tadmc@tadbox.sbcglobal.net>
ccc31807 <cartercc@gmail.com> wrote:
> Second, how to convert a simple, ASCII text file from Windows to
> Linux?
perl -pe 'tr/\r//d' windows.txt >unix.txt
perl -pe 'tr/\r//d' <windows.txt >unix.txt
or in-place:
perl -pi -e 'tr/\r//d' windows.txt
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
------------------------------
Date: Tue, 23 Feb 2010 08:38:00 -0800 (PST)
From: cerr <ron.eggler@gmail.com>
Subject: Re: retrieve file after posting some data
Message-Id: <af3f95f8-b0fc-400f-935b-e596f7d9da48@b5g2000prd.googlegroups.com>
On Feb 22, 5:01=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth cerr <ron.egg...@gmail.com>:
>
>
>
>
>
> > On Feb 22, 3:43=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> > > Quoth cerr <ron.egg...@gmail.com>:
> > > > On Feb 22, 2:36=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
>
> > > > > The file returned from the server should be in the $res object. S=
ee the
> > > > > documentation for HTTP::Response.
>
> > > > Yep, been looking at that too but I haven't really gotten any furth=
er
> > > > unfortunately :( $res->filename e.g. is returning the filename of t=
he
> > > > script i'm posting to but not the filename the server is sending ba=
ck.
> > > > I don't know how i'd get the data. Been playing with
> > > > decoded_content('none') as well (cause the file coming back is in
> > > > binary) - but no success either - anymore hints maybe?
>
> > > The data is in ->content.
> > If ->filename is returning the request URI,
> > > then probably the server is not sending a Content-Disposition header
> > > that specifies a filename. Can you post $res->headers->as_string?
>
> > For me it seems like content only returns the html of the page i just
> > submitted data from.
>
> Right... What are you expecting to happen? Is there something else going
> on here? Some JaveScript or something on the page that's interfering
> with the normal form submission process? Are you able to usehttp://www2.r=
esearch.att.com/sw/tools/wsp/with your normal browser to
> get a better idea of what's actually going on?
>
> > res->headers->as_string contains HTTP::Response=3DHASH(0x9e368b0)-
> > >headers->as_string...
>
> No, that's not right. I'm going to guess you used
>
> =A0 =A0 warn "headers: $res->headers->as_string";
>
> or something equivalent; that won't work since method calls aren't
> interpolated. Try
>
> =A0 =A0 warn "headers: " . $res->headers->as_string;
Oh Yeah, that looks different:
headers: Connection:
close
Date: Wed, 04 Jan 2006 21:19:34
GMT
Server:
Apache
Content-Type: text/html; charset=3DISO-8859-1
Client-Date: Tue, 23 Feb 2010 16:26:55 GMT
Client-Peer: 192.168.167.166:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=3DUS/ST=3DCalifornia/L=3DSunnyvale/O=3DTropos
Networks/OU=3DManufacturing/CN=3DTropos Router/
emailAddress=3Dsupport@tropos.com
Client-SSL-Cert-Subject: /C=3DUS/ST=3DCalifornia/L=3DSunnyvale/O=3DTropos
Networks/OU=3DManufacturing/CN=3DTropos Router/
emailAddress=3Dsupport@tropos.com
Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
Client-SSL-Warning: Peer certificate not verified
Client-Transfer-Encoding: chunked
Link: <mailto:peter.sugiarto%40troposnetworks.com>; rev=3D"made"
Title: Configuration Utility: INDOOR ROUTER
res->message: 200->code
But this doesn't really tell me anything either, does it?
> What sort of 'filename' are you expecting?
Well I expected to see the filename that the browser would be
downloanding, that would be 'tropos.cfg'.
> > hm, the html of the little form i would like to submit from looks like
> > this:
> > <form method=3D"post" action=3D"/cgi-bin/config.pl" enctype=3D"applicat=
ion/x-
> > www-form-urlencoded" name=3D"save">
> > <select name=3D"export_profile">
> > <option selected=3D"selected" value=3D"Current Profile">Current Profile=
</
> > option>
> > <option value=3D"Last Known Good Profile">Last Known Good Profile</
> > option>
> > <option value=3D"Minimal Profile">Minimal Profile</option>
> > </select><input type=3D"submit" name=3D"save" value=3D"Export" /></form=
>
> > and the POST string i assembled looks like:"export_profile=3DCurrent
> > %20Profile". I'm not sure if that's correct :(
>
> That looks correct for a POST from that form.
>
> > I don't know how i can
> > implement the form name "save" into my post string, do i need to do
> > that too?
>
> No. (Or, at any rate, not for a normal HTML form submission.)
Ok, then that should work fine with my post string
'export_profile=3DCurrent%20Profile'.
Thanks for your help!
--
roN
------------------------------
Date: Tue, 23 Feb 2010 17:25:35 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: retrieve file after posting some data
Message-Id: <flfd57-ijd.ln1@osiris.mauzo.dyndns.org>
Quoth cerr <ron.eggler@gmail.com>:
> On Feb 22, 5:01 pm, Ben Morrow <b...@morrow.me.uk> wrote:
> >
> > No, that's not right. I'm going to guess you used
> >
> > warn "headers: $res->headers->as_string";
> >
> > or something equivalent; that won't work since method calls aren't
> > interpolated. Try
> >
> > warn "headers: " . $res->headers->as_string;
>
> Oh Yeah, that looks different:
> headers: Connection:
> close
> Date: Wed, 04 Jan 2006 21:19:34
> GMT
> Server:
> Apache
> Content-Type: text/html; charset=ISO-8859-1
> Client-Date: Tue, 23 Feb 2010 16:26:55 GMT
> Client-Peer: 192.168.167.166:443
> Client-Response-Num: 1
> Client-SSL-Cert-Issuer: /C=US/ST=California/L=Sunnyvale/O=Tropos
> Networks/OU=Manufacturing/CN=Tropos Router/
> emailAddress=support@tropos.com
> Client-SSL-Cert-Subject: /C=US/ST=California/L=Sunnyvale/O=Tropos
> Networks/OU=Manufacturing/CN=Tropos Router/
> emailAddress=support@tropos.com
> Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
> Client-SSL-Warning: Peer certificate not verified
> Client-Transfer-Encoding: chunked
> Link: <mailto:peter.sugiarto%40troposnetworks.com>; rev="made"
> Title: Configuration Utility: INDOOR ROUTER
> res->message: 200->code
>
> But this doesn't really tell me anything either, does it?
It says the the server is *not* returning the configuration file at all,
but it sending back the same HTML form you started with.
I'm going to take a wild guess and suggest that maybe the server
requires you to accept cookies properly. Try using WWW::Mechanize (with
a properly-configured cookie store) to run through the whole
login/download process.
> > What sort of 'filename' are you expecting?
>
> Well I expected to see the filename that the browser would be
> downloanding, that would be 'tropos.cfg'.
OK. If you install the LiveHTTPHeaders FF extension, you should see that
when you perform a successful download the server sends a
Content-Disposition header. HTTP::Response->filename will pick this up,
if it's there.
Ben
------------------------------
Date: Tue, 23 Feb 2010 13:51:28 -0800 (PST)
From: cerr <ron.eggler@gmail.com>
Subject: Re: retrieve file after posting some data
Message-Id: <929c4a13-9876-46ee-88d6-530155869ba5@k5g2000pra.googlegroups.com>
On Feb 23, 9:25=A0am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth cerr <ron.egg...@gmail.com>:
>
>
>
>
>
> > On Feb 22, 5:01=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
>
> > > No, that's not right. I'm going to guess you used
>
> > > =A0 =A0 warn "headers: $res->headers->as_string";
>
> > > or something equivalent; that won't work since method calls aren't
> > > interpolated. Try
>
> > > =A0 =A0 warn "headers: " . $res->headers->as_string;
>
> > Oh Yeah, that looks different:
> > headers: Connection:
> > close
> > Date: Wed, 04 Jan 2006 21:19:34
> > GMT
> > Server:
> > Apache
> > Content-Type: text/html; charset=3DISO-8859-1
> > Client-Date: Tue, 23 Feb 2010 16:26:55 GMT
> > Client-Peer: 192.168.167.166:443
> > Client-Response-Num: 1
> > Client-SSL-Cert-Issuer: /C=3DUS/ST=3DCalifornia/L=3DSunnyvale/O=3DTropo=
s
> > Networks/OU=3DManufacturing/CN=3DTropos Router/
> > emailAddress=3Dsupp...@tropos.com
> > Client-SSL-Cert-Subject: /C=3DUS/ST=3DCalifornia/L=3DSunnyvale/O=3DTrop=
os
> > Networks/OU=3DManufacturing/CN=3DTropos Router/
> > emailAddress=3Dsupp...@tropos.com
> > Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
> > Client-SSL-Warning: Peer certificate not verified
> > Client-Transfer-Encoding: chunked
> > Link: <mailto:peter.sugiarto%40troposnetworks.com>; rev=3D"made"
> > Title: Configuration Utility: INDOOR ROUTER
> > res->message: 200->code
>
> > But this doesn't really tell me anything either, does it?
>
> It says the the server is *not* returning the configuration file at all,
> but it sending back the same HTML form you started with.
>
> I'm going to take a wild guess and suggest that maybe the server
> requires you to accept cookies properly. Try using WWW::Mechanize (with
> a properly-configured cookie store) to run through the whole
> login/download process.
>
> > > What sort of 'filename' are you expecting?
>
> > Well I expected to see the filename that the browser would be
> > downloanding, that would be 'tropos.cfg'.
>
> OK. If you install the LiveHTTPHeaders FF extension, you should see that
> when you perform a successful download the server sends a
> Content-Disposition header. HTTP::Response->filename will pick this up,
> if it's there.
Ah, hold on, with this extension I figured out that the correct post
string is:'export_profile=3DCurrent+Profile&save=3DExport' and with that i
see binary data coming back in $res->content - now i just wrote this
in a binary file and it seems to work.
Thank you for your help!
--
roN
------------------------------
Date: Tue, 23 Feb 2010 12:24:13 -0800 (PST)
From: Dilbert <dilbert1999@gmail.com>
Subject: Re: Windows: How to sleep until key is pressed
Message-Id: <fc60a388-c642-4378-9bb6-0de0889c4b0f@f8g2000vba.googlegroups.com>
On 22 f=E9v, 22:12, "C.DeRykus" <dery...@gmail.com> wrote:
> On Feb 22, 12:23=A0pm, Dilbert <dilbert1...@gmail.com> wrote:
> > So the program works ok for me, but it has a "do{...}until" loop that
> > better should be replaced by a sleep command. My concern is that I
> > waste a lot of CPU cycles in the do{...}until loop, that could be
> > avoided if I replace that loop by a sleep command
[snip]
> Win32 5.10.1 seems to understand sleep();
>
> =A0 =A0 do {
> =A0 =A0 =A0 =A0 @event =3D ...
> =A0 =A0 =A0 =A0 sleep 1;
> =A0 =A0 } until @event;
>
> At least, hitting Ctrl-C interrupts the above. Don't know if
> this'll do everything you need though.
Thanks to Charles DeRykus for his solution. This is much better for
the CPU cycles.
However, the sleep command as it works currently has one disadvantage:
it does not respond quickly enough to normal keystrokes -- it takes a
second to recognise my keystrokes (except for Ctrl-C, which is
recognised immediately, but this doesn't help because I don't use Ctrl-
C very much)
Is there an advanced sleep command for Windows that sleeps for 1
second *maximum* ?, i.e. if any key was hit during the sleep of 1
second (let's say, for example, I hit the letter 'A' after 0.5
seconds), then the "advanced" sleep should be aborted immediately
(before the 1 second is over) so that the perl program can resumes its
normal processing after 0.5 seconds.
Something like "advanced_sleep_until_keypress_max_seconds(1)" ???
Is there a Win32 module to that effect ???
------------------------------
Date: Tue, 23 Feb 2010 12:29:04 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Windows: How to sleep until key is pressed
Message-Id: <mee8o598rhu96rqcb36pbm0p3jt5c292a3@4ax.com>
"C.DeRykus" <derykus@gmail.com> wrote:
>Win32 5.10.1 seems to understand sleep();
Well, older versions do, too. For a long time, actually.
> do {
> @event = ...
> sleep 1;
> } until @event;
Yikes. That is still busy waiting. Maybe not quite as bad as the OP's
attempt, but still bad.
No, sorry, I don't have a better solution myself, unfortunately. That is
an area I haven't ventured in so far. But I could imagine that setting
up a signal handler for a keypress event may be a solution.
jue
------------------------------
Date: Tue, 23 Feb 2010 14:49:22 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Windows: How to sleep until key is pressed
Message-Id: <slrnho8fji.cqr.tadmc@tadbox.sbcglobal.net>
Dilbert <dilbert1999@gmail.com> wrote:
> Is there an advanced sleep command for Windows that sleeps for 1
> second *maximum* ?, i.e. if any key was hit during the sleep
I don't think you understand the definition of "sleep" here...
"sleep" means "do not do _anything_".
Monitoring the keyboard is "something", so it cannot be done while sleeping.
That is, if it could notice that something happened on the keyboard,
then it was not truly sleeping.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
------------------------------
Date: Tue, 23 Feb 2010 23:01:03 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Windows: How to sleep until key is pressed
Message-Id: <slrnho8k0v.tc1.hjp-usenet2@hrunkner.hjp.at>
On 2010-02-23 20:49, Tad McClellan <tadmc@seesig.invalid> wrote:
> Dilbert <dilbert1999@gmail.com> wrote:
>> Is there an advanced sleep command for Windows that sleeps for 1
>> second *maximum* ?, i.e. if any key was hit during the sleep
>
>
> I don't think you understand the definition of "sleep" here...
>
> "sleep" means "do not do _anything_".
>
> Monitoring the keyboard is "something", so it cannot be done while sleeping.
>
> That is, if it could notice that something happened on the keyboard,
> then it was not truly sleeping.
If it could notice that time has passed, then it was not truly sleeping
;-)
"Sleeping" means that the process has told the OS to suspend it until a
given amount of time has passed or until the process needs to be resumed
(or terminated) for another reason.
There is in fact one Unix system call (and corresponding Perl builtin
function) which has exactly the semantics Dilbert wants:
select
It tells the OS:
Suspend me until IO is possible on one of these file descriptors
or until x seconds have passed, whichever happens earlier.
hp
------------------------------
Date: Tue, 23 Feb 2010 22:09:47 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Windows: How to sleep until key is pressed
Message-Id: <ba0e57-o2f.ln1@osiris.mauzo.dyndns.org>
Quoth Dilbert <dilbert1999@gmail.com>:
> I have a perl program (under windows vista) that records every
> scancode / keystroke I make (it even records when I hit the Ctrl-key,
> the Shift-key, F1, F2, etc....
>
> So the program works ok for me, but it has a "do{...}until" loop that
> better should be replaced by a sleep command. My concern is that I
> waste a lot of CPU cycles in the do{...}until loop, that could be
> avoided if I replace that loop by a sleep command
>
> How can I achieve this ? does such a command exist under windows ?
> (just in case you might ask: I already tried each and every option in
> Term::Readkey, it definitely does not record when I hit the Ctrl-key,
> Shift-key, etc...) Fortunately, Win32::Console does the job quite
> well, it is just the do{...}until loop that bothers me because it
> wastes CPU cycles.
>
> Here is the program:
>
> use strict;
> use warnings;
>
> use Win32::Console;
>
> my $CONS_INP = Win32::Console->new(STD_INPUT_HANDLE);
>
> while (1) {
>
> # I want to sleep here until a key is pressed...
> # How can I achieve this under Windows... ???
>
> my @event;
> do {
> @event = $CONS_INP->Input() if $CONS_INP->GetEvents();
> } until @event;
AFAICT from the MSDN docs, ->Input should block until there is something
to read. That is, replace the whole do/until loop with
my @event = $CONS_INP->Input();
If I'm wrong, or if you need the process to wake up after a timeout even
without an event, you want wait_all from Win32::IPC.
Ben
------------------------------
Date: Tue, 23 Feb 2010 22:24:53 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Windows: How to sleep until key is pressed
Message-Id: <l61e57-caf.ln1@osiris.mauzo.dyndns.org>
Quoth "Peter J. Holzer" <hjp-usenet2@hjp.at>:
> On 2010-02-23 20:49, Tad McClellan <tadmc@seesig.invalid> wrote:
> > Dilbert <dilbert1999@gmail.com> wrote:
> >> Is there an advanced sleep command for Windows that sleeps for 1
> >> second *maximum* ?, i.e. if any key was hit during the sleep
> >
> > I don't think you understand the definition of "sleep" here...
> >
> > "sleep" means "do not do _anything_".
> >
> > Monitoring the keyboard is "something", so it cannot be done while sleeping.
> >
> > That is, if it could notice that something happened on the keyboard,
> > then it was not truly sleeping.
>
> If it could notice that time has passed, then it was not truly sleeping
> ;-)
>
> "Sleeping" means that the process has told the OS to suspend it until a
> given amount of time has passed or until the process needs to be resumed
> (or terminated) for another reason.
>
> There is in fact one Unix system call (and corresponding Perl builtin
> function) which has exactly the semantics Dilbert wants:
>
> select
Unfortunately select doesn't generally work on Win32, since it doesn't
have a proper unified fd model. The perl builtin calls a version that
only works on sockets.
The native Win32 replacement for select(2) is WaitForMultipleObjects,
which will wait for any HANDLE. This is wrapped by the Win32::IPC
module.
Arguably perl's select on Win32 ought to use WFMO to provide semantics
more like Unix' select(2), but it doesn't.
Ben
------------------------------
Date: Tue, 23 Feb 2010 11:26:18 -0600
From: John Bokma <john@castleamber.com>
Subject: Re: wx question
Message-Id: <87pr3vzww5.fsf@castleamber.com>
Robin <robin1@cnsp.com> writes:
> #!/usr/bin/perl
>
> use Wx;
> use Wx::Event qw( EVT_BUTTON );
>
> my $m = Wx::SimpleApp -> new;
> my $f = Wx::Frame -> new (undef, -1, "hello world");
> $f -> Show();
> my $button = Wx::Button -> new ($f, -1, "Exit");
> EVT_BUTTON ($self, $button, \&o);
> $m -> MainLoop ();
>
> sub o {
> exit;
> }
>
> this is what my code looks like now (above)-
>
> it is now giving my the error:
>
> can't call method connect on an undefined value at *event.pm...
>
> do you know what this is?
An incomplete error message ;-) Please copy and paste the actual
complete message.
Adding
use strict;
use warnings;
before use Wx; might help as well.
--
John Bokma j3b
Hacking & Hiking in Mexico - http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 2832
***************************************