[19076] in Perl-Users-Digest
Perl-Users Digest, Issue: 1271 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 11 03:09:44 2001
Date: Wed, 11 Jul 2001 00:06:28 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <994835188-v10-i1271@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 11 Jul 2001 Volume: 10 Number: 1271
Today's topics:
Re: "family tree" generator <iltzu@sci.invalid>
- Looking for this script... <vemba72@hotmail.com>
Re: - Looking for this script... <news@dynamicwebdevelopers.com>
-i and search & replace <prlawrence@lehigh.edu>
Re: -i and search & replace (Tad McClellan)
Re: -i and search & replace <gnarinn@hotmail.com>
[ANNOUNCE] Config::Properties 0.40 (Randy Jay Yarger)
Activeperl crash - debug reports Signal SEGV: <stumo@bigfoot.com>
Re: Activeperl crash - debug reports Signal SEGV: <stumo@bigfoot.com>
Advanced Sorting <calgeg@ix.netcom.com>
Re: Advanced Sorting <kiseok7@yahoo.com>
Re: Advanced Sorting (Brian Pontz)
Re: Advanced Sorting (Brian Pontz)
Re: Advanced Sorting (Tad McClellan)
Re: Advanced Sorting <carlos@plant.student.utwente.nl>
Re: Advanced Sorting <carlos@plant.student.utwente.nl>
Re: Advanced Sorting <wyzelli@yahoo.com>
Re: Advanced Sorting <wyzelli@yahoo.com>
Re: Advanced Sorting (Anno Siegel)
ANN: Text::PDF::API version 0.701.1 available ... alfredreibenschuh@yahoo.com
ANNOUNCE: Java.pm 4.0 <mark@zzo.com>
Applying a regex on a line that matches several times a (Shane Adams)
Re: Applying a regex on a line that matches several tim <pne-news-20010711@newton.digitalspace.net>
Re: Array Sorting-Looping-Number Formatting <nospam@xx.com>
Beginner to Perl (dr0id)
Re: Beginner to Perl <bwalton@rochester.rr.com>
Re: Beginner to Perl <wyzelli@yahoo.com>
Re: Beginner to Perl (Smiley)
Re: Beginner to Perl (dr0id)
Re: Beginner to Perl <ron@savage.net.au>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 10 Jul 2001 14:45:48 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: "family tree" generator
Message-Id: <994774612.11007@itz.pp.sci.fi>
In article <3b49bdab$0$7108$4d4efb8e@news.be.uu.net>, Kenneth Bruyninckx wrote:
>
>I'm looking for a script that given a set of data can "draw" (display the
>names with interconnecting lines) a tree structure.
That's a fairly open-ended specification. You haven't specified what
the output medium will be, whether there are any layout requirements,
and how the tree will be represented internally.
Anyway, here's one solution. It takes a directed tree where each node
is represented as a name and a hash of its children (or false for leaf
nodes). The output is a hierarchical list with ASCII art lines added.
sub _tree {
my $prefix = shift;
while (@_) {
my $name = shift;
my $children = shift;
print $prefix, (@_ ? " |--" : " `--"), "$name\n";
_tree($prefix. (@_ ? " | " : " "), %$children) if $children;
}
}
sub tree { print shift, "\n"; _tree("", %{+shift}); }
tree(root => {foo => {leaf => 0, branch => {one => 0, two => 0}}, bar => 0});
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post something,
we discuss its implications. If the discussion happens to answer a question
you've asked, that's incidental." -- nobull in comp.lang.perl.misc
------------------------------
Date: Mon, 9 Jul 2001 19:54:02 -0400
From: "Jon" <vemba72@hotmail.com>
Subject: - Looking for this script...
Message-Id: <0sr27.9537$sJ3.496282@wagner.videotron.net>
Hi guys! Long time no see.
I'm looking for a specific script, or one that functions almost identically
like it. FACEOFF.COM calls it "SoundOff", but it's just yet another version
of the popular TalkBack scripts out there.
I've always wanted to allow user comments at the end of articles on some of
my websites, just like they do on FaceOff.com and almost every news site out
there these days.
A direct link to exactly what I'm talking about would be :
http://www.faceoff.com/nhl/news/story.html?f=/news/20010705/010705172026.htm
l
Scroll to the bottom of the page... I love this script. No subject field,
just use the first line of the entry body, all nice and tight, not taking up
much room.
Anyone know where I can get a script like this one?
Thanks!
Jon
------------------------------
Date: Tue, 10 Jul 2001 00:26:12 GMT
From: "DynamicWebDevelopers" <news@dynamicwebdevelopers.com>
Subject: Re: - Looking for this script...
Message-Id: <DYr27.1424$hv1.556870@paloalto-snr1.gtei.net>
try hotscripts.com...www.hotscripts.com
=)
--
Dynamic Web Developers
Web Application Development Resources and Services
http://www.dynamicwebdevelopers.com/
"Jon" <vemba72@hotmail.com> wrote in message
news:0sr27.9537$sJ3.496282@wagner.videotron.net...
> Hi guys! Long time no see.
>
> I'm looking for a specific script, or one that functions almost
identically
> like it. FACEOFF.COM calls it "SoundOff", but it's just yet another
version
> of the popular TalkBack scripts out there.
>
> I've always wanted to allow user comments at the end of articles on some
of
> my websites, just like they do on FaceOff.com and almost every news site
out
> there these days.
>
> A direct link to exactly what I'm talking about would be :
>
http://www.faceoff.com/nhl/news/story.html?f=/news/20010705/010705172026.htm
> l
>
> Scroll to the bottom of the page... I love this script. No subject field,
> just use the first line of the entry body, all nice and tight, not taking
up
> much room.
>
> Anyone know where I can get a script like this one?
>
> Thanks!
>
> Jon
>
>
------------------------------
Date: Tue, 10 Jul 2001 15:13:01 -0400
From: "Phil R Lawrence" <prlawrence@lehigh.edu>
Subject: -i and search & replace
Message-Id: <9ifk3u$g0a@fidoii.CC.Lehigh.EDU>
Why does empty my files to 0 bytes? I guess I can't figure how ti
use -i correctly.
#!/usr/local/bin/perl -wi
use diagnostics;
use strict;
print <<"";
This script will perform a global search and replace for all
files you specify on the command line. Any metacharacters you
specify will be autmatically eacaped -- in other words all
substitutions will match the strings you specify character for
character.
my $old;
print "Enter the OLD exact literal character string you want REPLACED:
";
chomp( $old = <STDIN> );
$old = quotemeta $old;
my $new;
print "Enter the NEW exact literal character string you want
SUBSTITUTED: ";
chomp( $new = <STDIN> );
$new = quotemeta $new;
while (<>) {
s/$old/$new/g;
}
------------------------------
Date: Tue, 10 Jul 2001 14:56:02 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: -i and search & replace
Message-Id: <slrn9kmju2.bgm.tadmc@tadmc26.august.net>
Phil R Lawrence <prlawrence@lehigh.edu> wrote:
>Why does empty my files to 0 bytes?
Because you never output the the changed lines.
>I guess I can't figure how ti
>use -i correctly.
>
>#!/usr/local/bin/perl -wi
>while (<>) {
> s/$old/$new/g;
print;
>}
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 10 Jul 2001 19:22:15 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: -i and search & replace
Message-Id: <994792935.58011403074488.gnarinn@hotmail.com>
In article <9ifk3u$g0a@fidoii.CC.Lehigh.EDU>,
Phil R Lawrence <prlawrence@lehigh.edu> wrote:
>Why does empty my files to 0 bytes? I guess I can't figure how ti
>use -i correctly.
thats because there is no output.
>
>#!/usr/local/bin/perl -wi
>use diagnostics;
>use strict;
>
>print <<"";
>This script will perform a global search and replace for all
>files you specify on the command line. Any metacharacters you
>specify will be autmatically eacaped -- in other words all
>substitutions will match the strings you specify character for
>character.
>
>my $old;
>print "Enter the OLD exact literal character string you want REPLACED:
>";
>chomp( $old = <STDIN> );
>$old = quotemeta $old;
>
>my $new;
>print "Enter the NEW exact literal character string you want
>SUBSTITUTED: ";
>chomp( $new = <STDIN> );
>$new = quotemeta $new;
>
>while (<>) {
> s/$old/$new/g;
ok. now the line after substitution is in $_
do you expect it to be printed automatically?
if so, you are confusing -i and -p
actually, for this kind of stuff -p and -i are often used together
but in this case it is enaough to add here:
print;
>}
>
gnari
------------------------------
Date: 10 Jul 2001 10:21:12 -0700
From: ryarger@mediaone.net (Randy Jay Yarger)
Subject: [ANNOUNCE] Config::Properties 0.40
Message-Id: <tknil0loifdj0c@corp.supernews.com>
Config::Properties
==============
A Perl version of the API presented by the standard java.util.Properties class.
Changes summary:
0.40 Tue Jul 10 11:32:00 2001
- Add format/getFormat/setFormat() to change the appearance of
saved properties)
- POD Fixes
- Bugfixes
README:
Config::Properties
=============
Description
-----------
Config::Properties is an near implementation of the java.util.Properties API.
It is designed to allow easy reading, writing and manipulation of Java-style
property files.
Copyright
---------
Copyright (c) 2001 Randy Jay Yarger. All Rights Reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Installation
------------
> perl Makefile.PL
> make
.... and if you like
> make test
.... and then
> make install
> perldoc Config::Properties
Author
------
Randy Jay Yarger <ryarger@mediaone.net>
------------------------------
Date: Mon, 9 Jul 2001 16:36:30 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Activeperl crash - debug reports Signal SEGV:
Message-Id: <gbk27.16392$B56.2784338@news2-win.server.ntlworld.com>
I have a script that is now producing an error on perl.exe right at the end
(i.e. when all I'm expecting it to do is exit). DrWatson reports
Perl Interpreter attempted to use a null data pointer variable.
When I run it with -d, the script seems to go somewhere into the carp module and
then reports
Signal SEGV:
Was running on ActivePerl 5.6.0 - upgraded to ActivePerl 5.6.1 (latest on
website), no change.
Any ideas? I haven't made any changes to the bit that seems to be giving the
error, and I can't see what's actually doing it.
Many thanks
Stuart
------------------------------
Date: Tue, 10 Jul 2001 08:55:32 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Re: Activeperl crash - debug reports Signal SEGV:
Message-Id: <7xy27.13292$WS4.2048843@news6-win.server.ntlworld.com>
Don't worry - managed to get rid of it (although I still don't understand why it
happened, or how the minor change I did made a difference...)
------------------------------
Date: Mon, 9 Jul 2001 21:58:21 -0500
From: "Garth Gause" <calgeg@ix.netcom.com>
Subject: Advanced Sorting
Message-Id: <9idqki$8ti$1@slb1.atl.mindspring.net>
I am currently trying to write a Perl script that creates an Array of unique
items. Within the array an item might show up two or three times. I want
to sort the array for unique values and create a new array. For some reason
I am unable to determine the logic that would be needed to come up this the
code. Can some one help me with this probably simple sort routine. Thanks.
Sample of array:
@Trees = qw(dogwood malpe river_birch maple dogwood)
Need
@NewTrees = qw(dogwood maple river_birch)
------------------------------
Date: Tue, 10 Jul 2001 12:26:10 +0900 (KST)
From: kim kiseok <kiseok7@yahoo.com>
Subject: Re: Advanced Sorting
Message-Id: <9idski$e4k$1@news1.kornet.net>
@Trees = qw(dogwood malpe river_birch maple dogwood);
%temp = map { $_ => 1 } @Trees;
@NewTrees = sort {$a cmp $b} keys %temp;
print "@NewTrees";
> I am currently trying to write a Perl script that creates an Array of unique
> items.++Within the array an item might show up two or three times.++I want
> to sort the array for unique values and create a new array.++For some reason
> I am unable to determine the logic that would be needed to come up this the
> code.++Can some one help me with this probably simple sort routine.++Thanks.
>
>
> Sample of array:
> @Trees = qw(dogwood malpe river_birch maple dogwood)
>
> Need
> @NewTrees = qw(dogwood maple river_birch)
>
>
>
>
---------------------------------------------------
-------------- ÀÎÅÍ³Ý Ä«¸®½º¸¶ KORNET -------------
------------------------------
Date: Tue, 10 Jul 2001 03:29:31 GMT
From: pontz@NO_SPAMchannel1.com (Brian Pontz)
Subject: Re: Advanced Sorting
Message-Id: <3b4a75a7.19620939@news.ne.mediaone.net>
>I am currently trying to write a Perl script that creates an Array of unique
>items. Within the array an item might show up two or three times. I want
>to sort the array for unique values and create a new array. For some reason
>I am unable to determine the logic that would be needed to come up this the
>code. Can some one help me with this probably simple sort routine. Thanks.
Use a hash to get unique items and then do something like this
foreach my $item (@array) {
$hash{$item} = 1;
}
@unique = keys %hash;
Brian
------------------------------
Date: Tue, 10 Jul 2001 03:36:01 GMT
From: pontz@NO_SPAMchannel1.com (Brian Pontz)
Subject: Re: Advanced Sorting
Message-Id: <3b4a77e5.20195241@news.ne.mediaone.net>
>I am currently trying to write a Perl script that creates an Array of unique
>items. Within the array an item might show up two or three times. I want
>to sort the array for unique values and create a new array. For some reason
>I am unable to determine the logic that would be needed to come up this the
>code. Can some one help me with this probably simple sort routine. Thanks.
Forgot to mention before that this is a FAQ
http://www.perldoc.com/perl5.6/faq/perlfaq4.html
How can I remove duplicate elements from a list or array?
Brian
------------------------------
Date: Mon, 9 Jul 2001 22:46:58 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Advanced Sorting
Message-Id: <slrn9kkr52.8l7.tadmc@tadmc26.august.net>
Garth Gause <calgeg@ix.netcom.com> wrote:
>I am currently trying to write a Perl script that creates an Array of unique
^^^^^^
When you hear yourself using that word (or "duplicate", "cross reference",
"lookup"...) you should think to yourself: hash, hash, hash.
>items. Within the array an item might show up two or three times. I want
>to sort the array for unique values and create a new array.
>Sample of array:
>@Trees = qw(dogwood malpe river_birch maple dogwood)
>
>Need
>@NewTrees = qw(dogwood maple river_birch)
my %UniqTrees;
@UniqTrees{ @Trees } = (1) x @Trees; # a "hash slice"
#$UniqTrees{$_} = 1 foreach @Trees; # same thing without a slice
my @NewTrees = sort keys %UniqTrees;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 10 Jul 2001 07:03:56 +0200
From: "carlos" <carlos@plant.student.utwente.nl>
Subject: Re: Advanced Sorting
Message-Id: <9ie2bu$673$1@dinkel.civ.utwente.nl>
something like this should do the job:
sub cutDoubles {
my @uit;
while (my $in = shift) {
my $keer = 0;
foreach my $al (@uit) {
if ($in eq $al) {
$keer++;
}
}
if ($keer == 0) {
push @uit, $in;
}
}return @uit;
}
@NewTrees = sort(cutDoubles(@Trees));
"Garth Gause" <calgeg@ix.netcom.com> wrote in message
news:9idqki$8ti$1@slb1.atl.mindspring.net...
> I am currently trying to write a Perl script that creates an Array of
unique
> items. Within the array an item might show up two or three times. I want
> to sort the array for unique values and create a new array. For some
reason
> I am unable to determine the logic that would be needed to come up this
the
> code. Can some one help me with this probably simple sort routine.
Thanks.
>
>
> Sample of array:
> @Trees = qw(dogwood malpe river_birch maple dogwood)
>
> Need
> @NewTrees = qw(dogwood maple river_birch)
>
>
>
>
------------------------------
Date: Tue, 10 Jul 2001 07:05:24 +0200
From: "carlos" <carlos@plant.student.utwente.nl>
Subject: Re: Advanced Sorting
Message-Id: <9ie2em$67r$1@dinkel.civ.utwente.nl>
hash, hash, hash
of course!
--
carlos
"carlos" <carlos@plant.student.utwente.nl> wrote in message
news:9ie2bu$673$1@dinkel.civ.utwente.nl...
> something like this should do the job:
>
> sub cutDoubles {
> my @uit;
> while (my $in = shift) {
> my $keer = 0;
> foreach my $al (@uit) {
> if ($in eq $al) {
> $keer++;
> }
> }
> if ($keer == 0) {
> push @uit, $in;
> }
> }return @uit;
>
> }
> @NewTrees = sort(cutDoubles(@Trees));
>
>
> "Garth Gause" <calgeg@ix.netcom.com> wrote in message
> news:9idqki$8ti$1@slb1.atl.mindspring.net...
> > I am currently trying to write a Perl script that creates an Array of
> unique
> > items. Within the array an item might show up two or three times. I
want
> > to sort the array for unique values and create a new array. For some
> reason
> > I am unable to determine the logic that would be needed to come up this
> the
> > code. Can some one help me with this probably simple sort routine.
> Thanks.
> >
> >
> > Sample of array:
> > @Trees = qw(dogwood malpe river_birch maple dogwood)
> >
> > Need
> > @NewTrees = qw(dogwood maple river_birch)
> >
> >
> >
> >
>
>
------------------------------
Date: Tue, 10 Jul 2001 14:47:55 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Advanced Sorting
Message-Id: <D8w27.25$xO3.1752@vic.nntp.telstra.net>
"carlos" <carlos@plant.student.utwente.nl> wrote in message
news:9ie2bu$673$1@dinkel.civ.utwente.nl...
> >"Garth Gause" <calgeg@ix.netcom.com> wrote in message
> > news:9idqki$8ti$1@slb1.atl.mindspring.net...
> > I am currently trying to write a Perl script that creates an Array of
> unique
> > items. Within the array an item might show up two or three times. I
want
> > to sort the array for unique values and create a new array. For some
> reason
> > I am unable to determine the logic that would be needed to come up this
> the
> > code. Can some one help me with this probably simple sort routine.
> Thanks.
> >
> >
> > Sample of array:
> > @Trees = qw(dogwood malpe river_birch maple dogwood)
> >
> > Need
> > @NewTrees = qw(dogwood maple river_birch)
> > something like this should do the job:
>
> sub cutDoubles {
> my @uit;
> while (my $in = shift) {
> my $keer = 0;
> foreach my $al (@uit) {
> if ($in eq $al) {
> $keer++;
> }
> }
> if ($keer == 0) {
> push @uit, $in;
> }
> }return @uit;
>
> }
> @NewTrees = sort(cutDoubles(@Trees));
>
Whats wrong with the answer in FAQ4?
(Modified to suit)...
my @Trees = qw(dogwood malpe river_birch maple dogwood);
my %treehash=();
my @NewTrees = grep(!$treehash{$_}++, @Trees);
Wyzelli
--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;
------------------------------
Date: Tue, 10 Jul 2001 14:53:13 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Advanced Sorting
Message-Id: <Bdw27.26$xO3.1587@vic.nntp.telstra.net>
"Wyzelli" <wyzelli@yahoo.com> wrote in message
news:D8w27.25$xO3.1752@vic.nntp.telstra.net...
> "carlos" <carlos@plant.student.utwente.nl> wrote in message
> >
>
> Whats wrong with the answer in FAQ4?
>
> (Modified to suit)...
>
> my @Trees = qw(dogwood malpe river_birch maple dogwood);
>
> my %treehash=();
>
> my @NewTrees = grep(!$treehash{$_}++, @Trees);
>
Actually I like the next answer even better,
my @Trees = qw(dogwood malpe river_birch maple dogwood);
my %treehash=();
@treehash{@Trees} = ();
my @NewTrees = sort keys %treehash;
Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass it
around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";
------------------------------
Date: 10 Jul 2001 15:51:46 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Advanced Sorting
Message-Id: <9if8ai$g0v$1@mamenchi.zrz.TU-Berlin.DE>
According to Tad McClellan <tadmc@augustmail.com>:
> Garth Gause <calgeg@ix.netcom.com> wrote:
> >I am currently trying to write a Perl script that creates an Array of unique
> ^^^^^^
>
> When you hear yourself using that word (or "duplicate", "cross reference",
> "lookup"...) you should think to yourself: hash, hash, hash.
>
>
> >items. Within the array an item might show up two or three times. I want
> >to sort the array for unique values and create a new array.
>
> >Sample of array:
> >@Trees = qw(dogwood malpe river_birch maple dogwood)
> >
> >Need
> >@NewTrees = qw(dogwood maple river_birch)
>
>
> my %UniqTrees;
> @UniqTrees{ @Trees } = (1) x @Trees; # a "hash slice"
> #$UniqTrees{$_} = 1 foreach @Trees; # same thing without a slice
> my @NewTrees = sort keys %UniqTrees;
...or even
@UniqTrees{ @Trees } = (); # set values in hash slice to undef
Anno
------------------------------
Date: Sun, 08 Jul 2001 22:27:22 GMT
From: alfredreibenschuh@yahoo.com
Subject: ANN: Text::PDF::API version 0.701.1 available ...
Message-Id: <tknik456kvrffa@corp.supernews.com>
hi!
you can download perl's Text:PDF::API v0.701.1 from CPAN :)
Text:PDF::API comes with the following improvements:
- Bugfixes from the 0.700.x test run.
- Various changes of postscript font-handling
for enabling compact text.
- Various changes of internal numeric proccessing
for enabling more compact PDFs.
- Further stabilized testing suite to pass "make test"
on most perl-platforms.
the module works for me ok, you milage may vary ...
usual download locations:
ftp://pause.kbx.de/pub/PAUSE/authors/id/A/AR/AREIBENS/
ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/by-authors/id/A/AR/AREIBENS/
http://penguin.at0.net/~fredo/files/
http://freshmeat.net/projects/text-pdf-api/
-- Alfred Reibenschuh
linux geek, | Sometimes I hear voices in my head , telling me to
perl monger, | do strange things, but I always wonder if that's
font monger, | just me thinking about things I really want to do
roleplayer | anyway. Why do the voices never say,
& sf-fanatic | "Your dosage needs adjustment"?
look @ http://penguin.at0.net/~fredo/
-- me, myself & I
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
N++ W+++ E--- U++++ P+++ O-- k- w++ d- s+:+ a- c++V-- PS++ PE
Y+ PGP++ t+++ 5+++ x++ R++ tv+ b+ DI D++ G e+ h--- r+++ y++**
------END GEEK CODE BLOCK------
------------------------------
Date: Mon, 9 Jul 2001 22:01:58 -0700
From: <mark@zzo.com>
Subject: ANNOUNCE: Java.pm 4.0
Message-Id: <tknikmgmc99205@corp.supernews.com>
WHAT
Java.pm 4.0 - as always check out the perldoc, Changes, and
README (online perldoc at http://www.zzo.com/Java/)
WHY
Adds some cool new stuff - basic authentication,
better Exception handling, disabling of event ports,
and (hold on!) basic support for calling Perl from Java.
SYNOPSIS
use Java;
# Disable event port & authorization file
$java = new Java(event_port => -1, authfile=>"secret_file");
# New Exception handling stuff!
my $I;
eval
{
$I = $java->java_lang_Integer("parseInt", "Not Int");
};
if ($@)
{
# $@ contains the 'getMessage()' string from Java
my $exception_object = $java->get_exception;
my @stack_trace = $java->get_stack_trace;
}
Plus all the fun that's always been there!
WHERE
CPAN & http://www.zzo.com/Java/getit.html
WHO
Mark Ethan Trostler & the good folks at ZZO.com!
------------------------------------------
Mark Ethan Trostler mark@zzo.com
Computing Solutions http://www.zzo.com
------------------------------------------
------------------------------
Date: 10 Jul 2001 21:47:04 -0700
From: adamsch1@yahoo.com (Shane Adams)
Subject: Applying a regex on a line that matches several times and doing a lookup per match to a function?
Message-Id: <cfbc8bbb.0107102047.195cc989@posting.google.com>
Hope that explains it but basically:
$_ = "XXX RFC 1234 XXX rfc 4321";
Then doing something like:
s/(RFC ([0-9]+)/&foo(\1)/gi;
Of course this outputs:
XXX &foo(RFC 1234) XXX &foo(rfc 4321)
So what I want is foo applied to each value that matches in the line.
Any suggestions?
Thanks!
------------------------------
Date: Wed, 11 Jul 2001 07:04:47 +0200
From: Philip Newton <pne-news-20010711@newton.digitalspace.net>
Subject: Re: Applying a regex on a line that matches several times and doing a lookup per match to a function?
Message-Id: <sennktck64mnnjd4o3qobs3hjh3c4h9mm8@4ax.com>
On 10 Jul 2001 21:47:04 -0700, adamsch1@yahoo.com (Shane Adams) wrote:
> Hope that explains it but basically:
>
> $_ = "XXX RFC 1234 XXX rfc 4321";
>
> Then doing something like:
>
> s/(RFC ([0-9]+)/&foo(\1)/gi;
s/RFC (\d+)/foo($1)/egi;
* don't use \1 in the replacement part of a substitution; use $1 instead
(\1 still works in some cases but is deprecated).
* don't need the & to call a function in general; this is Perl 5.
* Look up the /e switch to s/// in `perldoc perlop`
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Mon, 09 Jul 2001 10:54:01 -0700
From: Eric <nospam@xx.com>
Subject: Re: Array Sorting-Looping-Number Formatting
Message-Id: <3B49EFB9.6058EA2@xx.com>
Tad McClellan wrote:
> Is the "last line" of a record easy to identify?
First of all, THANK YOU so much for your kind willigness to provide such
great assistance to those of us who are "Programmingly Challenged".
You've given me some very helpful things to study and (hopefully) learn
from.
To answer your question: Unfortunately, no...which is part of the
problem.
>
> If so, I would suggest using only a single input operator, accumulate
> a record, then process the record when you recognize the end of the
> record:
You've given me a thought about something else to try tonight after I
scrutinize all possible appearances of the raw data file to be parsed.
> I trust that you are absolutely certain that none (except $addr) of
> those variables will ever have a comma in them?
Hmmm...good question. Two others *might* have a period from time to
time.
>
Gotta run to an appointment now but am going to print this off and
"chew" on EVERYTHING in advance of tonight's tweakings.
Thank you again, Tad.
Regards,
Eric
------------------------------
Date: Tue, 10 Jul 2001 17:34:49 -0500 (CDT)
From: dr0id-@webtv.net (dr0id)
Subject: Beginner to Perl
Message-Id: <20153-3B4B8309-33@storefull-228.iap.bryant.webtv.net>
Hello everyone. I know a lot of you have @webtv.net in your killfile
(lol its ok I understand) but I'm hoping someone will see this. I am
just getting started learning Perl and I'm looking for two things: A
"good" tutorial site and a book (one that even webtvers can understand
lol). Please email your response if you can but if not I'll check back
here in a bit. Thank you very much.
------------------------------
Date: Wed, 11 Jul 2001 00:46:33 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Beginner to Perl
Message-Id: <3B4BA1C4.B7523B2A@rochester.rr.com>
dr0id wrote:
>
> Hello everyone. I know a lot of you have @webtv.net in your killfile
> (lol its ok I understand) but I'm hoping someone will see this. I am
> just getting started learning Perl and I'm looking for two things: A
> "good" tutorial site and a book (one that even webtvers can understand
> lol). Please email your response if you can but if not I'll check back
> here in a bit. Thank you very much.
Well, that's easy:
http://www.perl.com/search/index.ncsp?sp-q=tutorials
Learning Perl (3rd Edition)
by Randal L. Schwartz, Tom Phoenix
O'Reilly & Associates; ISBN: 0596001320
Could be you'll have to settle for the 2nd edition if you want it
pronto.
--
Bob Walton
------------------------------
Date: Wed, 11 Jul 2001 10:30:20 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Beginner to Perl
Message-Id: <6tN27.9$BZ3.997@vic.nntp.telstra.net>
"dr0id" <dr0id-@webtv.net> wrote in message
news:20153-3B4B8309-33@storefull-228.iap.bryant.webtv.net...
> Hello everyone. I know a lot of you have @webtv.net in your killfile
> (lol its ok I understand) but I'm hoping someone will see this. I am
> just getting started learning Perl and I'm looking for two things: A
> "good" tutorial site and a book (one that even webtvers can understand
> lol). Please email your response if you can but if not I'll check back
> here in a bit. Thank you very much.
http://www.manning.com/Johnson/index.html
Can't praise this one highly enough, especially for the beginner.
Wyzelli
--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;
------------------------------
Date: Wed, 11 Jul 2001 06:38:44 GMT
From: gurm@intrasof.com (Smiley)
Subject: Re: Beginner to Perl
Message-Id: <3b4bf366.276228806@news1.on.sympatico.ca>
Try www.webmonkey.com - it's not an extremely great site for in-depth
Perl references, but a great starting point. They've got tons of
tutorials on programming and computer design topics, so it's a good
stop no matter what you're looking for.
As for bookwise, I chose 'PERL AND CGI FOR THE WORLD WIDE WEB' by
Elizabeth Castro. It's a good starter book and is relatively
inexpensive (Though I was disapointed that it didn't cover the CGI.pm
module, it's still a very good book to learn on)
That help?
On Tue, 10 Jul 2001 17:34:49 -0500 (CDT), dr0id-@webtv.net (dr0id)
wrote:
>Hello everyone. I know a lot of you have @webtv.net in your killfile
>(lol its ok I understand) but I'm hoping someone will see this. I am
>just getting started learning Perl and I'm looking for two things: A
>"good" tutorial site and a book (one that even webtvers can understand
>lol). Please email your response if you can but if not I'll check back
>here in a bit. Thank you very much.
>
------------------------------
Date: Tue, 10 Jul 2001 22:36:36 -0500 (CDT)
From: dr0id-@webtv.net (dr0id)
Subject: Re: Beginner to Perl
Message-Id: <4313-3B4BC9C4-19@storefull-226.iap.bryant.webtv.net>
Thank you very much! I will check those out.
dr0id
------------------------------
Date: Wed, 11 Jul 2001 14:23:59 +1000
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: Beginner to Perl
Message-Id: <YzQ27.90089$Rr4.146907@ozemail.com.au>
http://savage.net.au/Perl-tuts-1-30.html
--
Cheers
Ron Savage
ron@savage.net.au
http://savage.net.au/index.html
------------------------------
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 1271
***************************************