[26890] in Perl-Users-Digest
Perl-Users Digest, Issue: 8883 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 25 06:05:26 2006
Date: Wed, 25 Jan 2006 03:05: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 Wed, 25 Jan 2006 Volume: 10 Number: 8883
Today's topics:
array question <a@mail.com>
Re: array question <jurgenex@hotmail.com>
Re: array question <a@mail.com>
Re: array question <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: array question <jurgenex@hotmail.com>
Re: array question <a@mail.com>
Re: array question <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: array question <a@mail.com>
How to create Unicode PDF bookmarks using PDF::API2? <news@horrocks.plus.com>
Re: Window control program help needed Jan. 24, 2006 <rvtol+news@isolution.nl>
Re: Window control program help needed Jan. 24, 2006 <jgibson@mail.arc.nasa.gov>
Re: Window control program help needed Jan. 24, 2006 <1usa@llenroc.ude.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 25 Jan 2006 09:54:34 GMT
From: "a" <a@mail.com>
Subject: array question
Message-Id: <uVHBf.218727$tl.147284@pd7tw3no>
Hi,
To declare an array, do I need to declare the size as well? If yes, how to
do it properly?
Can I do the following?
my @ary;
$ary[0]="a";
$ary[1]="b";
...
Thanks
------------------------------
Date: Wed, 25 Jan 2006 10:01:14 GMT
From: "J黵gen Exner" <jurgenex@hotmail.com>
Subject: Re: array question
Message-Id: <K%HBf.1621$iD.886@trnddc08>
a wrote:
> Hi,
> To declare an array, do I need to declare the size as well?
No, normally you don't.
> If yes, how to do it properly?
> Can I do the following?
> my @ary;
> $ary[0]="a";
> $ary[1]="b";
Have you tried it? What happened?
jue
------------------------------
Date: Wed, 25 Jan 2006 10:05:09 GMT
From: "a" <a@mail.com>
Subject: Re: array question
Message-Id: <p3IBf.443611$ki.121216@pd7tw2no>
Hi,
Syntax error complains but not specific
Thanks
"J黵gen Exner" <jurgenex@hotmail.com> 级糶秎ン穝籇
:K%HBf.1621$iD.886@trnddc08...
> a wrote:
> > Hi,
> > To declare an array, do I need to declare the size as well?
>
> No, normally you don't.
>
> > If yes, how to do it properly?
> > Can I do the following?
> > my @ary;
> > $ary[0]="a";
> > $ary[1]="b";
>
> Have you tried it? What happened?
>
> jue
>
>
------------------------------
Date: Wed, 25 Jan 2006 11:03:15 +0100
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: array question
Message-Id: <Xns9756707313DFBelhber1lidotechnet@10.232.40.227>
"a" <a@mail.com> wrote:
> Hi,
> To declare an array, do I need to declare the size as well?
No.
> Can I do the following?
> my @ary;
> $ary[0]="a";
> $ary[1]="b";
Yes.
See perldoc perldata for more details.
--
Cheers,
Bernard
------------------------------
Date: Wed, 25 Jan 2006 10:12:02 GMT
From: "J黵gen Exner" <jurgenex@hotmail.com>
Subject: Re: array question
Message-Id: <S9IBf.1624$iD.768@trnddc08>
[Top posting corrected, please don't do that]
a wrote:
> "J黵gen Exner" <jurgenex@hotmail.com> 级糶秎ン穝籇
>>> Can I do the following?
>>> my @ary;
>>> $ary[0]="a";
>>> $ary[1]="b";
>>
>> Have you tried it? What happened?
>
> Syntax error complains but not specific
Can't repro:
C:\tmp>type t.pl
use strict; use warnings;
my @ary;
$ary[0]="a";
$ary[1]="b";
C:\tmp>perl -c t.pl
t.pl syntax OK
jue
------------------------------
Date: Wed, 25 Jan 2006 10:19:37 GMT
From: "a" <a@mail.com>
Subject: Re: array question
Message-Id: <ZgIBf.443643$ki.227071@pd7tw2no>
Hi
By the way, how to comment the whole block of code?
Thanks
"Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net> 级糶秎ン穝籇
:Xns9756707313DFBelhber1lidotechnet@10.232.40.227...
> "a" <a@mail.com> wrote:
>
> > Hi,
> > To declare an array, do I need to declare the size as well?
>
>
> No.
>
>
> > Can I do the following?
> > my @ary;
> > $ary[0]="a";
> > $ary[1]="b";
>
>
> Yes.
>
>
> See perldoc perldata for more details.
>
>
> --
> Cheers,
> Bernard
------------------------------
Date: Wed, 25 Jan 2006 11:13:32 +0100
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: array question
Message-Id: <Xns975672314DF1Felhber1lidotechnet@10.232.40.227>
[don't top-post]
"a" <a@mail.com> wrote:
> "J黵gen Exner" <jurgenex@hotmail.com> 级糶秎ン穝籇
>:K%HBf.1621$iD.886@trnddc08...
>> a wrote:
>> > Hi,
>> > To declare an array, do I need to declare the size as well?
>>
>> No, normally you don't.
>>
>> > If yes, how to do it properly?
>> > Can I do the following?
>> > my @ary;
>> > $ary[0]="a";
>> > $ary[1]="b";
>>
>> Have you tried it? What happened?
>
>
> Hi,
> Syntax error complains but not specific
They are always specific. What was the error message you got?
--
Cheers,
Bernard
------------------------------
Date: Wed, 25 Jan 2006 10:26:29 GMT
From: "a" <a@mail.com>
Subject: Re: array question
Message-Id: <pnIBf.326939$2k.47703@pd7tw1no>
syntax error at filename line 20, near "]~"
Thanks
"Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net> 级糶秎ン穝籇
:Xns975672314DF1Felhber1lidotechnet@10.232.40.227...
>
> [don't top-post]
>
>
> "a" <a@mail.com> wrote:
>
> > "J黵gen Exner" <jurgenex@hotmail.com> 级糶秎ン穝籇
> >:K%HBf.1621$iD.886@trnddc08...
> >> a wrote:
> >> > Hi,
> >> > To declare an array, do I need to declare the size as well?
> >>
> >> No, normally you don't.
> >>
> >> > If yes, how to do it properly?
> >> > Can I do the following?
> >> > my @ary;
> >> > $ary[0]="a";
> >> > $ary[1]="b";
> >>
> >> Have you tried it? What happened?
> >
> >
> > Hi,
> > Syntax error complains but not specific
>
>
> They are always specific. What was the error message you got?
>
>
> --
> Cheers,
> Bernard
------------------------------
Date: Tue, 24 Jan 2006 23:51:37 +0000
From: Bruce Horrocks <news@horrocks.plus.com>
Subject: How to create Unicode PDF bookmarks using PDF::API2?
Message-Id: <mW+ERmUJ2r1DFwqm@horrocks.plus.com>
Hi,
I'm using PDF::API2 to add bookmarks to an existing PDF. It all works
fine using outline->title($text) to name the bookmark except that any
Unicode in $text is ignored.[1]
What do I need to do to be able to create and display bookmarks that
contain Unicode?
Is there an API2 mailing list or similar that might be a better place to
ask this question?
Thanks in advance.
[1] By ignored I mean, for example, that \x{2192} is displayed as two
characters, presumably both in Latin1 or whatever it is that Reader uses
for bookmarks by default.
--
Bruce Horrocks
Surrey
England
<firstname>@<surname>.plus.com -- fix the obvious for email
------------------------------
Date: Wed, 25 Jan 2006 00:30:32 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Window control program help needed Jan. 24, 2006
Message-Id: <dr6hgc.h0.1@news.isolution.nl>
edgrsprj:
> There is probably some Perl routine which can direct keyboard input
> to be sent to a Perl program even though a text file window is the
> one you are looking at. So, if something were typed in, nothing
> would appear on the screen unless the Perl program used the
> SendKeys() command to print the text to the screen.
Maybe it is better to do it with some system-wide utility:
google: windows keyboard interception
http://www.1000files.com/free/keyboard.html
http://www.freewarefind.com/archives/keyboard_cursor.html
http://www.sharewareconnection.com/titles/keyboard2.htm
http://www.sysinternals.com/Utilities/Ctrl2Cap.html
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Tue, 24 Jan 2006 16:07:12 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Window control program help needed Jan. 24, 2006
Message-Id: <240120061607125134%jgibson@mail.arc.nasa.gov>
In article <2XxBf.5856$vU2.1069@newsread3.news.atl.earthlink.net>,
edgrsprj <edgrsprj@ix.netcom.com> wrote:
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> news:Xns975583A43D442asu1cornelledu@127.0.0.1...
>
> > > 1. I would like Perl to send characters etc. to the Windows operating
> > > system as if the instructions were being entered from the keyboard.
> >
> > http://search.cpan.org/search?query=sendkeys
> >
>
> Thanks for the information.
>
> I was able to download Win32-GuiTest from that Web site and somehow got it
> installed without really understanding what I was doing. And its SendKeys()
> command does actually do what is needed.
>
> Goal # 2 has to do with redirecting input from the keyboard.
>
> If Perl is the active window then
>
> $word = readline STDIN;
>
> will pull in a character or word from the keyboard after you hit the ENTER
> key.
In computer terminology, input from the keyboard (and mouse) is
directed to whichever window has "focus". You can have 5 different
programs running on your computer, each in its own window, and each
waiting for input from the keyboard. The computer operating system
(sometimes in conjunction with a program called a "window manager")
needs to figure out which program gets the input. The program in the
window with focus will get the input.
The focus window is usually shown with a different border color than
the others. The focus window is also known as the active window. You
normally make a window the active window by clicking on it or its
border, but sometimes the operating system will decide to make some
window the active window. For example, when a window is first created
it is often made the active window.
If the active window isn't waiting for input, the characters you type
will be ignored, or perhaps saved until the program executing in the
window tries to read from keyboard.
> However if a text file for example is the active window and you enter
> anything on the keyboard then the text will print directly to the screen in
> the text file window.
A text file cannot be an active window. You probably have an editor in
some window editing a file so that you can see the contents of the file
in the window, If the editor window is active then whatever you type
goes into the file.
> There is probably some Perl routine which can direct keyboard input to be
> sent to a Perl program even though a text file window is the one you are
> looking at. So, if something were typed in, nothing would appear on the
> screen unless the Perl program used the SendKeys() command to print the text
> to the screen.
There is no way that I know of for a Perl program or a program written
in any other language to receive characters from the keyboard if some
other program is receiving keyboard input because its controlling
window has focus. There may be some programmatic tricks for the Perl
program to get back focus, but they depend heavily on the system
environment and the windowing system in use.
You are probably trying to present information to the user by writing
it to a file and spawing an editor to edit that file in another window,
and when you do that, the editor window gets focus and the Perl program
loses it. The only way for the Perl program to get back the focus is
for the user to click on the window.
What you need to do is figure out how to display information to the
user in windows created by the Perl program. In other words, you need
to write a graphical user interface (GUI) program with the capabilities
to create windows and display information in them. The Perl/Tk system
will allow you to do that, but it is complicated. Other languages like
Visual Basic or Java might be better because they have windowing
capabilities built in, but they are also complicated to learn.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Wed, 25 Jan 2006 00:20:22 +0000 (UTC)
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Window control program help needed Jan. 24, 2006
Message-Id: <Xns9755C60C9469Fasu1cornelledu@132.236.56.8>
"edgrsprj" <edgrsprj@ix.netcom.com> wrote in
news:2XxBf.5856$vU2.1069@newsread3.news.atl.earthlink.net:
>
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> news:Xns975583A43D442asu1cornelledu@127.0.0.1...
>
>> > 1. I would like Perl to send characters etc. to the Windows
>> > operating system as if the instructions were being entered from the
>> > keyboard.
>>
>> http://search.cpan.org/search?query=sendkeys
>>
>
> Thanks for the information.
>
> I was able to download Win32-GuiTest from that Web site and somehow
> got it installed without really understanding what I was doing. And
> its SendKeys() command does actually do what is needed.
>
> Goal # 2 has to do with redirecting input from the keyboard.
>
> If Perl is the active window then
>
> $word = readline STDIN;
>
> will pull in a character or word from the keyboard after you hit the
> ENTER key.
>
> However if a text file for example is the active window and you enter
> anything on the keyboard then the text will print directly to the
> screen in the text file window.
>
> There is probably some Perl routine which can direct keyboard input to
> be sent to a Perl program even though a text file window is the one
> you are looking at. So, if something were typed in, nothing would
> appear on the screen unless the Perl program used the SendKeys()
> command to print the text to the screen.
So, you want your Perl program to be able intercept Windows messages sent
to whatever application has the focus. I don't think this is impossible to
do using the Windows API, but you'll have to do your own reading.
Think very hard about the implications of what you are trying to do.
I think you might want to look into Perl-Tk to put together your own GUI
application instead of trying to subvert the user's environment.
Sinan
------------------------------
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 V10 Issue 8883
***************************************