[19435] in Perl-Users-Digest
Perl-Users Digest, Issue: 1630 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 27 21:10:34 2001
Date: Mon, 27 Aug 2001 18:10:20 -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: <998961020-v10-i1630@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 27 Aug 2001 Volume: 10 Number: 1630
Today's topics:
Re: help with searching for occurances of...... (Abigail)
Re: Help! Trying to configure SendMail.pm is driving m <somewhere@in.paradise.net>
Re: how to get named constants in Perl (Abigail)
I need perl for beginners <kathy@onlineperspectives.com>
Re: I need perl for beginners <nowhere@dot.com>
Re: I need perl for beginners <bwalton@rochester.rr.com>
Re: is perl an 'interpretative' language? <iltzu@sci.invalid>
Re: It's to AM for me to think <Tassilo.Parseval@post.rwth-aachen.de>
Keeping files open (Etienne Pelaprat)
Re: Keeping files open <cberry@cinenet.net>
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: Newbie. Searching a text file and replacing text. (Hardy Merrill)
Re: No HTML submitted via form <iltzu@sci.invalid>
Re: Openning a file <ren@tivoli.com>
Re: Paying for these custom Perl scripts. (David H. Adler)
perl "study" function in java? (crypto_boy)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Aug 2001 19:16:08 GMT
From: abigail@foad.org (Abigail)
Subject: Re: help with searching for occurances of......
Message-Id: <slrn9ol73t.plv.abigail@alexandra.xs4all.nl>
Paul (paul@orchidheathltd.freeserve.co.uk) wrote on MMCMXIV September
MCMXCIII in <URL:news:ba186de.0108230819.19b56171@posting.google.com>:
'' Hi
''
'' I am new to perl and scripting (as you will gather!)
''
'' Having searched back through previous postings are unable to find
'' something similar to help.
''
'' I have a large data file that on each line contains a 6 digit ID
'' number. I would like to run a script to find, for each ID number (0 to
'' 999999) how many times each one occurs in the file.
''
'' 0=x occurances
'' 1=x occurances
'' etc
'' etc
'' 999999=x occurances
''
'' Output in this format would suffice.
''
''
'' Can anyone help?
What have you done so far? Are you expecting to find someone who
would write your homework for you?
Here's a free hint: use a hash.
Don't come back until you tried something yourself.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Tue, 28 Aug 2001 07:57:52 +1000
From: "Tintin" <somewhere@in.paradise.net>
Subject: Re: Help! Trying to configure SendMail.pm is driving me crazy!!
Message-Id: <Yozi7.3$rD6.153699@news.interact.net.au>
"JerryGarciuh" <dmartin119@home.com> wrote in message
news:_lvi7.134432$oh1.52034544@news2.rdc2.tx.home.com...
> My tests got error :
>
> no host: , please specify SMTP server with "$obj = new
> SendMail('your.smtp.server');"
>
> So in SendMail.pm I edited
>
> $smtpserver = "mail.server.com";
>
> to
>
> $smtpserver = "mail.mysite.com";
>
> and got same error. Since error said to edit
>
> "$obj = new SendMail('your.smtp.server');"
>
> I went down to
>
> $obj = new SendMail();
> $obj = new SendMail($smtpserver);
> $obj = new SendMail($smtpserver, $smtpport);
>
> and changed first line to
>
> $obj = new SendMail(mail.mysite.com);
>
> got same error
>
> so I changed it back and tried replacing variable $smtpserver with my
info
> which off course rendered script inoperable.
>
> I REALLY don't get why setting $smtpserver = "mail.mysite.com"; gave
error
> no host when $obj = new SendMail($smtpserver);
> should have had the info it needed from var.
Where did you get this module from? I can only see Mail::Sendmail on CPAN
and it has a different interface to what you describe.
------------------------------
Date: 27 Aug 2001 22:56:42 GMT
From: abigail@foad.org (Abigail)
Subject: Re: how to get named constants in Perl
Message-Id: <slrn9olk1f.qgj.abigail@alexandra.xs4all.nl>
Martien Verbruggen (mgjv@tradingpost.com.au) wrote on MMCMXVI September
MCMXCIII in <URL:news:slrn9of5ja.3ga.mgjv@martien.heliotrope.home>:
## On 25 Aug 2001 04:52:44 -0700,
## Joachim Ziegler <ziegler@algorilla.de> wrote:
## > i've seen the following line of code for defining a contant scalar
## > equal to pi:
## >
## > *PI=\3.141592;
## >
## > can someone please explain what's going on here behind the scenes?
##
## Uck. I haven't seen that for a while.
##
## This makes the scalar slot of the typeglob PI an alias for the constant
## 3.141592. The perldata and perlref documentation have some things to say
## about typeglobs and references.
##
## I'd certainly not recommend this.
##
## > is this the preferred way in Perl to do something like "const double
## > PI=3.1415;" in C?
##
## No. The preferred way, nowadays, would be to use the const pragma:
##
## use const PI => 3.141592;
That would be 'use constant'.
## or rather, to get a bit more precision:
##
## use const PI => 4 * atan2(1, 1);
You know, the short sighteness of Perl programmers keeps amazing me.
Both are useful in there own right, and claiming that one is prefered
over the other shows a failure to understand the benefits of the other.
With *PI = \3.141592, one can do easy interpolation. With 'use constant',
you can't. You'd have to use something like "@{[PI]}", which is quite
horrid.
I really dislike posts that say "I don't recommend this" and "the
preferred way of doing is", without actually giving any arguments why
one doesn't recommend something and why something else is preferred. Such
posts aren't really useful.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Mon, 27 Aug 2001 20:25:52 GMT
From: Online Perspectives <kathy@onlineperspectives.com>
Subject: I need perl for beginners
Message-Id: <3B8AACE6.83DA705D@onlineperspectives.com>
Hello, I need a basic, beginners site for pearl. Can some one recommend
one.
--
If I can be of service please don't
hesitate in calling me.
Best Regards,
Kathy Nelson
Best Rate National Agent
**********************************
http://bestratesphone.com
------------------------------
Date: Tue, 28 Aug 2001 08:44:57 +1000
From: "Gregory Toomey" <nowhere@dot.com>
Subject: Re: I need perl for beginners
Message-Id: <c0Ai7.5157$Nd2.82613@newsfeeds.bigpond.com>
"Online Perspectives" <kathy@onlineperspectives.com> wrote in message
news:3B8AACE6.83DA705D@onlineperspectives.com...
> Hello, I need a basic, beginners site for pearl. Can some one recommend
> one.
Maybe you need a beginners book. Look in your local technical bookshop.
Otherwise see http://www.comp.leeds.ac.uk/Perl/start.html
gtoomey
------------------------------
Date: Tue, 28 Aug 2001 00:25:40 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: I need perl for beginners
Message-Id: <3B8AE505.684A3A17@rochester.rr.com>
Online Perspectives wrote:
>
> Hello, I need a basic, beginners site for pearl. Can some one recommend
> one.
...
> Kathy Nelson
...
Go to http://www.perl.com and type tutorial in the search box. One of
the many there should suit your needs. I highly recommend the boox
"Learning Perl" by Schwartz and Christiansen, O'Reilly.
--
Bob Walton
------------------------------
Date: 27 Aug 2001 18:31:16 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: is perl an 'interpretative' language?
Message-Id: <998935590.29626@itz.pp.sci.fi>
In article <87vgjfc4dn.fsf@abra.ru>, Ilya Martynov wrote:
>
>I'm not Perl internals guru but AFAIK Perl is simular to
>bytecode-interpetation like Java.
>
>When Perl executes your script first of all it builds internal
>bytecode representation of your script (compilation stage) and than
>executes it. It is like Java with exception that in Java exist
>separation between compiler and bytecode-interpreter (these are
>separate programs).
Well, sort of. What perl compiles your program into is actually a sort
of a parse tree, known as the optree. It may or may not resemble what
you originally wrote very much, after the magic tokenizer, the parser,
and the peephole optimizer have been over it, but it does contain enough
information to "deparse" it into more or less equivalent code.
The interpreter then recursively walks this optree, evaluating the ops
and passing the results back up the tree on a stack. There are all
sorts of other internal data structures involved, such as symbol tables
and scratchpads, but this will suffice for an approximate overview.
There are several compiler backend modules that let you play with this
stuff -- of particular interest are B::Deparse and B::Concise. (There
have been significant improvements in this area -- a recent development
build of perl is recommended.) For example:
$ perl5.7.1 -MO=Deparse -e 'print "Just another Perl hacker,"'
print 'Just another Perl hacker,';
$ perl5.7.1 -MO=Concise,-tree -e 'print "Just another Perl hacker,"'
<6>leave[t1]-+-<1>enter
|-<2>nextstate(main 1 -e:1)
`-<5>print-+-<3>pushmark
`-<4>const(PV "Just another Perl hacker,")
The B::Concise module, in particular, is quite a versatile tool for
examining the optree. Read the docs for details. Note that, if your
terminal supports it, "-MO=Concise,-vt,-tree" produces a much nicer
looking tree than the ASCII version I've shown above.
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post something,
we discuss its implications. If the discussion happens to answer a question
you've asked, that's incidental." -- nobull in comp.lang.perl.misc
------------------------------
Date: Mon, 27 Aug 2001 23:50:38 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: It's to AM for me to think
Message-Id: <3B8AC0AE.2000509@post.rwth-aachen.de>
Abigail wrote:
> One of the problems of vanilla Quicksort is that both ordered and
> reverse ordered inputs lead to worst case behaviour. Perl's specific
> implementation however doesn't suffer from this ("middle-of-three"
> picking of the pivot). That means by not reversing you didn't go from
> "worst-case" to "best-case". Note that it's still easy to create inputs
> for Perl's sort that cause it to use quadratic time: so called "organ
> pipe" inputs will do: (1 .. $N, 1 .. $N) for instance.
You mean, Perl's sort uses an element in the middle rather than the one
at end of the array?
> Note that you are totally wrong by taking the raw outputs of the Benchmark
> and say "method1 is X% faster than method2", as your Benchmark creates the
> array the algorithm works on. Since the array creation takes Theta(N), and
> one of the algorithms takes Theta(N) as well, the time spend to create the
> array is far from insignificant.
This was my first sub-optimal benchmark. In the second one (the one I
was referring in the post you replied to) I initialized a global array
once on top....with random numbers so this would have then come close to
an average-case for quick-sort.
[merge sort() in >= 5.6.0]
> But that isn't true. 5.6.x Perl uses a specially for Perl optimized
> quicksort. But it's still a quicksort. Merge-sort is in Perl 5.7.x.
Ah, thanks for the note. I remembered to have read it in perldelta but
obviously it must have been somewhere else.
Tassilo
--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: 27 Aug 2001 16:42:00 -0700
From: etienne@hci.ucsd.edu (Etienne Pelaprat)
Subject: Keeping files open
Message-Id: <90ee5f8d.0108271542.74ef6508@posting.google.com>
Hi,
I would like to write a perl script which constantly reads from
/var/log/maillog, but I'm having trouble figuring out how I can open
it up and not have it close when it reaches the end of the file.
Instead, when it reaches the end, I want it to wait until a new line
gets entered into /var/log/maillog which I can then parse. Basically,
how do I write a perl script that does what the command $> tail -f
/var/log/maillog does?
thanks,
etienne
------------------------------
Date: Mon, 27 Aug 2001 23:56:16 -0000
From: Craig Berry <cberry@cinenet.net>
Subject: Re: Keeping files open
Message-Id: <Xns910AAC4CE5815cberrycinenetnet1@207.126.101.92>
etienne@hci.ucsd.edu (Etienne Pelaprat) wrote in
news:90ee5f8d.0108271542.74ef6508@posting.google.com:
> I would like to write a perl script which constantly reads from
> /var/log/maillog, but I'm having trouble figuring out how I can open
> it up and not have it close when it reaches the end of the file.
> Instead, when it reaches the end, I want it to wait until a new line
> gets entered into /var/log/maillog which I can then parse. Basically,
> how do I write a perl script that does what the command $> tail -f
> /var/log/maillog does?
I'm rather confused...you knew about the unix tail utility, you have the
perl doc, this has all the telltale signs of being a FAQ, yet you didn't
check the FAQ before asking? The simple command 'perldoc -q tail' would
have got you an exhaustive, authoratative answer to your question thousands
of times faster than posting to Usenet and waiting for answers of unknown
value.
Just out of curiosity, for the benefit of the community in better tuning
furture help efforts: Why didn't you check the FAQ before posting?
--
Craig Berry <http://www.cinenet.net/~cberry/>
"That which is now known, was once only imagined." - William Blake
------------------------------
Date: Mon, 27 Aug 2001 19:22:03 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <tol7erh3pa8qd4@corp.supernews.com>
Following is a summary of articles from new posters spanning a 7 day
period, beginning at 20 Aug 2001 20:24:26 GMT and ending at
27 Aug 2001 19:49:17 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2001 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 133 (41.0% of all posters)
Articles: 205 (17.0% of all articles)
Volume generated: 348.6 kb (15.0% of total volume)
- headers: 162.7 kb (3,352 lines)
- bodies: 180.7 kb (5,783 lines)
- original: 113.2 kb (3,912 lines)
- signatures: 5.0 kb (111 lines)
Original Content Rating: 0.626
Averages
========
Posts per poster: 1.5
median: 1 post
mode: 1 post - 90 posters
s: 1.8 posts
Message size: 1741.1 bytes
- header: 812.8 bytes (16.4 lines)
- body: 902.5 bytes (28.2 lines)
- original: 565.3 bytes (19.1 lines)
- signature: 24.9 bytes (0.5 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
6 12.2 ( 5.1/ 5.5/ 3.8) Ilmari Karonen <usenet11561@itz.pp.sci.fi>
5 5.2 ( 3.7/ 1.5/ 0.9) Eli Bendersky <eliben@il.ibm.comNOSPAM>
5 10.1 ( 4.5/ 5.5/ 1.8) "Jon 'The Mensch'" <vemba72@youknowwhattodo.hotmail.com>
5 5.8 ( 4.1/ 1.7/ 1.2) florian.haftmann@stud.tum.de
4 11.5 ( 3.7/ 7.8/ 4.7) Alex Hart <news@althepal#nospam#.com>
4 7.1 ( 3.3/ 3.9/ 2.6) Nathan McDannold <nmcdannold@yahoo.com>
4 4.3 ( 2.6/ 1.7/ 1.7) Joachim Ziegler <ziegler@algorilla.de>
4 6.0 ( 2.8/ 3.2/ 1.5) agm@physics.berkeley.edu
4 9.1 ( 3.0/ 5.0/ 0.8) bill@todbe.com
3 4.7 ( 2.1/ 2.6/ 2.4) John Wentzcovitch <wentzcovitch@hotmail.com>
These posters accounted for 3.7% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
20.9 ( 1.0/ 19.9/ 2.0) 1 "Brian A. Stumm" <bs@bs-linux.com>
12.2 ( 5.1/ 5.5/ 3.8) 6 Ilmari Karonen <usenet11561@itz.pp.sci.fi>
11.5 ( 3.7/ 7.8/ 4.7) 4 Alex Hart <news@althepal#nospam#.com>
10.1 ( 4.5/ 5.5/ 1.8) 5 "Jon 'The Mensch'" <vemba72@youknowwhattodo.hotmail.com>
9.1 ( 3.0/ 5.0/ 0.8) 4 bill@todbe.com
7.5 ( 3.4/ 4.1/ 2.1) 3 "Mr Q. Z. Diablo" <diablo@prometheus.humsoc.utas.edu.au>
7.1 ( 3.3/ 3.9/ 2.6) 4 Nathan McDannold <nmcdannold@yahoo.com>
6.0 ( 2.8/ 3.2/ 1.5) 4 agm@physics.berkeley.edu
5.8 ( 4.1/ 1.7/ 1.2) 5 florian.haftmann@stud.tum.de
5.2 ( 3.7/ 1.5/ 0.9) 5 Eli Bendersky <eliben@il.ibm.comNOSPAM>
These posters accounted for 4.1% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 1.7 / 1.7) 4 Joachim Ziegler <ziegler@algorilla.de>
0.904 ( 2.4 / 2.6) 3 John Wentzcovitch <wentzcovitch@hotmail.com>
0.790 ( 0.8 / 1.0) 3 "Peter du Marchie" <pdumarchie@goldenbytes.com>
0.712 ( 1.2 / 1.7) 5 florian.haftmann@stud.tum.de
0.695 ( 3.8 / 5.5) 6 Ilmari Karonen <usenet11561@itz.pp.sci.fi>
0.688 ( 0.6 / 0.9) 3 Clarence Johnson <clarencewjohnson@yahoo.com>
0.671 ( 2.6 / 3.9) 4 Nathan McDannold <nmcdannold@yahoo.com>
0.632 ( 0.9 / 1.5) 5 Eli Bendersky <eliben@il.ibm.comNOSPAM>
0.607 ( 4.7 / 7.8) 4 Alex Hart <news@althepal#nospam#.com>
0.587 ( 1.0 / 1.7) 3 "Matt Garrish" <matthew.garrish@sympatico.ca>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.688 ( 0.6 / 0.9) 3 Clarence Johnson <clarencewjohnson@yahoo.com>
0.671 ( 2.6 / 3.9) 4 Nathan McDannold <nmcdannold@yahoo.com>
0.632 ( 0.9 / 1.5) 5 Eli Bendersky <eliben@il.ibm.comNOSPAM>
0.607 ( 4.7 / 7.8) 4 Alex Hart <news@althepal#nospam#.com>
0.587 ( 1.0 / 1.7) 3 "Matt Garrish" <matthew.garrish@sympatico.ca>
0.509 ( 2.1 / 4.1) 3 "Mr Q. Z. Diablo" <diablo@prometheus.humsoc.utas.edu.au>
0.471 ( 1.5 / 3.2) 4 agm@physics.berkeley.edu
0.424 ( 0.2 / 0.4) 3 Hessu <qvyht@removejippii.fi>
0.329 ( 1.8 / 5.5) 5 "Jon 'The Mensch'" <vemba72@youknowwhattodo.hotmail.com>
0.153 ( 0.8 / 5.0) 4 bill@todbe.com
15 posters (11%) had at least three posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
26 comp.lang.perl.modules
10 alt.perl
6 alt.ascii-art
6 comp.lang.perl
5 alt.games.half-life.tfclassic
4 comp.unix.shell
3 comp.text.xml
3 microsoft.public.xml
3 comp.sys.hp.hpux
2 comp.lang.tcl
Top 10 Crossposters
===================
Articles Address
-------- -------
4 jake johnson <jake@omnimode.com>
4 Dan Sheppard <dans@chiark.greenend.org.uk>
4 "Belphegor" <globalpunk@hotmail.com>
2 "Gareth Hinton" <gareth.hinton@btinternet.com>
2 Hansang Bae <hbae_@_nyc.rr.com.REMOVE_>
2 "Nezar Nielsen" <tumpen@fez.dk>
2 pascal.jolin@videotron.ca
1 Tanya Ruttenberg <tanya.ruttenberg@ssa.gov>
1 Ilmari Karonen <usenet11555@itz.pp.sci.fi>
1 Sean Quinlan <seanq@darwin.bu.edu>
------------------------------
Date: 27 Aug 2001 11:59:34 -0700
From: merrill@missioncriticallinux.com (Hardy Merrill)
Subject: Re: Newbie. Searching a text file and replacing text.
Message-Id: <fdfedf4b.0108271059.680fc3b3@posting.google.com>
Rainer Klier <Rainer.Klier@erl.sbs.de> wrote in message news:<3B8A1887.F8A79B8C@erl.sbs.de>...
>
> What I wonder is, wether this is a common way to
> update textfiles. Is there another possibility?
> I do not like the idea so much to load the whole
> file into memory.
You could open a filehandle to the file and read it line
by line - use a regex on each line to find the line you're
looking for, and write the lines you want to a temporary file.
When your done reading and writing, then do a "move"(from
File::Copy) from the temporary file tNNTP-Article: 206159 of comp.lang.perl.misc
Path: news.orst.edu!canoe.uoregon.edu!cyclone1.gnilink.net!washdc3-snf1!washdc3-snh1.gtei.net!cpk-news-hub1.bbnplanet.com!news.gtei.net!news.maxwell.syr.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail
From: mike_solomon@lineone.net (Mike Solomon)
Newsgroups: comp.lang.perl.misc
Subject: Selecting * on numerous MySQL tables.
Date: 27 Aug 2001 11:09:41 -0700
Organization: http://groups.google.com/
Lines: 33
Message-ID: <56568be5.0108271009.7fd5d5a6@posting.google.com>
NNTP-Posting-Host: 213.1.124.73
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 998935781 27696 127.0.0.1 (27 Aug 2001 18:09:41 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 27 Aug 2001 18:09:41 GMT
Xref: news.orst.edu comp.lang.perl.misc:206159
>I'm running into a snag... here's an example of the query I'm making
>from within Perl:
>SELECT * FROM table1,table2
>I know it's not a nice way to do it, but I'm making an SQL webpage
>frontend which I'd like to support it just in case. I'm
>using fetchrow->hashref to pull it out and display it. The problem I'm
>running into is when table1 and table2 have similar
>column names. One of them would be overwritten in the hash reference to
>be replaced by the second one it encounters.
>So my question is this. Is there any way to force MySQL to ouput the
>table name with the column name instead of just the
>column name, ie. table1.column2.
>Thanks in advance,
>Dave Mittner
Change your SQL statement to something like
SELECT table1.name tab1name, table2.name tab2name
FROM table1, table2
You then use tab1name and tab2name as your reference
This should solve your problem
Regards
Mike Solomon
------------------------------
Date: 27 Aug 2001 20:32:47 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: No HTML submitted via form
Message-Id: <998943760.3619@itz.pp.sci.fi>
In article <e39b8fbf.0108251904.396fdf61@posting.google.com>, Alexey Lysenkov wrote:
[attribution missing]
>> For each field do something like
>>
>> $data =~ s/</</g;
>> $data =~ s/>/>/g;
You also want to do
$data =~ s/&/&/g;
_before_ the above two lines. And if the data might ever end up in a
double-quoted argument (such as value="$data"), then
$data =~ s/"/"/g;
will also be necessary.
>> i.e. convert <tag> to <tag> that will be viewed by the browser
>> as <tag>, not interpreted as a HTML tag.
>>
>> kent
>
>Though it will be programmed with ColdFusion ;), the idea is cool. Thanks a lot!
Why are you asking here if it's for ColdFusion instead of Perl? But if
you're going to use CF, you need.. *searches old memories* ..ah, right,
the function you want is HTMLEditFormat(). Don't ask me why it has such
a silly and verbose name, but it does what you're asking for.
The other *Format() functions are worth looking into as well.
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post something,
we discuss its implications. If the discussion happens to answer a question
you've asked, that's incidental." -- nobull in comp.lang.perl.misc
------------------------------
Date: 27 Aug 2001 14:25:42 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Openning a file
Message-Id: <m3zo8ltidl.fsf@dhcp9-161.support.tivoli.com>
On Sun, 26 Aug 2001, Tassilo.Parseval@post.rwth-aachen.de wrote:
> Abigail wrote:
>
>> It's scalar context alright. But what you have isn't a list, it's a
>> comma operator. But that was pointed out before, wasn't it?
>
> Yes, and now it should be eot. I think it was you who suggested to
> send a patch concerning the perlop-entry on qw() as for claiming
> this to be a 'true list'. That was the only reason for my confusion
> as I stumbled over the contradictory things that the FAQ and perlop
> said.
As a final point, I submitted a bug report with my suggested doc
revision. Bug ID 20010827.004
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: 27 Aug 2001 20:55:37 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: Paying for these custom Perl scripts.
Message-Id: <slrn9olcul.2lg.dha@panix2.panix.com>
In article <9lvjo9$4eq$1@news4.jaring.my>, Blue © wrote:
> We need a few custom-built Perl scripts.
You have posted a job posting or a resume in a technical group.
Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.
Had you read and understood the Usenet user manual posted frequently to
"news.announce.newusers", you might have already known this. :) (If
n.a.n is quieter than it should be, the relevent FAQs are available at
http://www.faqs.org/faqs/by-newsgroup/news/news.announce.newusers.html)
Another good source of information on how Usenet functions is
news.newusers.questions (information from which is also available at
http://www.geocities.com/nnqweb/).
Please do not explain your posting by saying "but I saw other job
postings here". Just because one person jumps off a bridge, doesn't
mean everyone does. Those postings are also in error, and I've
probably already notified them as well.
If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.
http://jobs.perl.org may be of more use to you
Yours for a better usenet,
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
_Day of Wrath_ is probably Dreyer's most popular film, which already
indicates something of the problems it poses.
- David Bordwell, The Films of Carl-Theodor Dreyer
------------------------------
Date: 27 Aug 2001 15:46:16 -0700
From: crypto-boy@llnl.gov (crypto_boy)
Subject: perl "study" function in java?
Message-Id: <646ea35e.0108271446.56ba5d98@posting.google.com>
Problem:
-----------------
I need to see if a one of many regexes match a fixed string in java.
What I miss from perl is the "study" function. The study function
"takes extra time to study [a] SCALAR in anticipation of doing many
pattern matches on the string before it is next modified" (Camel
book).
Question:
-----------------
Does either jakarta oro perltools
(http://jakarta.apache.org/oro/index.html) or regexp
(http://jakarta.apache.org/regexp/) allow you to do something like
perl's study function? Or is there any other way of speeding up the
process of evaluating many different regex matches on a fixed string
in java?
All help greatly appreciated.
------------------------------
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 1630
***************************************