[21821] in Perl-Users-Digest
Perl-Users Digest, Issue: 4025 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 24 18:05:40 2002
Date: Thu, 24 Oct 2002 15:05:11 -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 Thu, 24 Oct 2002 Volume: 10 Number: 4025
Today's topics:
Re: Advice Please <ernst-udo.wallenborn@freenet.de>
Re: calling an external script within a script? <morry.davis@sun.com>
Re: calling an external script within a script? <dha@panix2.panix.com>
Re: calling an external script within a script? <pilsl_use@goldfisch.at>
Re: CGI Question - can't differenciate between mutlipe ctcgag@hotmail.com
Embeded Documentation <morry.davis@sun.com>
Re: Embeded Documentation <comdog@panix.com>
Extracting Data With Regex: Can Pay For This Answer! (Barry Krusch)
Re: Extracting Data With Regex: Can Pay For This Answer <espenmyr@start.no.spam>
Re: Extracting Data With Regex: Can Pay For This Answer <usenet@dwall.fastmail.fm>
Help: Installing GD module <knjaz@hotmail.com>
Re: Help: Installing GD module <bryan@akanta.com>
IO::Socket::INET and telnet <jason@baugher.pike.il.us>
pulling out text from between two strings (shambolic)
RegEx switcheroo <ihave@noemail.com>
Re: RegEx switcheroo <kork@insomnia-hq.de>
Re: RegEx switcheroo <ihave@noemail.com>
Re: RegEx switcheroo <shondell@cis.ohio-state.edu>
Re: RegEx switcheroo <kork@insomnia-hq.de>
Regular Expression (R.Noory)
Re: regular expression <usenet@dwall.fastmail.fm>
Re: Regular Expression <usenet@tinita.de>
Re: Regular Expression <depesz@depesz.pl>
Re: Trying to make a GUI. (Russell Cecala)
Re: Why are empty tailing elements missing from the arr <cp@onsitetech.com>
Re: Writing Microsoft Outlook Notes With Perl (Chris)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Oct 2002 22:06:10 +0200
From: Ernst-Udo Wallenborn <ernst-udo.wallenborn@freenet.de>
Subject: Re: Advice Please
Message-Id: <s5l4rbbioul.fsf@dilbert.pointyhairedbosses.de>
"merlin" <merlin@itwizards.sic> writes:
> I know nothing about Perl.
You can do something about that.
> $val2 =~ s/([ <>])([\w]+:\/\/[\w\*\+-?&;,#~=\.\/\@]+[\w\/])/$1<A HREF="$2"
> TARGET="_blank">$2<\/A>/g;
> $val2 =~ s/([ <>])(www\.[\w\*\+-?&;,#~=\.\/\@]+[\w\/])/$1<A
> HREF="http:\/\/$2" TARGET="_blank">$2<\/A>/g;
> $val2 =~ s/([
> <>])([^\s"<>]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,6}|[0-9]{1,3})(\]?))/$1<A
> HREF="mailto:$2">$2<\/A>/g;
> }
What a mess!
Apparently the first line scans $val2 for a string that begins with
[ <>] and has a URL next. If any matches, the URL is replaced with
a link to the URL where target="_blank" opens a new browser window.
The second line does the same for all strings that start with "www.".
Then the third line looks for strings that look like an email address
and replaces them with a mailto: link
First of all, the [ <>] seems to look for a quotation character,
thinking that http:// is always preceded by a space or by this
quotation character. What if i use ":" to quote? What if i write
(http://www.perl.org)? I fail to see why [ <>] is there in the
first place.
Then there is this dreadful URL thing inside the second
pair of parens.
You don't need [] around \w for a start. After the \/\/ picket fence
there is another class with [\w\*\+-?&;,#~=\.\/\@] (my fingers hurt
typing this). Inside a class, you only have to escape "-]\^$", so
"\*\+" and the others are wrong. Then you do have to escape "-" so
"\+-?" is likely to mean "+\-?", but from looking at the code it's
impossible to tell.
Finally, the string has to end in [\w\/], which translates to
[a-zA-Z0-9_/]. Why? What if the URL doesn't end with that? An URL
for a CGI can look like "http://www.foo.com/bar.cgi?blah=true&blubb="
which would not be matched.
This code is hard to read and has more bugs in it than Starship Troopers.
Yuck.
You want to read the perl documentation on regular expressions,
available (if it's not already on your system) under
http://www.perldoc.com
You want to read the perl manpages "perlre", "perlretut", "perlrequick"
and "perlfaq6"
--
Ernst-Udo Wallenborn
------------------------------
Date: Thu, 24 Oct 2002 11:05:22 -0700
From: Morrison Davis <morry.davis@sun.com>
Subject: Re: calling an external script within a script?
Message-Id: <3DB83662.641A6AAE@sun.com>
Where can I find information on how to embed documentation in my perl script or
a How-To so that I can do a perldoc on my script and get the documentation on
it.
--
Thanks Morry
e-mail address: morry.davis@Sun.COM
phone: X84792/650 786-4792 fax 650 562-2143
------------------------------
Date: Thu, 24 Oct 2002 18:55:00 +0000 (UTC)
From: "David H. Adler" <dha@panix2.panix.com>
Subject: Re: calling an external script within a script?
Message-Id: <slrnarggg4.3ve.dha@panix2.panix.com>
In article <3DB83662.641A6AAE@sun.com>, Morrison Davis wrote:
> Where can I find information on how to embed documentation in my perl script or
>
> a How-To so that I can do a perldoc on my script and get the documentation on
> it.
It sounds like you're looking for perldoc perlpod.
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
I am r00t! Yo! Mad leet 5ex0ring with the 0vary-action!
- subbes
------------------------------
Date: Thu, 24 Oct 2002 22:21:01 +0200
From: peter pilsl <pilsl_use@goldfisch.at>
Subject: Re: calling an external script within a script?
Message-Id: <3db85630$1@e-post.inode.at>
Helgi Briem wrote:
>>
>>open(FH,"mytool |") or die;
>>while (<FH>) {print $_};
>
> But that is not using the system function which is
> what the question was about.
>
sorry, you are right. I answered to fast and I didnt think too much before
doing.
> < SNIP loads of off-topic jabber teaching a grandmother to
> suck eggs >
the OP asked for other methods also.
peter
--
peter pilsl
pilsl_@goldfisch.at
http://www.goldfisch.at
------------------------------
Date: 24 Oct 2002 18:40:09 GMT
From: ctcgag@hotmail.com
Subject: Re: CGI Question - can't differenciate between mutlipe submit buttons
Message-Id: <20021024144009.747$Ih@newsreader.com>
"melonhead" <tim@nonspam_melonhead.net> wrote:
> This isn't strictly a perl question, but I've poseted in the hope that
> someone will be aple to help.
>
> I want to have a form which will have several submit buttons on that each
> appears on the screen to have the same label. For example there would be
> 6 lines of text boxes, each with a button called modify at the end to
> submit that particular line to a CGI program.
>
> From what I can see the setting for the button's label is also the value
> that it returns when clicked, so it would be impossible to differenciate
> between any of them.
I discovered the solution by trial and error yesterday.
Apparently, you have to distinguish them by parameter name, not
parameter value. If You do this:
print $q->submit('Submit1name', 'Submit1label'), "<hr>\n";
print $q->submit('Submit2name', 'Submit1label'), "<hr>\n";
print $q->submit('Submit3name', 'Submit1label'), "<hr>\n";
Then the labels on the summit buttons will all be the same (Submit1label).
But exactly one of the params 'Submit1name', 'Submit2name', 'Submit3name'
will be set to the value 'Submit1label', the others will not be set.
I thought the perldoc for CGI was somewhat inadequate here [my comment]:
1. The first argument (-name) is optional. You can give
the button a name if you have several submission but-
tons in your form and you want to distinguish between
them. The name will also be used as the user-visible
label [unless -value is also specified]. Be aware that
a few older browsers don't deal
with this correctly and never send back a value from a
button.
2. The second argument (-value) is also optional. This
gives the button a value that will be passed to your
script in the query string[, and will also override -name
as the user-visible label].
But for all I know, the behavior I discovered is browser specific.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service
------------------------------
Date: Thu, 24 Oct 2002 12:39:08 -0700
From: Morrison Davis <morry.davis@sun.com>
Subject: Embeded Documentation
Message-Id: <3DB84C5C.DA949BF5@sun.com>
Where can I find documentation or How-To so I can run perldoc
<scriptname>
and get the documentation on it. Need to know the syntax to put in the
script for this to work.
--
Thanks Morry
e-mail address: morry.davis@Sun.COM
phone: X84792/650 786-4792 fax 650 562-2143
------------------------------
Date: Thu, 24 Oct 2002 15:11:13 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: Embeded Documentation
Message-Id: <241020021511138865%comdog@panix.com>
In article <3DB84C5C.DA949BF5@sun.com>, Morrison Davis <morry.davis@sun.com> wrote:
> Where can I find documentation or How-To so I can run perldoc
> <scriptname>
> and get the documentation on it. Need to know the syntax to put in the
> script for this to work.
see the perlpod manpage.
you can also look at the source for the perldoc program to see how it
formatted its documentation. :)
--
brian d foy <comdog@panix.com> - Perl services for hire
The Perl Review - a new magazine devoted to Perl
<http://www.theperlreview.com>
------------------------------
Date: 24 Oct 2002 11:37:28 -0700
From: bkrusch@yahoo.com (Barry Krusch)
Subject: Extracting Data With Regex: Can Pay For This Answer!
Message-Id: <c6b407df.0210241037.2251d563@posting.google.com>
Based on my ridiculously primitive knowledge of Perl, the following
regular expression construct ought to extract the e-mail addresses
from the data below. It doesn't.
+++++++++++ START
while (<DATA>)
{
$_ =~ s/<(.+)>/$1/;
print $_;
}
__DATA__
B.M.W. <racingfreak@hotmail.com>
Larry Meyer <blewribon@aol.com>
++++++++++ END
Above returns this:
B.M.W. racingfreak@hotmail.com
Larry Meyer blewribon@aol.com
But it ought to return this:
racingfreak@hotmail.com
blewribon@aol.com
If you can provide a solution for me, I would be willing to pay for
this. I need a fast response. If you can give me the answer, please
reply to bkrusch@yahoo.com.
Thank you.
------------------------------
Date: Thu, 24 Oct 2002 18:41:53 GMT
From: Espen Myrland <espenmyr@start.no.spam>
Subject: Re: Extracting Data With Regex: Can Pay For This Answer!
Message-Id: <87of9jn0gk.fsf@start.no.spam>
bkrusch@yahoo.com (Barry Krusch) writes:
> Based on my ridiculously primitive knowledge of Perl, the following
> regular expression construct ought to extract the e-mail addresses
> from the data below. It doesn't.
>
> +++++++++++ START
>
> while (<DATA>)
> {
>
> $_ =~ s/<(.+)>/$1/;
>
> print $_;
print $1, "\n";
> If you can provide a solution for me, I would be willing to pay for
> this.
Just mail me the money :)
--
espen
------------------------------
Date: Thu, 24 Oct 2002 19:47:38 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: Extracting Data With Regex: Can Pay For This Answer!
Message-Id: <Xns92B1A0AA686F8dkwwashere@216.168.3.30>
Barry Krusch <bkrusch@yahoo.com> wrote on 24 Oct 2002:
> Based on my ridiculously primitive knowledge of Perl, the following
> regular expression construct ought to extract the e-mail addresses
> from the data below. It doesn't.
>
> +++++++++++ START
>
> while (<DATA>)
> {
>
> $_ =~ s/<(.+)>/$1/;
Close. How about
print "$1\n" if /<(.+)>/;
It's not exactly the most robust solution, but it works well enough for
your sample data.
>
> print $_;
>
> }
>
> __DATA__
>
> B.M.W. <racingfreak@hotmail.com>
> Larry Meyer <blewribon@aol.com>
[snip]
> If you can provide a solution for me, I would be willing to pay for
> this. I need a fast response. If you can give me the answer, please
> reply to bkrusch@yahoo.com.
Post here, get answers here.
I'm not sure I should have even said anything. I hope you're not
collecting spammable addresses.
You owe me one @ and three dot-coms.
--
David K. Wall - usenet@dwall.fastmail.fm
"Oook."
------------------------------
Date: Thu, 24 Oct 2002 14:36:08 -0500
From: "Mick Z." <knjaz@hotmail.com>
Subject: Help: Installing GD module
Message-Id: <3DB84BA8.7010600@hotmail.com>
I have been trying to install the GD module for perl. I understand a
prerequisite for this module is the C librabry libgd and optional
libraries for jpeg, png and Free Type font support.
I have installed and compiled the above.
Now, here's what I don't understand. Below is the output of the make
command when trying to install the GD module:
> perl Makefile.PL
perl Makefile.PL
NOTICE: This module requires libgd 2.0.1 or higher.
For earlier versions of libgd, use GD version 1.43.
Please choose the features that match how libgd was built:
Build JPEG support? [y] y
Build FreeType support? [y] y
Build XPM support? [y] y
If you experience compile problems, please check the @INC, @LIBPATH and
@LIBS
arrays defined in Makefile.PL and manually adjust, if necessary.
WARNING: CAPI is not a known parameter.
Warning: prerequisite Math::Trig 1 not found.
Writing Makefile for GD
> make
gcc -c -I/usr/local/include -I/usr/local/include/gd/include
-D_REENTRANT -D_GNU _SOURCE -fno-strict-aliasing -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/i nclude/gdbm -O2 -march=i386 -mcpu=i686
-DVERSION=\"2.02\" -DXS_VERSION=\"2.02\ " -fpic
"-I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE" -DHAVE_JPEG -DHAV
E_FT -DHAVE_XPM GD.c
cc1: warning: changing search order for system directory
"/usr/local/include"
cc1: warning: as it has already been specified as a non-system directory
GD.xs: In function `newDynamicCtx':
GD.xs:345: structure has no member named `free'
GD.xs: In function `XS_GD__Image_newFromPngData':
GD.xs:499: structure has no member named `free'
GD.xs: In function `XS_GD__Image_newFromGdData':
GD.xs:518: structure has no member named `free'
GD.xs: In function `XS_GD__Image_newFromGd2Data':
GD.xs:535: structure has no member named `free'
GD.xs: In function `XS_GD__Image_newFromJpegData':
GD.xs:555: structure has no member named `free'
GD.xs: In function `XS_GD__Image_newFromWBMPData':
GD.xs:580: structure has no member named `free'
make: *** [GD.o] Error 1
------------------------------
Date: Thu, 24 Oct 2002 20:54:44 GMT
From: Bryan <bryan@akanta.com>
Subject: Re: Help: Installing GD module
Message-Id: <3DB85E14.9020109@akanta.com>
I just installed GD for about the 10th time. Make sure you read the
documents -very- carefully in the GD source.
Here's what you need to do:
1. Get the latest libgd from boutrell.com.
2. From the GD source dir, copy patch_gd.pl to an -untouched- libgd
source dir.
3. in libgd source run ./configure --enable-jpeg --enable-freetype
--enable-xpm
4. run make, make install
5. Now go to GD dir and GD should compile properly and install
Worked for me. Give it a shot.
B
------------------------------
Date: Thu, 24 Oct 2002 19:04:02 GMT
From: Jason Baugher <jason@baugher.pike.il.us>
Subject: IO::Socket::INET and telnet
Message-Id: <Xns92B18F1917419jasonbaugherpikeilus@209.242.76.10>
I've got the following simple code that I can't get to work:
#!/usr/bin/perl -w
use strict;
use IO::Socket;
my $request = IO::Socket::INET->new(
PeerAddr => 'marianne',
PeerPort => '23',
Proto => 'tcp',
Type => SOCK_STREAM,
) or die "$!";
print while <$request>;
Basically, when I run this script, I get nothing at all, and it never
completes - which tells me the socket opened, just that it isn't reading
the data I expect to see.
Doing a normal telnet to this machine on port 23 works:
$ telnet marianne 23
Trying 10.10.10.4...
Connected to marianne (10.10.10.4).
Escape character is '^]'.
Red Hat Linux release 7.3 (Valhalla)
Kernel 2.4.18-3 on an i686
login:
Why don't I see the 3 "Red Hat .... login:" lines from the perl script?
When I alter it to use PeerPort => '25', it gives me the return string
from the FTP server, like I expect it to.
What is really annoying is that I can find examples of this all over
Google, and even though I follow the various examples, I can't get it to
spit out anything.
This is on a RedHat 7.3 box, Perl 5.6.1.
--
Jason Baugher
Virtual Adept Professional Consulting Services
1406 Adams Street, Quincy, IL 62301 - (217) 221-5406
jason@baugher.pike.il.us - http://baugher.pike.il.us/virtualadept
------------------------------
Date: 24 Oct 2002 14:43:26 -0700
From: johnston.jay@mtvne.com (shambolic)
Subject: pulling out text from between two strings
Message-Id: <f333df78.0210241343.3e83c23e@posting.google.com>
Hi,
i have a whois webpage in scalar $doc, and want to pull out the text
between the strings "netname" and RIPE.
i know this is fairly standard, but having pondered the FAQ at
http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlfaq6/How_can_I_pull_out_lines_between_two_pat.html
i am still none the wiser.
(i'll confess to being fairly green, but this particular FAQ is a
little light on explanation).
any pointers gratefully received.
thx
j
------------------------------
Date: Thu, 24 Oct 2002 21:12:55 GMT
From: "TBN" <ihave@noemail.com>
Subject: RegEx switcheroo
Message-Id: <rnZt9.182$EOT8.41680944@news2.randori.com>
I would be grateful for the formula for taking a string such as:
Bob.Smith
and turning it into
Smith, Bob
Thanks.
------------------------------
Date: Thu, 24 Oct 2002 23:32:30 +0200
From: Jan =?ISO-8859-15?Q?Thom=E4?= <kork@insomnia-hq.de>
Subject: Re: RegEx switcheroo
Message-Id: <ap9ofd$smceb$3@ID-82623.news.dfncis.de>
Hi,
$result = "Bob.Smith";
# THE MIGHTY FORMULA ;D
$result =~ s/(.*)\.(.*)/$2, $1/;
print $result; --> yields "Smith, Bob"
Everything before the last dot is taken as first name, since regexp is
greedy.
Regards,
Jan
TBN wrote:
> I would be grateful for the formula for taking a string such as:
> Bob.Smith
>
> and turning it into
>
> Smith, Bob
>
> Thanks.
--
_____________________________________________________
Jan Thomä (Kork of insOMnia) kork@insomnia-hq.de
insOMnia http://www.insomnia-hq.de
------------------------------
Date: Thu, 24 Oct 2002 21:26:47 GMT
From: "TBN" <ihave@noemail.com>
Subject: Re: RegEx switcheroo
Message-Id: <rAZt9.186$EOT8.40697906@news2.randori.com>
"TBN" <ihave@noemail.com> wrote in message
news:rnZt9.182$EOT8.41680944@news2.randori.com...
> I would be grateful for the formula for taking a string such as:
> Bob.Smith
>
> and turning it into
>
> Smith, Bob
>
I figured it out with the probably horribly inefficient code below:
my $cn = Bob.Smith@yahoo.com;
$cn =~ m/^(\S+)\.(\S+)\@yahoo.com/i;
$name = "$2, $1";
------------------------------
Date: 24 Oct 2002 17:28:41 -0400
From: Ryan Shondell <shondell@cis.ohio-state.edu>
Subject: Re: RegEx switcheroo
Message-Id: <xcwk7k7bk6u.fsf@psi.cis.ohio-state.edu>
"TBN" <ihave@noemail.com> writes:
> I would be grateful for the formula for taking a string such as:
> Bob.Smith
>
> and turning it into
>
> Smith, Bob
Does it _have_ to be a regex? How about...
$_ = "Bob.Smith";
print join ", ", reverse(split /\./);
--
Ryan Shondell <shondell@cis.ohio-state.edu>
------------------------------
Date: Thu, 24 Oct 2002 23:45:37 +0200
From: Jan =?ISO-8859-15?Q?Thom=E4?= <kork@insomnia-hq.de>
Subject: Re: RegEx switcheroo
Message-Id: <ap9p80$s2bi4$1@ID-82623.news.dfncis.de>
Ryan Shondell wrote:
> print join ", ", reverse(split /\./);
WHOOO HOOO, THAT's Perl at its best! Always great to see what the perl
weirdos invent ;) Ah and -> your solution is 50% faster in Benchmark!
Regards,
Jan
--
_____________________________________________________
Jan Thomä (Kork of insOMnia) kork@insomnia-hq.de
insOMnia http://www.insomnia-hq.de
------------------------------
Date: 24 Oct 2002 12:49:26 -0700
From: rnoory@videotron.ca (R.Noory)
Subject: Regular Expression
Message-Id: <8fec9af1.0210241149.6e6dfba@posting.google.com>
Hello Again,
Now I have words with hyphen. I would like to write a single rule to
take care of every word that have hyphen or apostrophe.
Input
person'ate
top-dress
re-reiterate
re-collect
proof-arm
output
person('ate)
(top-)dress
(re-)reiterate
(re-)collect
(proof-)arm
Thanks
------------------------------
Date: Thu, 24 Oct 2002 18:45:04 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: regular expression
Message-Id: <Xns92B1960ED4C73dkwwashere@216.168.3.30>
Jeff 'japhy' Pinyan <pinyaj@rpi.edu> wrote on 24 Oct 2002:
> and here are two hybrids (based on both of our regexes):
>
> sub hybrid1 { shift =~ /d[^d]*d[^d]*d[^d]*d/ }
> sub hybrid2 { shift =~ /d.*?d.*?d.*?d/ }
>
> It turns out that hybrid1 is the fastest solution (given my data set),
> just because it's the most explicit.
Are you sure you don't have a typo? When I ran your program hybrid2 was
fastest. That's certainly not what I would have expected. I tried different
variations of data, too, some that had lots of matches, and some that had no
matches. Same result: /d.*?d.*?d.*?d/ was always the fastest.
Anyway, maybe I need to reread Friedl's book. :-)
--
David K. Wall - usenet@dwall.fastmail.fm
"Oook."
------------------------------
Date: 24 Oct 2002 20:12:54 GMT
From: Tina Mueller <usenet@tinita.de>
Subject: Re: Regular Expression
Message-Id: <ap9k86$s52vs$1@fu-berlin.de>
R.Noory <rnoory@videotron.ca> wrote:
> Now I have words with hyphen. I would like to write a single rule to
> take care of every word that have hyphen or apostrophe.
please read
`perldoc perlre` for further information on
regular expressions. i saw you were posting several
times, every time coming up with another requirement,
so now it would be time to read up the docs yourself =)
hth, tina
--
http://www.tinita.de/ \ enter__| |__the___ _ _ ___
http://Movies.tinita.de/ \ / _` / _ \/ _ \ '_(_-< of
http://PerlQuotes.tinita.de/ \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: Thu, 24 Oct 2002 23:05:38 +0200
From: hubert depesz lubaczewski <depesz@depesz.pl>
Subject: Re: Regular Expression
Message-Id: <slrn.pl.argo52.a4v.depesz@depeszws.depesz.pl>
R.Noory wyrzeĽbił(a):
> Now I have words with hyphen. I would like to write a single rule to
> take care of every word that have hyphen or apostrophe.
my (and others) reply to your last request, should be more than
sufficent for anyone with at least 3 brain-cells to find out solution to
your new problem. why don't you do it yourself?
depesz
--
hubert depesz lubaczewski http://www.depesz.pl/
------------------------------------------------------------------------
Mój Boże, spraw abym milczał, dopóki się nie upewnię, że naprawdę mam
co¶ do powiedzenia. (c) 1998 depesz
------------------------------
Date: 24 Oct 2002 14:28:14 -0700
From: russellcecala@netscape.net (Russell Cecala)
Subject: Re: Trying to make a GUI.
Message-Id: <14d3c801.0210241328.6221aadd@posting.google.com>
The line ...
my $main = "";
... should read ...
my $main = MainWindow->new();
BTW http://www.perlmonks.com is a great site
to learn about Perl.
Good luck with you project!
------------------------------
Date: 24 Oct 2002 21:49:10 GMT
From: "Curtis Poe" <cp@onsitetech.com>
Subject: Re: Why are empty tailing elements missing from the array returned by split?
Message-Id: <ap9psm$ko7@dispatch.concentric.net>
"zzhang1" <zzhang1@bcm.tmc.edu> wrote in message
news:3DB82404@webmail.bcm.tmc.edu...
> Sir,
>
> I used the following code to test "split":
>
> my @test = split(/,/, ",1,,2,3, 4, 5 , 6,,");
> foreach (@test)
> {
> print ">$_<\n";
> }
>
> The output is:
> ><
> >1<
> ><
> >2<
> >3<
> > 4<
> > 5 <
> > 6<
>
>
> Apparently the two empty tailing elements are not in the returned array.
> Is this an inconsistency or just a strange behavior of split?
From perldoc -f split:
Splits a string into a list of strings and returns that list. By
default, empty leading fields are preserved, and empty trailing
ones are deleted.
--
Curtis "Ovid" Poe, Senior Programmer, ONSITE! Technology
Someone asked me how to count to 10 in Perl:
push @A, $_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift @a;shift @a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A
------------------------------
Date: 24 Oct 2002 11:44:24 -0700
From: mullman@charter.net (Chris)
Subject: Re: Writing Microsoft Outlook Notes With Perl
Message-Id: <c71b7a2c.0210241044.5fca5f72@posting.google.com>
"Peter Gibbs" <news@emkel.co.za> wrote in message news:<3db7ebdd$0$18847@hades.is.co.za>...
> "Chris" <mullman@charter.net> wrote in message
> news:c71b7a2c.0210220638.71e61d3d@posting.google.com...
> > I've got this half-baked idea for writing a program that will
> > dynamically generate Microsoft Outlook Notes from information gathered
> > from a database. I know how to do everything except create the
> > Outlook Note. Can anyone point me in the direction of information for
> > accomplishing this? I've seen others do this (not with Perl) where
> > the program will seek data from the weather service and write that
> > data into an Outlook Note. That's similar to what I am trying to do.
>
> You need to use the Win32::OLE module, and emulate what a Visual
> Basic program would do for the same purpose. Something like (NB
> lines will probably be wrapped):
>
> # Outlook Notes test
> use Win32::OLE;
>
> # use existing instance if Outlook is already running
> eval {$ex = Win32::OLE->GetActiveObject('Outlook.Application')};
> die "Outlook not installed" if $@;
> unless (defined $ex) {
> $ex = Win32::OLE->new('Outlook.Application', sub {$_[0]->Quit;})
> or die "Oops, cannot start Outlook";
> }
>
> $olMAPI = $ex->GetNameSpace("MAPI") or die "Error getting name space";
> $notes = $olMAPI->Folders("Personal Folders")->Folders("Notes") or die
> "Error getting folder";
>
> $myItem = $notes->Items->Add;
> $myItem->{body} = "Testing";
> $myItem->Save;
>
> undef $notes;
> undef $olMAPI;
> undef $ex;
Peter, your're the best!
A note, however. I found that you have to name the Folder with the
name that is in your own Outlook application. For example, you have
"Personal Folders" while mine uses my full name. Once I modified it
to show the appropriate folder name it worked perfectly.
Thanks a million!
Chris
------------------------------
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.
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 4025
***************************************