[17227] in Perl-Users-Digest
Perl-Users Digest, Issue: 4649 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 18 09:05:34 2000
Date: Wed, 18 Oct 2000 06:05:14 -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: <971874313-v9-i4649@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 18 Oct 2000 Volume: 9 Number: 4649
Today's topics:
Re: A Simpler perlish way <nickco3@yahoo.co.uk>
Re: Accessing methods created on the fly michaeljgardner@my-deja.com
CGI-script to act as a proxy julesgr@my-deja.com
Re: CGI-script to act as a proxy <mkuin@globalrangers.com>
Re: CGI::Push <bart.lateur@skynet.be>
Re: Convert Text to HTML <martin.quensel@lmf.ericsson.se>
Re: Create a copy of a variable nobull@mail.com
Getting '@hash{KEY1}{@KEYS2} = @VALUES2' to work (Bernard El-Hagin)
Getting column attributes using Win32::ODBC (Philip Lees)
Hexadecimal-to-Text (ASCII) converter <jean-claude.jehin.nospam@qsf.ericsson.se>
Re: Hexadecimal-to-Text (ASCII) converter (Gwyn Judd)
howto ftp with Socks Proxies <steve@datapost.co.za>
Re: Is perl object oriented? (Gwyn Judd)
Re: Is perl object oriented? (Randal L. Schwartz)
Java-Perl Lingo <jean-claude.jehin.nospam@qsf.ericsson.se>
linkcheck 1.04 released (Steven W McDougall)
mailq monitoring <kperlich@sydios.de>
Re: Make this regex neater, anyone? (Philip Lees)
Re: Make this regex neater, anyone? (Philip Lees)
Re: Make this regex neater, anyone? <uri@sysarch.com>
Re: Make this regex neater, anyone? <uri@sysarch.com>
Re: Make this regex neater, anyone? (Philip Lees)
Messageboard & Chat room tim.c@virgin.net
Re: Messageboard & Chat room <anthony@notsoevil.com>
MLDBM/DB_File, file size, deleting records <jihad.battikha@sharewire.com>
Re: multiple word command line arg (Soren Andersen)
Re: Newbie - Advise on getting a lock on a file <jihad.battikha@sharewire.com>
Perl + Sessions mack_2@my-deja.com
Pod::Tree 1.06 released (Steven W McDougall)
Re: question <bart.lateur@skynet.be>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 18 Oct 2000 10:55:04 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: A Simpler perlish way
Message-Id: <39ED7378.B0311B4B@yahoo.co.uk>
"Godzilla!" wrote:
> I am one of those who looks at a wheel and thinks,
>
> "There is probably a better way to do this."
What have you come up with?
------------------------------
Date: Wed, 18 Oct 2000 12:17:56 GMT
From: michaeljgardner@my-deja.com
Subject: Re: Accessing methods created on the fly
Message-Id: <8sk4dg$ko2$1@nnrp1.deja.com>
In article <8siqd5$le$0@206.230.71.67>,
"Frank" <frank@the.real.frank.com> wrote:
> <michaeljgardner@my-deja.com> wrote in message
> news:8siaen$6t2$1@nnrp1.deja.com...
> > I have a module that creates an object out of a database. Part of
the
> > code in the module creates methods (closures) to access the contents
of
> > a particular field by it's position in the string that makes up that
> > record of the database. This code creates the subroutines.
> >
> > # HEADERINFO CONTAINS INFO ABOUT THE FIELDS IN THE DATABASE WHICH
ARE
> > # KEYED BY THE FIELD NAME
> > foreach my $name (sort keys %headerinfo){
> >
> > # SUBROUTINE CREATED ON-THE-FLY, NAMED AFTER FIELD NAME
> > # $LINE IS PASSED TO THE SUBROUTINE WITH A RAW RECORD OF DATABASE
> > *$name = *{uc $name}=sub {my($line)=shift;
>
> Have you tried:
> *$name = *{'main::' . uc $name}=sub {my($line)=shift;
>
> Just adding 'main::' might fix it. This defines what package namespace
to
> drop the new sub in.
>
> hth,
>
> --
> $from = <$josiah>;
>
>
Frank,
I just slapped myself on the forehead. Had I not posted my problem, I'd
have been fiddling with @EXPORT for the next two weeks. I'll try adding
the main::,
Thanks,
Michael
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 18 Oct 2000 10:18:20 GMT
From: julesgr@my-deja.com
Subject: CGI-script to act as a proxy
Message-Id: <8sjtda$foc$1@nnrp1.deja.com>
Dear All,
At my girlfriend's work, they are using a proxy which prevents her from
accessing certain websites, including mail.yahoo.com. I would like to
set up my computer (my1.computer.com, we'll call it), which is
accessible to her, as a sort of secondary proxy to get round this
restriction. What I need is a cgi script (let's call it proxyparser)
which is invoked by her request:
http://my1.computer.com/cgi-bin/proxyparser?http://mail.yahoo.com. The
script requests the page from mail.yahoo.com, parses it to change all
the links within it to "http://my1.computer.com/cgi-bin/proxyparser?"
followed by the link, and then sends this page back to my girlfriend. It
would also have to deal with cookies.
Does anyone know of such a script or a cleverer way of doing this?
Best wishes,
Jules
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 18 Oct 2000 12:36:27 +0200
From: "Mark Kuin" <mkuin@globalrangers.com>
Subject: Re: CGI-script to act as a proxy
Message-Id: <8sjuj1$4l3$1@news1.xs4all.nl>
A cleverer way is asking your girlfriend to switch jobs.
<julesgr@my-deja.com> wrote in message news:8sjtda$foc$1@nnrp1.deja.com...
> Dear All,
>
> At my girlfriend's work, they are using a proxy which prevents her from
> accessing certain websites, including mail.yahoo.com. I would like to
> set up my computer (my1.computer.com, we'll call it), which is
> accessible to her, as a sort of secondary proxy to get round this
> restriction. What I need is a cgi script (let's call it proxyparser)
> which is invoked by her request:
> http://my1.computer.com/cgi-bin/proxyparser?http://mail.yahoo.com. The
> script requests the page from mail.yahoo.com, parses it to change all
> the links within it to "http://my1.computer.com/cgi-bin/proxyparser?"
> followed by the link, and then sends this page back to my girlfriend. It
> would also have to deal with cookies.
>
> Does anyone know of such a script or a cleverer way of doing this?
> Best wishes,
> Jules
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Wed, 18 Oct 2000 09:56:21 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: CGI::Push
Message-Id: <ijsqusokjib8v7tgm2b6c4hgd1crh003bb@4ax.com>
Jerry Linch wrote:
>----------------------------------1621093750000000 Content-type: text/html
>
>and this at the end of the page:
>
>----------------------------------1621093750000000
>
>The exact string of numbers changes each time I access the page.
>
>These don't appear in Netscape. Given what I've seen here, I'm not overly
>optimistic about this next, but: Is there a way to get rid of the extra
>"header" and "footer" information in IE 5.5?
Er... that is the thing that makes it work! This is a string that may
NOT appear in whatever your produce as contents, and which actually
separates the parts. Without it, you don't have anything multipart.
Look at a raw mail message in MIME format. You'll see the same thing
there.
Except for one thing: the content-type subheader should appear on a line
of it's own. I think that it is, but that IE shows it like it shows
html: the lines concatenated with a space between them.
So, all this makes me think that Server Push simply doesn't work on IE.
I bet it's a MS trick to make a Netscape technology "uninteresting".
--
Bart.
------------------------------
Date: Wed, 18 Oct 2000 14:13:04 +0300
From: Martin Quensel <martin.quensel@lmf.ericsson.se>
Subject: Re: Convert Text to HTML
Message-Id: <39ED85C0.74788160@lmf.ericsson.se>
Ian Boreham wrote:
> Peter Sundstrom wrote:>
>
> >> > Well, for one thing, the plain text file might contain things like the
> >> > "<" and ">" symbols, and these mean something in HTML. So, they'll
> >> > need to be escaped.
> >>
> >> Not using the example above. cat will not interpret any special characters.
> >
> >But the browser will. It is not a problem with cat. If the text file contained
> >something like:
>
> >1 < 2
>
> >5 > 4
>
> >...then the browser is going to try to turn < 2\n\n5 > into a tag. These
> >characters and also ampersands need to be escaped.
Then instead of using <pre>, use <xmp>.
<xmp>
<h1>blasdjljla</h1>
</xmp>
Best Regards
Martin Quensel
------------------------------
Date: 18 Oct 2000 08:43:07 +0100
From: nobull@mail.com
To: Daniel Jones <ddjones@speakeasy.org>
Subject: Re: Create a copy of a variable
Message-Id: <u9g0luy237.fsf@wcl-l.bham.ac.uk>
Daniel Jones <ddjones@speakeasy.org> writes:
> This syntax:
>
> ${@$Instructors}[$i]
>
> was a bit tricky, but I got it.
The above syntax is not valid Perl. Due to a bug in current versions
of perl the spurious @ is silently ignored[1] but in future versions this
bug may get fixed.
[1] Although I've heard that in some circumtances it can lead to an
internal reference count error within the interpreter.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 18 Oct 2000 13:00:07 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Getting '@hash{KEY1}{@KEYS2} = @VALUES2' to work
Message-Id: <slrn8ur7ol.28m.bernard.el-hagin@gdndev25.lido-tech>
Hi,
I'm trying to get a hash slice to work, but can't. A 'normal' hash
slice goes like so:
@hash{@keys} = @values;
and that works just fine, but what I need is something like this:
@hash{key1}{@keys2} = @values2;
When I try to run something like that I get:
Scalar value @h{$_} better written as $h{$_} at ./SSIMfilter.pl line
212.
Line 212: @h{$_}{@fields} = /$fields/x;
The regex is not the culprit since this:
@h{@fields} = /$fields/x;
works just fine.
Is there any way to get this to work properly?
Thanks.
Cheers,
Bernard
--
perl -le'
($B,$e,$r,$n,$a,$r,$d)=q=$B$e$r$n$a$r$d==~m;
\$(.);xg;print$B.$e.$r.$n.$a.$r.$d;'
------------------------------
Date: Wed, 18 Oct 2000 12:03:51 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Getting column attributes using Win32::ODBC
Message-Id: <39ed9085.82182642@news.grnet.gr>
Win32::ODBC provides the ColAttributes method, called as follows,
according to the docs:
ColAttributes ( ATTRIBUTE [, FIELD_NAMES ] )
I want to use this to find out whether a particular column in a Sybase
Adaptive Server table is of type bit or not. I've tried calling the
method with
my $field_type = $db->ColAttributes ( ODBC::SQL_COLUMN_TYPE,
$field_name );
I've also tried various small integers as the ATTRIBUTE part.
Whatever I do, the return value is just the column name. Can anyone
tell me what I'm doing wrong?
TIA
Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer
------------------------------
Date: Wed, 18 Oct 2000 11:21:27 +0200
From: Jean-Claude JEHIN <jean-claude.jehin.nospam@qsf.ericsson.se>
Subject: Hexadecimal-to-Text (ASCII) converter
Message-Id: <39ED6B97.65E062C9@qsf.ericsson.se>
Hello,
Is anybody know where can I find the PERL solution for Hex-to-Text
(ASCII) conversion?
Would you, please, be so kind to send the copy of your answer on the
following address:
Tomislav.sodan@esf.ericsson.se
Thanks in advance
Best Regards
///tommy
------------------------------
Date: Wed, 18 Oct 2000 12:41:21 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Hexadecimal-to-Text (ASCII) converter
Message-Id: <slrn8ur6je.58b.tjla@thislove.dyndns.org>
I was shocked! How could Jean-Claude JEHIN <jean-claude.jehin.nospam@qsf.ericsson.se>
say such a terrible thing:
>Hello,
>Is anybody know where can I find the PERL solution for Hex-to-Text
>(ASCII) conversion?
The answer to your homework is in:
perldoc -f chr
>Would you, please, be so kind to send the copy of your answer on the
>following address:
uhhh no
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
There's an old proverb that says just about whatever you want it to.
------------------------------
Date: Wed, 18 Oct 2000 09:55:03 +0200
From: "Steve Ronald" <steve@datapost.co.za>
Subject: howto ftp with Socks Proxies
Message-Id: <39ed5832$0$231@hades.is.co.za>
Hi all,
Does anybody know how I would connect to an ftp server through a socks proxy
in Perl?
Any example code out there I could look at?
Thanx
Steve
------------------------------
Date: Wed, 18 Oct 2000 12:46:54 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Is perl object oriented?
Message-Id: <slrn8ur6tq.58b.tjla@thislove.dyndns.org>
I was shocked! How could Jerome O'Neil <jerome@activeindexing.com>
say such a terrible thing:
>John Golubenko <java@dashmail.net> elucidates:
>> First before you try to fool someone....
>> do you know Java? Did you wrote any application in Java?
>
>Yep. And I cant figure out why I can't call methods
>on int, float, char or any other primitive.
>
>Now why is that?
I'm not sure I understand you. In Perl I can't call methods on a
variable that has not been bless()'ed into some class either. Not that I
care much either way, personally I don't much love OO. Gonna stop now
anyway, I really don't want to get into a flame war :)
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
"See yourself for what you are, not what others try to make you."
-- Aldous Gajic (to Jinxo), "Grail"
------------------------------
Date: 18 Oct 2000 06:04:44 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Is perl object oriented?
Message-Id: <m1r95euwpf.fsf@halfdome.holdit.com>
>>>>> "Gwyn" == Gwyn Judd <tjla@guvfybir.qlaqaf.bet> writes:
Gwyn> I was shocked! How could Jerome O'Neil <jerome@activeindexing.com>
Gwyn> say such a terrible thing:
>> John Golubenko <java@dashmail.net> elucidates:
>>> First before you try to fool someone....
>>> do you know Java? Did you wrote any application in Java?
>>
>> Yep. And I cant figure out why I can't call methods
>> on int, float, char or any other primitive.
>>
>> Now why is that?
Gwyn> I'm not sure I understand you. In Perl I can't call methods on a
Gwyn> variable that has not been bless()'ed into some class either. Not that I
Gwyn> care much either way, personally I don't much love OO. Gonna stop now
Gwyn> anyway, I really don't want to get into a flame war :)
Going back to the original message which triggered the off-the-wall
response, I said that Perl and Java were both hybrid-OO (some
user-visible things are objects, others aren't), while Smalltalk was
pure-OO (all user-visible things are objects, permitting method calls,
subclassing, and extending).
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 18 Oct 2000 11:17:29 +0200
From: Jean-Claude JEHIN <jean-claude.jehin.nospam@qsf.ericsson.se>
Subject: Java-Perl Lingo
Message-Id: <39ED6AA9.AD3AA666@qsf.ericsson.se>
Hello,
Can anybody help me and tell me where can I find some detail information
about the
Java-Perl Lingo or about the JPerl.
Would you be so kind to answer me on the following address :
Tomislav.Sodan@esf.ericsson.se
Thanks in advance for your help.
Best Regards
///tommy
------------------------------
Date: Wed, 18 Oct 2000 04:20:46 GMT
From: world!swmcd@uunet.uu.net (Steven W McDougall)
Subject: linkcheck 1.04 released
Message-Id: <sur5i1j9of5d24@corp.supernews.com>
linkcheck 1.04 has been released to CPAN.
>From the POD
=head1 NAME
B<linkcheck> - check the links on an HTML page
=head1 SYNOPSIS
B<linkcheck>
[B<--Help>]
[B<--Man>]
[B<--authorization> B<-> | B<*> | [I<scheme>]://I<authority>[:I<realm>] ]...
[B<--null-frags>]
[B<--offsite>]
[B<-->[B<no>]B<parent>]
[B<--recurse>]
[B<-->[B<no>]B<scheme>]
[B<--twiddle> I<level>]
[B<--verbosity> I<level>]
I<URI> ...
=head1 DESCRIPTION
B<linkcheck> reads the web pages at I<URI> ...,
and checks the existence of any links that it finds there.
=head1 CHANGES
=head2 1.04
=over 4
=item *
Added B<--authorization> option
=back
For some background on the program, see
<http://world.std.com/~swmcd/steven/perl/pm/lc/linkcheck.html>
- SWM
------------------------------
Date: Wed, 18 Oct 2000 11:02:28 +0200
From: Karsten Perlich <kperlich@sydios.de>
Subject: mailq monitoring
Message-Id: <39ED6724.AB2700C7@sydios.de>
Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------2B8B16255505E7C52762BE26
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi folks,
I want to monitor the mail-queue of a remote system. To see how long the
mailq is, something like the response of "mailq | head -1 | cut -f2
-d'(' | cut -f1 d' '" shot end in a local variable of my perl-script.
Thanks for any (quick) help
Karsten
--------------2B8B16255505E7C52762BE26
Content-Type: text/x-vcard; charset=us-ascii;
name="kperlich.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Visitenkarte für Karsten Perlich
Content-Disposition: attachment;
filename="kperlich.vcf"
begin:vcard
n:Perlich;Karsten
tel;cell:+49 170 586 38 76
tel;work:+49 30 80944 832
x-mozilla-html:FALSE
org:sydios itsolutions
adr:;;Fasanenstr. 7-8;10623 Berlin;;;
version:2.1
email;internet:kperlich@sydios.de
x-mozilla-cpt:;-18960
fn:Perlich
end:vcard
--------------2B8B16255505E7C52762BE26--
------------------------------
Date: Wed, 18 Oct 2000 07:30:36 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: Make this regex neater, anyone?
Message-Id: <39ed5027.65704548@news.grnet.gr>
On Tue, 17 Oct 2000 09:24:19 GMT, rgarciasuarez@free.fr (Rafael
Garcia-Suarez) wrote:
>$_ = 'IDT1PAT1ADM12ECG5';
>($x) = /(\D+)\d*$/;
>
>-> $x contains 'ECG'
Thanks to you and others who provided answers. I'm not clear about the
parentheses around the $x - obviously the matched string, rather than
the success or failure of the match, is assigned to $x, but what is
the logic behind this?
Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer
------------------------------
Date: Wed, 18 Oct 2000 07:38:46 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: Make this regex neater, anyone?
Message-Id: <39ed533d.66494934@news.grnet.gr>
On Tue, 17 Oct 2000 20:52:08 -0000, cberry@cinenet.net (Craig Berry)
wrote:
>Philip Lees (pjlees@ics.forthcomingevents.gr) wrote:
>: Hi. I have strings of the form
>:
>: IDT1PAT1ADM12ECG5
>:
>: and I need to extract the _last_ group of letters - ECG in the above
>: example. The regex also needs to handle the simplest case, i.e. IDT4
>: gives IDT.
>
> $lastNonDigits = ($str =~ m/\D+/g)[-1];
Thanks, Craig. That's neat. Could you explain the significance of the
[-1] to this learner? I can't find any mention of that syntax in
perlre.
Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer
------------------------------
Date: Wed, 18 Oct 2000 07:44:24 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Make this regex neater, anyone?
Message-Id: <x7hf6asief.fsf@home.sysarch.com>
>>>>> "PL" == Philip Lees <pjlees@ics.forthcomingevents.gr> writes:
PL> On Tue, 17 Oct 2000 09:24:19 GMT, rgarciasuarez@free.fr (Rafael
PL> Garcia-Suarez) wrote:
>> $_ = 'IDT1PAT1ADM12ECG5';
>> ($x) = /(\D+)\d*$/;
>>
-> $x contains 'ECG'
PL> Thanks to you and others who provided answers. I'm not clear about the
PL> parentheses around the $x - obviously the matched string, rather than
PL> the success or failure of the match, is assigned to $x, but what is
PL> the logic behind this?
it provides a list context to the regex which makes it return the
grabbed strings instead of the boolean success/fail
perldoc perlre
read, lather, rinse, repeat.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Wed, 18 Oct 2000 07:46:57 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Make this regex neater, anyone?
Message-Id: <x7em1esia6.fsf@home.sysarch.com>
>>>>> "PL" == Philip Lees <pjlees@ics.forthcomingevents.gr> writes:
PL> On Tue, 17 Oct 2000 20:52:08 -0000, cberry@cinenet.net (Craig Berry)
PL> wrote:
>> Philip Lees (pjlees@ics.forthcomingevents.gr) wrote:
>> : Hi. I have strings of the form
>> :
>> : IDT1PAT1ADM12ECG5
>> :
>> : and I need to extract the _last_ group of letters - ECG in the above
>> : example. The regex also needs to handle the simplest case, i.e. IDT4
>> : gives IDT.
>>
>> $lastNonDigits = ($str =~ m/\D+/g)[-1];
PL> Thanks, Craig. That's neat. Could you explain the significance of the
PL> [-1] to this learner? I can't find any mention of that syntax in
PL> perlre.
you're not doing well finding things. that doesn't have anything to do
with regexes directly. the ()[] is again providing a list context to the
regex and indexing off of that list. -1 is the last element of an array
index so you get the last matched nondigit string.
perldoc perldata
read, lather, rinse, repeat.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Wed, 18 Oct 2000 11:56:46 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: Make this regex neater, anyone?
Message-Id: <39ed8ef9.81786652@news.grnet.gr>
On Wed, 18 Oct 2000 07:46:57 GMT, Uri Guttman <uri@sysarch.com> wrote:
> >> $lastNonDigits = ($str =~ m/\D+/g)[-1];
>
> PL> Thanks, Craig. That's neat. Could you explain the significance of the
> PL> [-1] to this learner? I can't find any mention of that syntax in
> PL> perlre.
>
>you're not doing well finding things. that doesn't have anything to do
>with regexes directly. the ()[] is again providing a list context to the
>regex and indexing off of that list. -1 is the last element of an array
>index so you get the last matched nondigit string.
Thanks for this and your other answer in this thread, uri. Things make
more sense now.
I have learned to appreciate the richness of the docs and I did go
there before I posted. However, trying to search them for things like
() and [] could turn out to be a lifetime occupation.
Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer
------------------------------
Date: Wed, 18 Oct 2000 12:13:39 GMT
From: tim.c@virgin.net
Subject: Messageboard & Chat room
Message-Id: <8sk45f$kdt$1@nnrp1.deja.com>
I have just begun to build a web page for my old school and having
spoken to several people familiar with the language, I have been
recommeneded PERL as the one to go with to write scripts to produce a
messageboard and a chat room.
Has anyone got any ideas they could offer / URLS / etc to help me go
about doing this as I'm pretty new to PERL and to be honest, anything
other than pure HTML
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 18 Oct 2000 12:35:16 GMT
From: Anthony Bouvier <anthony@notsoevil.com>
Subject: Re: Messageboard & Chat room
Message-Id: <393E40C6.C7C82D42@notsoevil.com>
http://www.everysoft.com
i believe they have a message board and chat script available for free. they
are generic, but they can be modified.
--
anthony bouvier
notsoevil philosopher
--
------------------------------
Date: Wed, 18 Oct 2000 04:17:14 -0400
From: Jihad Battikha <jihad.battikha@sharewire.com>
Subject: MLDBM/DB_File, file size, deleting records
Message-Id: <39ED5C8A.34D6E258@sharewire.com>
[I posted this 12 hours ago to c.l.p.moderated but <grumble> it still
hasn't shown up there.]
To my understanding, deleting records from a DB_File (Berkeley) based
database will not automatically reclaim unused space ("holes") and
although some file systems don't count that space as part of the file
size, others do. From the various information I've found, the only
solution recommended so far is to loop through the entire database and
re-write the data to a new file. That's fine for small files but seems
awfully inefficient for large (> 10MB) files, especially if the
filereaches a predetermined max and is constantly fluctuating near that
max.
Is there a "better" way to do this than re-writing the entirety of data
to a new fine every now and then? A better way to reclaim the unused
space? A solution will have to be destributable, able to be run on
hosted solutions - meaning, I can't depend on a custom build of Perl,
specific file system, or some such similar thing. All I can depend on
is the availability of MLDBM and DB_file. Ideas?
--
Jihad Battikha <jihad.battikha@sharewire.com>
Sharewire, Inc. --- http://www.sharewire.com/
- Free forms, programs, and content for web sites.
- No assembly required.
Disclaimer:
Before sending me commercial e-mail, the sender must first agree
to my LEGAL NOTICE located at: http://www.highsynth.com/sig.html
------------------------------
Date: 18 Oct 2000 09:12:46 GMT
From: soren@spmfoiler.removethat.wonderstorm.com (Soren Andersen)
Subject: Re: multiple word command line arg
Message-Id: <8sjpie$dc8$2@slb1.atl.mindspring.net>
rathi_sk@my-deja.com (rathi_sk) wrote in <8rd16h$vl0$1@nnrp1.deja.com>:
>Hi
>
>i am new to perl. I was parsing command line args with GetOptions()
>(use Getopt:Long;).
>
>GetOptions("instType=s" => \$instType,
> "euro" => \$euro,
> "country:s" => \$country);
>
>now when i call the script
>
>perl /export/home/dd/bin/refresh.pl --instType "dummy one" --euro --
>country US
>
>It treates the instType as "dummy.
>
>When i tried
>perl /export/home/dd/bin/refresh.pl --instType 'dummy one' --euro --
>country US
>
>It gives instType as 'dummy.
It would probably help if you told us what shell you are using. OTOH I
personally probably cannot be of much help because I am running Perl on 'doze,
so I can't try out command lines using any UNI*-like quoting that you show me.
All I can say for sure is that I use Getopt::Long in my scripts and it works
great.
Good luck,
soren
------------------------------
Date: Wed, 18 Oct 2000 04:42:57 -0400
From: Jihad Battikha <jihad.battikha@sharewire.com>
Subject: Re: Newbie - Advise on getting a lock on a file
Message-Id: <39ED6291.26EF5DC0@sharewire.com>
Jon Bell wrote:
> Is there some reason why you can't use the 'flock' function that is built
> into Perl? If you don't know about 'flock', give the command 'perldoc -f
> flock' at your command prompt if you have Perl installed on your
> computer; otherwise look through the online docs at http://www.perl.com/ .
flock() might not be available on his OS and using an external lock file
might be his only option.
Anyway, to answer Robert's question without making assumptions regarding
his OS:
Set up a timestamp and a maximum lock age for the lock file. Then, when
writing out the file, print the timestamp and maximum age into the file
and have the guestbook check that data to see whether the lock is an
actual lock or a stale file leftover from a problem with a previous
guestbook execution. If it's a legit lockfile, wait a bit until it's
gone and if it's stale then delete it and create a new lock file.
That's probably good enough for a low-volume web site.
--
Jihad Battikha <jihad.battikha@sharewire.com>
Sharewire, Inc. --- http://www.sharewire.com/
- Free forms, programs, and content for web sites.
- No assembly required.
Disclaimer:
Before sending me commercial e-mail, the sender must first agree
to my LEGAL NOTICE located at: http://www.highsynth.com/sig.html
------------------------------
Date: Wed, 18 Oct 2000 11:33:13 GMT
From: mack_2@my-deja.com
Subject: Perl + Sessions
Message-Id: <8sk1pp$ikm$1@nnrp1.deja.com>
i've tried to find some docs about session with perl, but i didn't find
any information.
so, does somebody know, whether perl support sessions, like php and asp
this do
thx.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 18 Oct 2000 04:13:18 GMT
From: world!swmcd@uunet.uu.net (Steven W McDougall)
Subject: Pod::Tree 1.06 released
Message-Id: <sur5hint64eu1e@corp.supernews.com>
Pod::Tree 1.06 has been released to CPAN.
>From the README file:
Pod::Tree - Tree-based POD parser
Modules
Pod::Tree parses a POD into a static syntax tree.
Applications walk the tree to recover the structure and content of
the POD.
Pod::Tree::HTML walks a Pod::Tree and translates it to HTML.
Pod::Tree::Pod walks a Pod::Tree and translates it back to POD.
Pod::Tree::Perl* translate the PODs in the Perl distribution to HTML.
Executables
pod2html translates a POD file to an HTML file.
pods2html walks a directory tree,
translates all the PODs that it finds into HTML files,
and puts the HTML files into a parallel directory tree.
perl2html translates the PODs in the Perl distribution to HTML
>From the Changes file:
1.06 2000 Oct 17
Added Pod::Tree::Pod
Pod::Tree::Node
- fixed SpitBar()
- SWM
------------------------------
Date: Wed, 18 Oct 2000 07:17:16 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: question
Message-Id: <qhjqus0uin2t88bra5mo16ut0henohc0fd@4ax.com>
mexicanmeatballs@my-deja.com wrote:
>"$." is however harder to read than $INPUT_LINE_NUMBER, surely
>everyone agrees with that? I don't believe that anyone thinks it's
>generally good practice to name variables with punctuation.
Because it's easier to WRITE. If you can remember the name, you remember
it correctly. I'll try to retype the English name from memory:
$INPU_LINENUMBER
Did I get it right? No.
That's why I perfer to write $. .
--
Bart.
------------------------------
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 4649
**************************************