[23031] in Perl-Users-Digest
Perl-Users Digest, Issue: 5251 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 21 14:10:42 2003
Date: Mon, 21 Jul 2003 11:10:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 21 Jul 2003 Volume: 10 Number: 5251
Today's topics:
push -- weird problem <butt-fuzz@ass.wipe.com>
Re: push -- weird problem <domenico_discepola@quadrachemicals.com>
Re: push -- weird problem <emschwar@pobox.com>
Re: push -- weird problem <butt-fuzz@ass.wipe.com>
Re: push -- weird problem <emschwar@pobox.com>
Re: s there a module to acess Micorsoft Access datafile <wsegrave@mindspring.com>
Re: s there a module to acess Micorsoft Access datafile <wsegrave@mindspring.com>
See y'all in Paris? YAPC::Europe::2003 <nobull@mail.com>
Re: Statistics for comp.lang.perl.misc <grazz@pobox.com>
Re: Statistics for comp.lang.perl.misc <abigail@abigail.nl>
Re: Statistics for comp.lang.perl.misc <grazz@pobox.com>
Re: stripping characters from xml files (Tad McClellan)
Using SMTP through a proxy server <member17678@dbforums.com>
Variable reference (Par)
Re: Variable reference <pinyaj@rpi.edu>
Re: <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 21 Jul 2003 13:37:47 -0400
From: butt-fuzz <butt-fuzz@ass.wipe.com>
Subject: push -- weird problem
Message-Id: <3F1C24EB.47996DC9@ass.wipe.com>
i got a weird problem with push.
for ($x=1;$x<=12;$x++){
$sysDateLoop=`/usr/bin/cal $x 2003`;
push @sysDate, $sysDateLoop;
}
$sysDate=join '##--Month-Break--##', @sysDate;
this will produce jan, feb...dec. cals.
I tried a more lazy approach and I get weridness.
for ($x=1;$x<=12;$x++){
push @sysDate `/usr/bin/cal $x 2003`;
}
$sysDate=join '##--Month-Break--##', @sysDate;
look at this:
January 2003
##--Month-Break--##Su Mo Tu We Th Fr Sa
##--Month-Break--## 1 2 3 4
##--Month-Break--## 5 6 7 8 9 10 11
##--Month-Break--##12 13 14 15 16 17 18
##--Month-Break--##19 20 21 22 23 24 25
##--Month-Break--##26 27 28 29 30 31
##--Month-Break--##
##--Month-Break--## February 2003
##--Month-Break--##Su Mo Tu We Th Fr Sa
##--Month-Break--## 1
##--Month-Break--## 2 3 4 5 6 7 8
##--Month-Break--## 9 10 11 12 13 14 15
##--Month-Break--##16 17 18 19 20 21 22
##--Month-Break--##23 24 25 26 27 28
##--Month-Break--##
##--Month-Break--## March 2003
##--Month-Break--##Su Mo Tu We Th Fr Sa
##--Month-Break--## 1
##--Month-Break--## 2 3 4 5 6 7 8
##--Month-Break--## 9 10 11 12 13 14 15
##--Month-Break--##16 17 18 19 20 21 22
##--Month-Break--##23 24 25 26 27 28 29
##--Month-Break--##30 31
##--Month-Break--## April 2003
##--Month-Break--##Su Mo Tu We Th Fr Sa
##--Month-Break--## 1 2 3 4 5
##--Month-Break--## 6 7 8 9 10 11 12
##--Month-Break--##13 14 15 16 17 18 19
##--Month-Break--##20 21 22 23 24 25 26
##--Month-Break--##27 28 29 30
##--Month-Break--##
##--Month-Break--## May 2003
##--Month-Break--##Su Mo Tu We Th Fr Sa
##--Month-Break--## 1 2 3
##--Month-Break--## 4 5 6 7 8 9 10
##--Month-Break--##11 12 13 14 15 16 17
##--Month-Break--##18 19 20 21 22 23 24
##--Month-Break--##25 26 27 28 29 30 31
##--Month-Break--##
##--Month-Break--## June 2003
##--Month-Break--##Su Mo Tu We Th Fr Sa
##--Month-Break--## 1 2 3 4 5 6 7
##--Month-Break--## 8 9 10 11 12 13 14
##--Month-Break--##15 16 17 18 19 20 21
##--Month-Break--##22 23 24 25 26 27 28
##--Month-Break--##29 30
##--Month-Break--##
##--Month-Break--## July 2003
##--Month-Break--##Su Mo Tu We Th Fr Sa
##--Month-Break--## 1 2 3 4 5
##--Month-Break--## 6 7 8 9 10 11 12
##--Month-Break--##13 14 15 16 17 18 19
##--Month-Break--##20 21 22 23 24 25 26
##--Month-Break--##27 28 29 30 31
##--Month-Break--##
##--Month-Break--## August 2003
##--Month-Break--##Su Mo Tu We Th Fr Sa
##--Month-Break--## 1 2
##--Month-Break--## 3 4 5 6 7 8 9
##--Month-Break--##10 11 12 13 14 15 16
##--Month-Break--##17 18 19 20 21 22 23
##--Month-Break--##24 25 26 27 28 29 30
##--Month-Break--##31
##--Month-Break--## September 2003
##--Month-Break--##Su Mo Tu We Th Fr Sa
##--Month-Break--## 1 2 3 4 5 6
##--Month-Break--## 7 8 9 10 11 12 13
##--Month-Break--##14 15 16 17 18 19 20
##--Month-Break--#21 22 23 24 25 26 27
##--Month-Break--##28 29 30
##--Month-Break--##
##--Month-Break--## October 2003
##--Month-Break--##Su Mo Tu We Th Fr Sa
##--Month-Break--## 1 2 3 4
##--Month-Break--## 5 6 7 8 9 10 11
##--Month-Break--##12 13 14 15 16 17 18
##--Month-Break--##19 20 21 22 23 24 25
##--Month-Break--##26 27 28 29 30 31
##--Month-Break--##
##--Month-Break--## November 2003
##--Month-Break--##Su Mo Tu We Th Fr Sa
##--Month-Break--## 1
##--Month-Break--## 2 3 4 5 6 7 8
##--Month-Break--## 9 10 11 12 13 14 15
##--Month-Break--##16 17 18 19 20 21 22
##--Month-Break--##23 24 25 26 27 28 29
##--Month-Break--##30
##--Month-Break--## December 2003
##--Month-Break--##Su Mo Tu We Th Fr Sa
##--Month-Break--## 1 2 3 4 5 6
##--Month-Break--## 7 8 9 10 11 12 13
##--Month-Break--##14 15 16 17 18 19 20
##--Month-Break--#21 22 23 24 25 26 27
##--Month-Break--##28 29 30 31
##--Month-Break--##
--
If it doesn't work, plug it in.
If you're still having trouble, switch it on.
------------------------------
Date: Mon, 21 Jul 2003 13:45:53 -0400
From: "Domenico Discepola" <domenico_discepola@quadrachemicals.com>
Subject: Re: push -- weird problem
Message-Id: <MHVSa.44447$PD3.4474297@nnrp1.uunet.ca>
If I interpret the goal of your program correctly & at the risk of not
answering your question ;-), have you looked at the Date::PCalc module?
"butt-fuzz" <butt-fuzz@ass.wipe.com> wrote in message
news:3F1C24EB.47996DC9@ass.wipe.com...
> i got a weird problem with push.
>
>
> for ($x=1;$x<=12;$x++){
> $sysDateLoop=`/usr/bin/cal $x 2003`;
> push @sysDate, $sysDateLoop;
> }
> $sysDate=join '##--Month-Break--##', @sysDate;
> this will produce jan, feb...dec. cals.
>
>
> I tried a more lazy approach and I get weridness.
> for ($x=1;$x<=12;$x++){
> push @sysDate `/usr/bin/cal $x 2003`;
> }
> $sysDate=join '##--Month-Break--##', @sysDate;
>
> look at this:
> January 2003
> ##--Month-Break--##Su Mo Tu We Th Fr Sa
> ##--Month-Break--## 1 2 3 4
> ##--Month-Break--## 5 6 7 8 9 10 11
> ##--Month-Break--##12 13 14 15 16 17 18
> ##--Month-Break--##19 20 21 22 23 24 25
> ##--Month-Break--##26 27 28 29 30 31
> ##--Month-Break--##
> ##--Month-Break--## February 2003
> ##--Month-Break--##Su Mo Tu We Th Fr Sa
> ##--Month-Break--## 1
> ##--Month-Break--## 2 3 4 5 6 7 8
> ##--Month-Break--## 9 10 11 12 13 14 15
> ##--Month-Break--##16 17 18 19 20 21 22
> ##--Month-Break--##23 24 25 26 27 28
> ##--Month-Break--##
> ##--Month-Break--## March 2003
> ##--Month-Break--##Su Mo Tu We Th Fr Sa
> ##--Month-Break--## 1
> ##--Month-Break--## 2 3 4 5 6 7 8
> ##--Month-Break--## 9 10 11 12 13 14 15
> ##--Month-Break--##16 17 18 19 20 21 22
> ##--Month-Break--##23 24 25 26 27 28 29
> ##--Month-Break--##30 31
> ##--Month-Break--## April 2003
> ##--Month-Break--##Su Mo Tu We Th Fr Sa
> ##--Month-Break--## 1 2 3 4 5
> ##--Month-Break--## 6 7 8 9 10 11 12
> ##--Month-Break--##13 14 15 16 17 18 19
> ##--Month-Break--##20 21 22 23 24 25 26
> ##--Month-Break--##27 28 29 30
> ##--Month-Break--##
> ##--Month-Break--## May 2003
> ##--Month-Break--##Su Mo Tu We Th Fr Sa
> ##--Month-Break--## 1 2 3
> ##--Month-Break--## 4 5 6 7 8 9 10
> ##--Month-Break--##11 12 13 14 15 16 17
> ##--Month-Break--##18 19 20 21 22 23 24
> ##--Month-Break--##25 26 27 28 29 30 31
> ##--Month-Break--##
> ##--Month-Break--## June 2003
> ##--Month-Break--##Su Mo Tu We Th Fr Sa
> ##--Month-Break--## 1 2 3 4 5 6 7
> ##--Month-Break--## 8 9 10 11 12 13 14
> ##--Month-Break--##15 16 17 18 19 20 21
> ##--Month-Break--##22 23 24 25 26 27 28
> ##--Month-Break--##29 30
> ##--Month-Break--##
> ##--Month-Break--## July 2003
> ##--Month-Break--##Su Mo Tu We Th Fr Sa
> ##--Month-Break--## 1 2 3 4 5
> ##--Month-Break--## 6 7 8 9 10 11 12
> ##--Month-Break--##13 14 15 16 17 18 19
> ##--Month-Break--##20 21 22 23 24 25 26
> ##--Month-Break--##27 28 29 30 31
> ##--Month-Break--##
> ##--Month-Break--## August 2003
> ##--Month-Break--##Su Mo Tu We Th Fr Sa
> ##--Month-Break--## 1 2
> ##--Month-Break--## 3 4 5 6 7 8 9
> ##--Month-Break--##10 11 12 13 14 15 16
> ##--Month-Break--##17 18 19 20 21 22 23
> ##--Month-Break--##24 25 26 27 28 29 30
> ##--Month-Break--##31
> ##--Month-Break--## September 2003
> ##--Month-Break--##Su Mo Tu We Th Fr Sa
> ##--Month-Break--## 1 2 3 4 5 6
> ##--Month-Break--## 7 8 9 10 11 12 13
> ##--Month-Break--##14 15 16 17 18 19 20
> ##--Month-Break--#21 22 23 24 25 26 27
> ##--Month-Break--##28 29 30
> ##--Month-Break--##
> ##--Month-Break--## October 2003
> ##--Month-Break--##Su Mo Tu We Th Fr Sa
> ##--Month-Break--## 1 2 3 4
> ##--Month-Break--## 5 6 7 8 9 10 11
> ##--Month-Break--##12 13 14 15 16 17 18
> ##--Month-Break--##19 20 21 22 23 24 25
> ##--Month-Break--##26 27 28 29 30 31
> ##--Month-Break--##
> ##--Month-Break--## November 2003
> ##--Month-Break--##Su Mo Tu We Th Fr Sa
> ##--Month-Break--## 1
> ##--Month-Break--## 2 3 4 5 6 7 8
> ##--Month-Break--## 9 10 11 12 13 14 15
> ##--Month-Break--##16 17 18 19 20 21 22
> ##--Month-Break--##23 24 25 26 27 28 29
> ##--Month-Break--##30
> ##--Month-Break--## December 2003
> ##--Month-Break--##Su Mo Tu We Th Fr Sa
> ##--Month-Break--## 1 2 3 4 5 6
> ##--Month-Break--## 7 8 9 10 11 12 13
> ##--Month-Break--##14 15 16 17 18 19 20
> ##--Month-Break--#21 22 23 24 25 26 27
> ##--Month-Break--##28 29 30 31
> ##--Month-Break--##
>
>
> --
>
>
>
>
> If it doesn't work, plug it in.
> If you're still having trouble, switch it on.
------------------------------
Date: Mon, 21 Jul 2003 11:56:47 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: push -- weird problem
Message-Id: <etooezn69wg.fsf@wormtongue.emschwar>
butt-fuzz <butt-fuzz@ass.wipe.com> writes:
> i got a weird problem with push.
I'd guess your best bet is to read the docs for 'push' then, using
$ perldoc -f push
> for ($x=1;$x<=12;$x++){
Ack, C-style for loops. :( Please use the more perlish
foreach my $x (1..12) {
instead. It'll make you more friends with anyone else who has to
maintain your code. :)
> $sysDateLoop=`/usr/bin/cal $x 2003`;
> push @sysDate, $sysDateLoop;
Note that the all the lines output by 'cal' are in the scalar value
of $sysDateLoop-- as perl
perldoc perlop
points out,
"In scalar context, it comes back as a single (potentially
multi-line) string, or undef if the command failed. In list
context, returns a list of lines (however you've defined lines
with $/ or $INPUT_RECORD_SEPARATOR), or an empty list if the
command failed.
So each entry of @sysDate contains a month's calendar, because you
assigned it to a scalar.
> }
> $sysDate=join '##--Month-Break--##', @sysDate;
> this will produce jan, feb...dec. cals.
As you would expect.
> I tried a more lazy approach and I get weridness.
You get exactly what you asked for. If you wanted to know why, you
could have asked perl, and you'd have got an answer much faster than
asking the newsgroup.
> for ($x=1;$x<=12;$x++){
> push @sysDate `/usr/bin/cal $x 2003`;
'perldoc -f push' shows that 'push' takes an array and a list. As a
consequence the backticks are evaluated in list context. As per the
documentation, that means that each line of output is returned as an
individual element of the list, instead of all joined up, like your
first example. In this case, that means each entry of the @sysDate
array is a line from the output of 'cal', because you push them onto
the array individually.
If the documentation in
perldoc -f push
and
perldoc perlop
isn't clear, it would help a lot if you could explain why, so that it
can be improved. This isn't a smartass comment, as so many people
seem to take it-- if the docs are poor, the only way they can be
improved is to get feedback on why. If, on the other hand, you just
didn't look at them, we can't do much about that. :)
> }
> $sysDate=join '##--Month-Break--##', @sysDate;
Here you create a scalar with that string between the end of each line
of output, and the beginning of the next. Which is exactly what you
print out.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Mon, 21 Jul 2003 14:00:15 -0400
From: butt-fuzz <butt-fuzz@ass.wipe.com>
Subject: Re: push -- weird problem
Message-Id: <3F1C2A2F.DAF29D6F@ass.wipe.com>
I just want what comes out of 'cal' and mess around with it like
highlighing dates and arranging it in an HTML table.
I dont want to load another module. I just want something simple.
thanks.
Domenico Discepola wrote:
>
> If I interpret the goal of your program correctly & at the risk of not
> answering your question ;-), have you looked at the Date::PCalc module?
>
> "butt-fuzz" <butt-fuzz@ass.wipe.com> wrote in message
> news:3F1C24EB.47996DC9@ass.wipe.com...
> > i got a weird problem with push.
> >
> >
> > for ($x=1;$x<=12;$x++){
> > $sysDateLoop=`/usr/bin/cal $x 2003`;
> > push @sysDate, $sysDateLoop;
> > }
> > $sysDate=join '##--Month-Break--##', @sysDate;
> > this will produce jan, feb...dec. cals.
> >
> >
> > I tried a more lazy approach and I get weridness.
> > for ($x=1;$x<=12;$x++){
> > push @sysDate `/usr/bin/cal $x 2003`;
> > }
> > $sysDate=join '##--Month-Break--##', @sysDate;
> >
> > look at this:
> > January 2003
------------------------------
Date: Mon, 21 Jul 2003 11:57:47 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: push -- weird problem
Message-Id: <etok7ab69us.fsf@wormtongue.emschwar>
"Domenico Discepola" <domenico_discepola@quadrachemicals.com> writes:
> If I interpret the goal of your program correctly & at the risk of not
> answering your question ;-), have you looked at the Date::PCalc module?
Was it really necessary to quote all 123 lines of the original post to
ask that question?
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Mon, 21 Jul 2003 09:41:46 -0500
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: s there a module to acess Micorsoft Access datafiles?
Message-Id: <bfgu7j$9tk$1@slb9.atl.mindspring.net>
"James Willmore" <jwillmore@cyberia.com> wrote
> I placed the OP below your review. The OP mentions mounting the
> Windows partition, which tells me the person posting wanted to use the
> file WITHOUT using a server.
I agree, sort of ... . The OP's desired approach, ironically, *does* involve
a server, namely SAMBA.
I was simply trying to respond to the OP's request for the best (feasible)
approach. My approach was to give him solutions that work, rather than a
litany of things that won't work.
I'm familiar with all of the citations you gave, having already pointed the
OP to them.
Cheers.
Bill Segraves
------------------------------
Date: Mon, 21 Jul 2003 12:21:09 -0500
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: s there a module to acess Micorsoft Access datafiles?
Message-Id: <bfh7i3$obk$1@slb6.atl.mindspring.net>
"James Willmore" <jwillmore@cyberia.com> wrote
<snip>
> Linux - FreeBSD - all Unix - NOT Windows. Read the OP.
O.K. I see the OP is trying to access MS Access files on a Windows system
from a FreeBSD system.
BTW, there are many who will dispute your claim "Linux - FreeBSD - all
Unix". Are
you trying to support SCO's claims? ;-)
> A CGI environment. In other words, you used a web server to connect
> to the ODBC datasource?
Well, yes, in the example I cited. It certainly wasn't necessary to use the
web server to connect to the ODBC data source. The examples I cited work
fine from the command line as well, with no CGI server running at all.
> So, the drivers needed to access the ODBC
> datasource were on the Windows box, right?
Yes. In my specific case, Win32 (95SR1), I had set up User DSNs with the
Windows
ODBC manager for studies performed over the last several years. So, for the
purposes of this thread, I used User DSNs that I had already set up on this
Win32
workstation.
> And the connection to the
> Windows box was through a web server, right? So, basiclly, it didn't
> work FROM the non-Windows machine without the use of a web server.
Yes, but just in the case I cited. AFAIK, the web server is not necessary,
as DBI and DBD::ODBC do their good works without requiring the
use of a web server.
> Which is why I suggested useing DBI::Proxy - same concept, different
> approach. Still need a server or drivers to run on one box or the
> other to accomplish the task. Simply setting up a DSN on the Windows
> box won't work without a server
This has not been supported by my (limited) tests. I'm pursuaded by actual
tests that a web server is not required in order for the connection to
succeed.
As soon as I've installed DBD::ODBC on one of my Linux systems, I
expect I'll be able to confirm this works with System DSNs defined on the
Win32 system and the script/program using DBI and DBD::ODBC hosted on a
Linux box to to access said DSNs.
OTOH, this is a low priority item for me. If the OP's curiosity overwhelms
him before I get to it, he can pursue it himself with the recommendations
I've given him.
> or having drivers on the foriegn
> machine. Interesting approach, but not what the OP was after.
I've understood from the beginning of the thread that the OP would have
liked to be able to do all of the processing on his FreeBSD system,
connected via SAMBA to the Win32 file system.
As I've seen no confirmation that an MS Access driver is available on a
*nix-like system via the ODBC manager, and the required MS Access driver is
readily available in the ODBC manager of the Windows system, I had
recommended the OP try what I knew to be workable on the Win32 side. My
solution works on the Windows side, with and without a (CGI) server.
This should also work, although I haven't tried it:
*nix-like system - to make the connection to the Win32 DSN (not to a file)
DBI
DBD::ODBC
Win32 system - to provide the System DSNs
ODBC Manager, as described earlier in the thread
> I have. When I first started using Linux (and later FreeBSD and
> SunOS and variants of Windows and MVS), I used the approach the
> setting up a DSN on a Windows machine
> would fit the bill. Not so. But hey, don't take my work for it.
It's not clear what you mean didn't fill the bill. You *do* need something
like DBI and DBD::ODBC to access the ODBC DSN that has been set up on the
Win32 system.
> Here's a blurb from the book "Programming the Perl DBI". In the
> section for DBD::ODBC, it states:
Blurb deleted. These are the citations to which I've pointed the OP. I
steered a bit farther away from copyright violation than you did.
> I placed the OP below your review. The OP mentions mounting the
> Windows partition, which tells me the person posting wanted to use the
> file WITHOUT using a server.
OP deleted, as it's available on Google Groups.
Well, sometimes what we'd like is made from "unobtanium". Lacking a 100
percent compliant solution, I provided what I knew would work.
Cheers.
Bill Segraves
------------------------------
Date: 21 Jul 2003 18:08:06 +0100
From: Brian McCauley <nobull@mail.com>
Subject: See y'all in Paris? YAPC::Europe::2003
Message-Id: <u9d6g3yfih.fsf@wcl-l.bham.ac.uk>
Any of the other regulars here going to YAPC::Europe::2003 this week?
Anyone for a clpm "reunion" dinner?
------------------------------
Date: Mon, 21 Jul 2003 13:17:55 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <7KRSa.12171$0F4.10364@nwrdny02.gnilink.net>
Greg Bacon <gbacon@cs.uah.edu> wrote:
> Top 14 Posters by OCR (minimum of ten posts)
> ============================================
> 0.857 ( 11.6 / 13.6) 18 abigail@abigail.nl
> 0.772 ( 12.8 / 16.6) 10 James Willmore <jwillmore@cyberia.com>
Something seems to have gone awry...
> Bottom 14 Posters by OCR (minimum of ten posts)
> ===============================================
> 0.857 ( 11.6 / 13.6) 18 abigail@abigail.nl
> 0.772 ( 12.8 / 16.6) 10 James Willmore <jwillmore@cyberia.com>
--
Steve
------------------------------
Date: 21 Jul 2003 13:26:42 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <slrnbhnqgi.t0s.abigail@alexandra.abigail.nl>
Steve Grazzini (grazz@pobox.com) wrote on MMMDCXI September MCMXCIII in
<URL:news:7KRSa.12171$0F4.10364@nwrdny02.gnilink.net>:
:) Greg Bacon <gbacon@cs.uah.edu> wrote:
:) > Top 14 Posters by OCR (minimum of ten posts)
:) > ============================================
:) > 0.857 ( 11.6 / 13.6) 18 abigail@abigail.nl
:) > 0.772 ( 12.8 / 16.6) 10 James Willmore <jwillmore@cyberia.com>
:)
:) Something seems to have gone awry...
:)
:) > Bottom 14 Posters by OCR (minimum of ten posts)
:) > ===============================================
:) > 0.857 ( 11.6 / 13.6) 18 abigail@abigail.nl
:) > 0.772 ( 12.8 / 16.6) 10 James Willmore <jwillmore@cyberia.com>
You quoted twice the phrase "minimum of ten posts".
You may make 14 guesses of how people made at least 10 posts in
comp.perl.lang.misc the last week.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: Mon, 21 Jul 2003 17:26:49 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <tnVSa.22653$7O.17241@nwrdny01.gnilink.net>
Abigail <abigail@abigail.nl> wrote:
> Steve Grazzini (grazz@pobox.com) wrote on MMMDCXI September MCMXCIII in
> <URL:news:7KRSa.12171$0F4.10364@nwrdny02.gnilink.net>:
> :) Greg Bacon <gbacon@cs.uah.edu> wrote:
> :) > Top 14 Posters by OCR (minimum of ten posts)
> :) > ============================================
> :) > 0.857 ( 11.6 / 13.6) 18 abigail@abigail.nl
> :) > 0.772 ( 12.8 / 16.6) 10 James Willmore <jwillmore@cyberia.com>
> :)
> :) Something seems to have gone awry...
> :)
> :) > Bottom 14 Posters by OCR (minimum of ten posts)
> :) > ===============================================
> :) > 0.857 ( 11.6 / 13.6) 18 abigail@abigail.nl
> :) > 0.772 ( 12.8 / 16.6) 10 James Willmore <jwillmore@cyberia.com>
>
>
> You quoted twice the phrase "minimum of ten posts".
>
> You may make 14 guesses of how people made at least 10 posts in
> comp.perl.lang.misc the last week.
Heh...
As it turns out: I only needed 7 guesses for the "High OCR" list,
leaving me a serendipitous seven to use for the "Low OCR".
--
Steve
------------------------------
Date: Mon, 21 Jul 2003 10:03:25 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: stripping characters from xml files
Message-Id: <slrnbho05s.dk8.tadmc@magna.augustmail.com>
Ahmad J Reeves <ahmad@dcs.qmul.ac.uk> wrote:
> I need a perl script to strip some characters from an xml file, for example;
><LOG>
><DIRECT>
> <MESSAGE> %M%lsays%m%l "%y%LAnyone know of any tri-band
> phones.%m%l" </MESSAGE>
You should use a module that understands XML for processing XML data.
A regex "solution" will not be robust, and can only be used when
you make all kinds of simplifying assumptions. ie. it will be
"fragile", easily broken by perfectly legitimate XML.
You didn't tell us what extra assumptions can be applied to
your particular data, so the answer to your question is:
use one of the XML modules.
If you had however, indicated that some assumptions _could_
be made, then being Lazy and Impatient we are likely to assume
whatever makes it easier to code up, rather than what you might
be able to actually use for your data...
... so I'll make my own assumptions:
change _all_ <MESSAGE> elements, regardless of their ancestry.
change things that "look like" <MESSAGE> elements,
even when they *aren't* <MESSAGE> elements.
(eg. <!-- <MESSAGE>commented out</MESSAGE> --> )
<MESSAGE> elements are always completely contained on a single line.
<MESSAGE> elements cannot contain other <MESSAGE> elements.
The </LOG> end tag is always on a line by itself.
If you can live with all of those, then see the code below.
If not, then modify the code below, or use a module (which can
overcome all of those restrictions right out of the box).
> I would need to strip the %M%, %m%l and %y% and various others from just
> message tag,
Huh?
There are none of those strings in either of the message element's tags.
A "tag" starts with "<" and ends with ">".
There are *two* "message tags" in your data, a start tag:
<MESSAGE>
and an end tag:
</MESSAGE>
Neither one of them contain the strings you refer to.
You want to strip them from the message _element_.
The tags are merely the delimiters for the element.
The conceptual difference between a "tag" and an "element" is
an important one, the element is what is important and interesting.
> to give me:-
>
><MESSAGE> says "Anyone know of any tri-band phones." </MESSAGE>
-----------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
{ local $/ = "</LOG>\n";
while ( <DATA> ) {
s{( <MESSAGE> .*? </MESSAGE> )}
{ my $msg = $1;
$msg =~ s/ % [Mmy] % [Ll]? //xg;
$msg;
}xe;
print;
}
}
__DATA__
<LOG>
<MESSAGE> %M%lsays%m%l "%y%LAnyone know of any tri-band phones.%m%l" </MESSAGE>
etc etc
</LOG>
<LOG>
<MESSAGE> %M%lsays%m%l "%y%LAnyone know of any dual-band phones.%m%l" </MESSAGE>
etc etc
</LOG>
-----------------------------------------
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 21 Jul 2003 17:09:36 +0000
From: Mario542 <member17678@dbforums.com>
Subject: Using SMTP through a proxy server
Message-Id: <3134226.1058807376@dbforums.com>
Does anyone know how to run NET::SMTP through a corporate proxy server
to a SMTP server on the Internet??
This proxy only allows HTTP.
Thanks,
Mario
--
Posted via http://dbforums.com
------------------------------
Date: 21 Jul 2003 09:54:28 -0700
From: paer_nystroem@hotmail.com (Par)
Subject: Variable reference
Message-Id: <5a0e38a9.0307210854.256b2e41@posting.google.com>
Dear all...
A bit of a newbie, but I hope that somebody can help me out with what
should be simple for all of you, but that I just haven't found a
solution to anywhere...
I have a lot of variables in the form of
$var{$something} = "Some text";
$something consists of two parts though. Ideally I would have liked it
to be in the form of $var{$part1$part2}, but that doesn't work...
So the really nasty looking part I've had to add is
$something = $part1 . $part2;
So my question is basically how I avoid having the above line?!
Thanks for your help!
Par
------------------------------
Date: Mon, 21 Jul 2003 13:11:38 -0400
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
Subject: Re: Variable reference
Message-Id: <Pine.SGI.3.96.1030721131101.37230A-100000@vcmr-64.server.rpi.edu>
On 21 Jul 2003, Par wrote:
>$var{$something} = "Some text";
>
>$something consists of two parts though. Ideally I would have liked it
>to be in the form of $var{$part1$part2}, but that doesn't work...
>So the really nasty looking part I've had to add is
>$something = $part1 . $part2;
>
>So my question is basically how I avoid having the above line?!
Just do
$var{$part1 . $part2}
or
$var{"$part1$part2"}
--
Jeff Pinyan RPI Acacia Brother #734 2003 Rush Chairman
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
------------------------------
Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re:
Message-Id: <3F18A600.3040306@rochester.rr.com>
Ron wrote:
> Tried this code get a server 500 error.
>
> Anyone know what's wrong with it?
>
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {
(---^
> dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
...
> Ron
...
--
Bob Walton
------------------------------
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 5251
***************************************