[23614] in Perl-Users-Digest
Perl-Users Digest, Issue: 5821 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 18 03:05:45 2003
Date: Tue, 18 Nov 2003 00:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 18 Nov 2003 Volume: 10 Number: 5821
Today's topics:
Re: Calling a sql script from perl (dn_perl@hotmail.com)
Re: Calling a sql script from perl <jwillmore@remove.adelphia.net>
Re: counting in long variable in perl <jurgenex@hotmail.com>
Re: counting in long variable in perl <nospam@invalid.com>
Re: counting in long variable in perl (Sam Holden)
Re: counting in long variable in perl <nospam@invalid.com>
Re: counting in long variable in perl <mgjv@tradingpost.com.au>
Re: counting in long variable in perl <nospam@invalid.com>
Re: Help <laie@wing_this_etsolutions.com>
Re: MIME::Lite - HTML Message and pdf Attaching at the (William Herrera)
Re: MIME::Lite - HTML Message and pdf Attaching at the <gpatnude@adelphia.net>
Re: MIME::Lite - HTML Message and pdf Attaching at the <jwillmore@remove.adelphia.net>
Re: multilinepattern match (James Willmore)
Re dbmopen question Default@User011011101101.net
Re: regex to convert 1000000 -> 1,000,000 ? <tcurrey@no.no.i.said.no>
Re: regex to convert 1000000 -> 1,000,000 ? (Sam Holden)
Re: regex to convert 1000000 -> 1,000,000 ? (Sam Holden)
Re: regex to convert 1000000 -> 1,000,000 ? <tore@aursand.no>
Re: regexp on HTML <jurgenex@hotmail.com>
Re: running a sub inside regex (Hae Jin)
Re: where is DBI::DWIM? <jboes@qtm.net>
Re: where is DBI::DWIM? <gpatnude@adelphia.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Nov 2003 19:49:17 -0800
From: dn_perl@hotmail.com (dn_perl@hotmail.com)
Subject: Re: Calling a sql script from perl
Message-Id: <97314b5b.0311171949.5f5612c9@posting.google.com>
James Willmore <jwillmore@remove.adelphia.net> wrote -
>
> --untested--
> my $sql_cmd = <<EOH;
> userid/passwd
> spool ${LOGSQL}
> @call_sql_script.sql
> spool off
> EOH
>
> system("sqlplus -s $sql_cmd 2>gen_rep.errlog");
> --untested--
>
That '@' character is the stumbling block. I tried escaping it
within double quotes "\@call_sql_script.sql" and I also tried
using single quotes to treat the string as a literal
as in '@call_sql_script.sql'. But neither approach worked.
The actual statement which I call from the shell script is :
@call_sql_script.sql $read_input_from_this_file
So single quoting the sqlplus command is not going to work
ultimately anyway.
------------
------------------------------
Date: Tue, 18 Nov 2003 06:01:00 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Calling a sql script from perl
Message-Id: <20031118010100.3e38347f.jwillmore@remove.adelphia.net>
On 17 Nov 2003 19:49:17 -0800
dn_perl@hotmail.com (dn_perl@hotmail.com) wrote:
> James Willmore <jwillmore@remove.adelphia.net> wrote -
> >
> > --untested--
> > my $sql_cmd = <<EOH;
> > userid/passwd
> > spool ${LOGSQL}
> > @call_sql_script.sql
> > spool off
> > EOH
> >
> > system("sqlplus -s $sql_cmd 2>gen_rep.errlog");
> > --untested--
> >
>
> That '@' character is the stumbling block. I tried escaping it
> within double quotes "\@call_sql_script.sql" and I also tried
> using single quotes to treat the string as a literal
> as in '@call_sql_script.sql'. But neither approach worked.
>
> The actual statement which I call from the shell script is :
> @call_sql_script.sql $read_input_from_this_file
> So single quoting the sqlplus command is not going to work
> ultimately anyway.
>
> ------------
A workaround might be to read the 'call_sql_script.sql' into a
variable and the include the variable in the here doc. However, if it
were me, I'd use the DBI module :-)
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Vote anarchist
------------------------------
Date: Tue, 18 Nov 2003 02:35:17 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: counting in long variable in perl
Message-Id: <Fzfub.68747$E9.40046@nwrddc01.gnilink.net>
Wayne Fulton wrote:
> A cgi counter (code that I copied from somewhere) was reseting to zero
> frequently.
Please see "perldoc -q increment"
jue
------------------------------
Date: Mon, 17 Nov 2003 21:43:15 -0600
From: Wayne Fulton <nospam@invalid.com>
Subject: Re: counting in long variable in perl
Message-Id: <oqadnZ3KNfPKCCSiRVn-ig@august.net>
In article <slrnbriq9h.dt0.tadmc@magna.augustmail.com>,
tadmc@augustmail.com says...
>
>That can happen in a multitasking environment when you
>don't implement file locking, and the crufty code you snarfed
>doesn't do file locking.
>
>It was clearly written by an amateur. Be careful with it...
It came from a free script site. I used this one routine out of it to
increment a count file, a long time back. It is locked prior to the call,
via a named file. I know flock is better, important, but not in this
case. The value of this file is the timestamp it was last written, but
since it does count to change that timestamp, I'm curious why it doesnt
count right, why it appears to reset.
A race might occur, but for a counter that can only increment by one, I
dont see how such race could ever reset or decrease the count - it seems
to me that it might only miss a count or two, now and then. Such miss is
not important here in this case, but I'm puzzled why it resets.
>Numbers are double precision floating point internal to perl,
>they can go waaaaay beyond 65536.
That's why I suspected the print statement, but I dont know the cause. I
take it that you you dont think print is doing it.
I have not seen it reset to zero, nor turn over at 65K, that was just my
guess. The evidence I have seen (a few times) is that a prior larger
number like say 41234 might be 12926 next time I look (like after a few
months). I've never seen it past 65K, and I know it is counting several
times an hour, 24/7, so even if it is missing many of the counts, it
should be way over 65K by now, and I dont see how it can ever decrease.
OK, thanks, I will keep looking for the cause. I'll probably add flock
too, but I dont see how that can reset a counter.
------------------------------
Date: 18 Nov 2003 03:58:53 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: counting in long variable in perl
Message-Id: <slrnbrj67t.u5l.sholden@flexal.cs.usyd.edu.au>
On Mon, 17 Nov 2003 21:43:15 -0600, Wayne Fulton <nospam@invalid.com> wrote:
> In article <slrnbriq9h.dt0.tadmc@magna.augustmail.com>,
> tadmc@augustmail.com says...
>>
>>That can happen in a multitasking environment when you
>>don't implement file locking, and the crufty code you snarfed
>>doesn't do file locking.
>>
>>It was clearly written by an amateur. Be careful with it...
>
>
> It came from a free script site. I used this one routine out of it to
> increment a count file, a long time back. It is locked prior to the call,
> via a named file. I know flock is better, important, but not in this
> case. The value of this file is the timestamp it was last written, but
> since it does count to change that timestamp, I'm curious why it doesnt
> count right, why it appears to reset.
>
> A race might occur, but for a counter that can only increment by one, I
> dont see how such race could ever reset or decrease the count - it seems
> to me that it might only miss a count or two, now and then. Such miss is
> not important here in this case, but I'm puzzled why it resets.
If it is of the form:
1. open for reading
2. read number
3. increment number
4. close file #can leave this one out
5. open for writing
6. write number
7. close file
Than there is an obvious race to reset the counter, in fact it's the one
I think I've seen as an example the most since it is the reason why
locking a file after opening it for plain old writing doesn't work.
Two processes execute the code. The first process runs all the way to
step 5 (ie. it has just opened the file for writing) then the second
process starts up and executes steps 1 and 2.
The second process will read nothing from the file, since the first
process truncated it upon opening. Since perl will convert the undef to
0 when arithmetic is done on it, the second process will end up writing
a 1 to the file.
--
Sam Holden
------------------------------
Date: Mon, 17 Nov 2003 22:10:02 -0600
From: Wayne Fulton <nospam@invalid.com>
Subject: Re: counting in long variable in perl
Message-Id: <oqadnZzKNfMABiSiRVn-ig@august.net>
In article <slrnbrj67t.u5l.sholden@flexal.cs.usyd.edu.au>,
sholden@flexal.cs.usyd.edu.au says...
>
>If it is of the form:
>
>1. open for reading
>2. read number
>3. increment number
>4. close file #can leave this one out
>5. open for writing
>6. write number
>7. close file
>
>Than there is an obvious race to reset the counter, in fact it's the one
>I think I've seen as an example the most since it is the reason why
>locking a file after opening it for plain old writing doesn't work.
>
>Two processes execute the code. The first process runs all the way to
>step 5 (ie. it has just opened the file for writing) then the second
>process starts up and executes steps 1 and 2.
>
>The second process will read nothing from the file, since the first
>process truncated it upon opening. Since perl will convert the undef to
>0 when arithmetic is done on it, the second process will end up writing
>a 1 to the file.
Ah so, I can see that reset now. Thanks very much Sam.
------------------------------
Date: 18 Nov 2003 04:50:18 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: counting in long variable in perl
Message-Id: <slrnbrj98d.q43.mgjv@verbruggen.comdyn.com.au>
On Mon, 17 Nov 2003 21:43:15 -0600,
Wayne Fulton <nospam@invalid.com> wrote:
> In article <slrnbriq9h.dt0.tadmc@magna.augustmail.com>,
> tadmc@augustmail.com says...
>>
>>That can happen in a multitasking environment when you
>>don't implement file locking, and the crufty code you snarfed
>>doesn't do file locking.
>>
>>It was clearly written by an amateur. Be careful with it...
>
>
> It came from a free script site.
In that case, maybe you should have a look at
http://nms-cgi.sourceforge.net/ before downloading more from that
site. The NMS stuff is generally of a good quality, and doesn't suffer
from many problems that other free CGI stuff suffers from.
They do have a counter script there as well.
Martien
--
|
Martien Verbruggen | If it isn't broken, it doesn't have enough
Trading Post Australia | features yet.
|
------------------------------
Date: Tue, 18 Nov 2003 01:10:00 -0600
From: Wayne Fulton <nospam@invalid.com>
Subject: Re: counting in long variable in perl
Message-Id: <guqdnTISrpF8WCSiRVn-uw@august.net>
In article <slrnbrj98d.q43.mgjv@verbruggen.comdyn.com.au>,
mgjv@tradingpost.com.au says...
>
>In that case, maybe you should have a look at
>http://nms-cgi.sourceforge.net/ before downloading more from that
>site. The NMS stuff is generally of a good quality, and doesn't suffer
>from many problems that other free CGI stuff suffers from.
Thanks Martien. Looks good, I will bookmark it, but meanwhile
I have implemented the flock method referenced in perldoc.
Best part is that I think I've learned something too.
------------------------------
Date: Tue, 18 Nov 2003 06:58:08 GMT
From: =?UTF-8?b?TMSByrtpZSBUZWNoaWU=?= <laie@wing_this_etsolutions.com>
Subject: Re: Help
Message-Id: <cdb9e5c9b1e4a1ec4aef10ffb781696d@news.teranews.com>
On Sat, 15 Nov 2003 06:09:56 -0800, Rob wrote:
> I have a small CGI script that attempts to create a file on the fly.
> The script runs successfully from the command prompt. Although when I
> execute in a browser the file does not get created and therefore the
> contents are not displayed on the page. I have try several different
> approaches all have fialed to correct this issue. I have checked the
> promissions, I am login in under the httpd userid, I have checked the
> rc on the system command(see below), and have hit the wall.
>
> HERE IS THE SCRIPT:
> ****************************************************************************
> #!/usr/bin/perl -w
> use strict;
> use CGI ':standard';
>
> my @fcetabs;
> my @tablist;
> my $dbin=param('database');
>
> system("./list $dbin _ list.$$")
> || print "Bad Return Code from system call: $?\n
Why do you reference "list" using a relative path? Are you sure the
current directory when your server executes the script?
If the execution of "list" fails, don't you want to croak or die instead
of merely printing to STDOUT? Does "list" print anything to STDOUT which
may mess up your HTTP headers?
[snip rest of code /]
> HERE IS THE OUTPUT FROM THE COMMAND LINE:
> ****************************************************************************
> /cgi-bin> listfce.cgi database=sample
> Bad Return Code from system call: 0
A return value of "0" indicates success. Perhaps you should use "and"
instead of "||".
Aloha,
La'ie Techie
------------------------------
Date: Tue, 18 Nov 2003 05:35:25 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: MIME::Lite - HTML Message and pdf Attaching at the same time
Message-Id: <3fb9ae86.615101473@news2.news.adelphia.net>
On Mon, 17 Nov 2003 23:43:46 GMT, "John B. Kim" <provicon@earthlink.net> wrote:
>=======================================================
>Now I want to send HTML message, and changed the code above as below:
>=======================================================
>use strict;
>use MIME::Lite;
>use Net::SMTP;
>my $from = 'askjinu@yahoo.com';
>my @addweek1 = qw(askjinu@yahoo.com
> askjinu@yahoo.com);
>my $Fnameweek1 = 'issue1.pdf';
>my $subject='Study Guide from JinuAcademy';
>
>for my $address (@addweek1) {
>
>my $msg = MIME::Lite->new (
> From => $from,
> To => $address,
> Subject => $subject,
> Type =>'multipart/related');
>$msg->attach (
> Type => 'text/html',
> Data => qq{<body>Here's my message.</body>});
>$msg->attach (
> Type => 'x-pdf',
> Path => "c:\\guide\\$Fnameweek1",
> ReadNow => 1,
> Filename => $Fnameweek1);
>MIME::Lite->send('smtp', 'smtp.earthlink.net');
>$msg->send();
>}
>=================================================
>The problem with above code is that the message comes as HTML, but pdf file
>attachment does not go through. It simply does not carry out the file
>attachment.
Strange. I don't see any reason for this. Have you looked at the raw message
that is sent, to see if the attachment is there or not?
Your html attached data is not valid HTML, but I doubt that's relevant. You
coud try q{<html><body> See below </body></html>} though. Maybe the invalid
HTML is confusing the mail reader somehow.
---
Use the domain skylightview (dot) com for the reply address instead.
------------------------------
Date: Tue, 18 Nov 2003 05:50:20 GMT
From: "Greg Patnude" <gpatnude@adelphia.net>
Subject: Re: MIME::Lite - HTML Message and pdf Attaching at the same time
Message-Id: <wqiub.3430$m84.2044406@news1.news.adelphia.net>
Look at your path & filename in the third block -- They are the problem --
your code cannot find the file...
--
Greg Patnude / The Digital Demention
2916 East Upper Hayden Lake Road
Hayden Lake, ID 83835
(208) 762-0762
"John B. Kim" <provicon@earthlink.net> wrote in message
news:S2dub.4061$sb4.1770@newsread2.news.pas.earthlink.net...
> I run the code below, and it works perfectly fine:
> ==================================================
> use strict;
> use MIME::Lite;
> use Net::SMTP;
> my $from = 'askjinu@yahoo.com';
> my @addweek1 = qw(askjinu@yahoo.com provicon@earthlink.net
> askjinu@yahoo.com askjinu@yahoo.com);
> my $Fnameweek1 = 'issue1.pdf';
> my $subject='Study Guide from JinuAcademy';
>
> for my $address (@addweek1) {
> my $msg = MIME::Lite->new (
> From => $from,
> To => $address,
> Subject => $subject,
> Data => "This is a wonderful world. ".
> "MIME::Lite is working out fine.".
> "with pdf attachment" );
> $msg->attach (
> Type => 'x-pdf',
> Path => "c:\\guide\\$Fnameweek1",
> ReadNow => 1,
> Filename => $Fnameweek1);
> MIME::Lite->send('smtp', 'smtp.earthlink.net');
> $msg->send();
> }
> =======================================================
> Now I want to send HTML message, and changed the code above as below:
> =======================================================
> use strict;
> use MIME::Lite;
> use Net::SMTP;
> my $from = 'askjinu@yahoo.com';
> my @addweek1 = qw(askjinu@yahoo.com
> askjinu@yahoo.com);
> my $Fnameweek1 = 'issue1.pdf';
> my $subject='Study Guide from JinuAcademy';
>
> for my $address (@addweek1) {
>
> my $msg = MIME::Lite->new (
> From => $from,
> To => $address,
> Subject => $subject,
> Type =>'multipart/related');
> $msg->attach (
> Type => 'text/html',
> Data => qq{<body>Here's my message.</body>});
> $msg->attach (
> Type => 'x-pdf',
> Path => "c:\\guide\\$Fnameweek1",
> ReadNow => 1,
> Filename => $Fnameweek1);
> MIME::Lite->send('smtp', 'smtp.earthlink.net');
> $msg->send();
> }
> =================================================
> The problem with above code is that the message comes as HTML, but pdf
file
> attachment does not go through. It simply does not carry out the file
> attachment.
>
> Can anybody tell me how I should change above code so that the message is
in
> HTML and the pdf attachment goes through?
>
> Any help will be deeply appreciated.
>
> Thanks.
>
> John
>
>
------------------------------
Date: Tue, 18 Nov 2003 06:33:40 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: MIME::Lite - HTML Message and pdf Attaching at the same time
Message-Id: <20031118013340.21afcf77.jwillmore@remove.adelphia.net>
On Mon, 17 Nov 2003 23:43:46 GMT
"John B. Kim" <provicon@earthlink.net> wrote:
<snip>
> =======================================================
> Now I want to send HTML message, and changed the code above as
> below:=======================================================
> use strict;
> use MIME::Lite;
Don't need the Net::SMTP. Doesn't hurt anything, you just don't
*need* it.
<snip>
> my $msg = MIME::Lite->new (
> From => $from,
> To => $address,
> Subject => $subject,
> Type =>'multipart/related');
> $msg->attach (
> Type => 'text/html',
> Data => qq{<body>Here's my message.</body>});
> $msg->attach (
> Type => 'x-pdf',
> Path => "c:\\guide\\$Fnameweek1",
> ReadNow => 1,
#from the MIME::Lite POD
Disposition => 'attachment',
> Filename => $Fnameweek1);
> MIME::Lite->send('smtp', 'smtp.earthlink.net');
> $msg->send();
> }
> =================================================
> The problem with above code is that the message comes as HTML, but
> pdf file attachment does not go through. It simply does not carry
> out the file attachment.
Just add the 'Disposition' line and it *should* be fine.
>
> Can anybody tell me how I should change above code so that the
> message is in HTML and the pdf attachment goes through?
>
> Any help will be deeply appreciated.
And any was offered :-)
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Smoking is one of the leading causes of statistics. -- Fletcher
Knebel
------------------------------
Date: 17 Nov 2003 18:25:00 -0800
From: jwillmore@myrealbox.com (James Willmore)
Subject: Re: multilinepattern match
Message-Id: <d61170e5.0311171825.26178520@posting.google.com>
genericax@hotmail.com (Sara) wrote in message news:<776e0325.0311171042.1adbfb60@posting.google.com>...
<snip>
> #!/usr/bin/perl -wd
Just a suggestion ...
when posting code, please avoid using the '-d' switch. I realize that
it throws one into the debugger, but others may not. Given the
various states of experience in Perl found in this newsgroup, this
could confuse the not so experienced reader.
Again - just a suggestion :-)
> $_ = "a bunch of
> stuff
> is here..
> end;
> /
> thats all
> folks";
Another suggestion is avoid setting '$_'. It's a special variable and
one should avoid setting it. Again - I understand what you're trying
to demonstrate, but those less experienced may not.
Again - just a suggestion ;-)
Jim
(jwillmore _at_ adelphia _dot_ net)
------------------------------
Date: Tue, 18 Nov 2003 04:04:14 GMT
From: Default@User011011101101.net
Subject: Re dbmopen question
Message-Id: <2Tgub.30815$hB5.26003@nwrdny02.gnilink.net>
Ahh thanks for the tips :-)
Ok i got the GetOptions module working now and I'm
quite happy with it.. although its way more code than I was using
its certainly more scaleable, thats very good!
Haven't gotten around to trying out that map command yet but im
going to try it that way next. Thanks again for the help.
PS i still have no idea what those number are about
im just gonna use 0666 hehheh <girn>
------------------------------
Date: Mon, 17 Nov 2003 18:10:43 -0800
From: "Trent Curry" <tcurrey@no.no.i.said.no>
Subject: Re: regex to convert 1000000 -> 1,000,000 ?
Message-Id: <bpbv83$s9i$1@news.astound.net>
Tore Aursand wrote:
> On Mon, 17 Nov 2003 12:41:16 -0800, Wally Sanford wrote:
>>> Well, if you come to this group, the posting guidelines, posted
>>> twice every week, if you *read* the group before *post* to it, like
>>> you should (remember why the good Lord gave two ears and only one
>>> mouth!)
>
>> Twice a week? I have seen them posted at all the last few months.
>
> Then you are blind. The posting guidelines have been posted in this
> newsgroup 13 times since October 3rd this year. The last posting was
> on November 14th.
No need to be so rude. They never show up on my server, and I'm
obviously not the only one. They are shown in google groups though. As I
said already, it could be a problem with the outgoing feed from the
server tad uses to post those FAQ posts. I even emptied my kill file and
re-downloaded the last 500 headers and it still does not show. Someone
else had posted that the they have not been able to get those posts
after being through 3 different news servers, so it leads me to believe
it's something with tad's server.
--
Trent Curry
perl -e
'($s=qq/e29716770256864702379602c6275605/)=~s!([0-9a-f]{2})!pack("h2",$1
)!eg;print(reverse("$s")."\n");'
------------------------------
Date: 18 Nov 2003 03:05:09 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: regex to convert 1000000 -> 1,000,000 ?
Message-Id: <slrnbrj335.tgi.sholden@flexal.cs.usyd.edu.au>
On Mon, 17 Nov 2003 17:26:56 -0800,
Wally Sanford <wsanford@wallysanford.com> wrote:
> Abigail wrote:
> [Abigail's Non standard broken quoting fixed;
> Btw why do you continue to post like this knowing it breaks many
> quoting schemes that readers use, inparticular color coding???]
>
>> Wally Sanford (wsanford@wallysanford.com) wrote on MMMDCCXXX September
>> MCMXCIII in URL:news:bpb5eg$1kqno4$1@ID-196529.news.uni-berlin.de:
>>
>>> If they are unixsavy they might try something like: $ perl --help
>>> grep doc
>>
>> No, if they are Unix savy, they try "man perl", and guess what? On the
>> second page it mentions the FAQ!
>
> $ man perl | grep -i faq
> perlfaq Perl frequently asked questions
> perlfaq1 General Questions About Perl
> perlfaq2 Obtaining and Learning about Perl
> perlfaq3 Programming Tools
> perlfaq4 Data Manipulation
> perlfaq5 Files and Formats
> perlfaq6 Regexes
> perlfaq7 Perl Language Issues
> perlfaq8 System Interaction
> perlfaq9 Networking
>
> It *mentions* perlfaq but says NOTHING of how to *access* it. Thats whe
> whole point ehre.
Strangely enough rather than reading randomly selected lines of the man page
the idea is to read the text as you normally would (ie. start at the top
and work your way down). You search to find parts that might be useful
but you don't just read the line that happens to contain the search
term you used. You read the context.
For anyone with more than one brain cell it is *obvious* that the list of
sections you are selecting lines from are individual man pages.
For starters it's a man page, and hence referenced like that would be
expected to be man pages unless labelled otherwise.
Secondly, the first non-parenthical sentence after the list is:
By default, the manpages listed above are installed in the
/usr/local/man/ directory.
Stating that they are "manpages".
Thirdly, two paragraphs down a paragrpah starts with :
You should be able to view Perl's documentation with your man(1) program
Explicitely stating how you can read said manpages.
And so on and so on (those quotes are from my install of perl, it'll be
different for different versions and at different sites).
You have to try pretty hard (by say only reading individual lines with
no context) to not find out how to read the documentation.
Do you read books with this strange select a few lines and only read
them approach?
--
Sam Holden
------------------------------
Date: 18 Nov 2003 03:10:34 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: regex to convert 1000000 -> 1,000,000 ?
Message-Id: <slrnbrj3da.tgi.sholden@flexal.cs.usyd.edu.au>
On Mon, 17 Nov 2003 19:27:57 -0600,
Eric J. Roode <REMOVEsdnCAPS@comcast.net> wrote:
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> sholden@flexal.cs.usyd.edu.au (Sam Holden) wrote in
> news:slrnbrintt.qln.sholden@flexal.cs.usyd.edu.au:
>
>> On 17 Nov 2003 23:24:44 GMT, Abigail <abigail@abigail.nl> wrote:
>>>
>>> I can't recall in my many years of getting an education to have
>>> attended a school without a student guide full of frequently needed
>>> information.
>>
>> But that isn't a FAQ. Maybe schools in your part of the world are
>> different than over here. But over here I've never seen something that
>> resembles a FAQ, something with a list of questions which are have
>> actually been asked frequently (or even just once) with answers.
[snip "trivia"]
>
> I got a FAQ (it wasn't called that; the term had not yet been invented)
> when I started college. It didn't have such trivia as the above, but it
> did have the answers to such questions as:
[snip questions]
Ah yes, "your part of the world" comes into play. Schools and colleges
and universities are distinct terms in the local dialect I speak. I agree
that universities usually have very good guides.
Primary and secondary schools over here, seem not to. Well the ones I
attended way back when.
--
Sam Holden
------------------------------
Date: Tue, 18 Nov 2003 04:37:36 +0100
From: Tore Aursand <tore@aursand.no>
Subject: Re: regex to convert 1000000 -> 1,000,000 ?
Message-Id: <pan.2003.11.18.02.11.30.760474@aursand.no>
On Mon, 17 Nov 2003 17:26:56 -0800, Wally Sanford wrote:
>>> If they are unixsavy they might try something like: $ perl --help grep
>>> doc
>> No, if they are Unix savy, they try "man perl", and guess what? On the
>> second page it mentions the FAQ!
> [...]
> It *mentions* perlfaq but says NOTHING of how to *access* it. Thats whe
> whole point ehre.
Huh? If you are able to type in 'man perl', why shouldn't you be able to
type in 'man perlfaq' (or one of the other manual pages)?
It's not Perl's problem that people don't know how to read documentation
on their OS.
--
Tore Aursand <tore@aursand.no>
------------------------------
Date: Tue, 18 Nov 2003 02:42:18 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: regexp on HTML
Message-Id: <eGfub.68807$E9.45530@nwrddc01.gnilink.net>
Bart van den Burg wrote:
> I need to empty the very last cell that can be found in $r
>
> Currently, I have
> $r =~ s:<td>.*</td></tr>$:<td></td></tr>:;
>
> But that merges all cells into one empty cell...
> Any ideas on how to do this?
This is getting really old.
Why don't you read the FAQ and http://www.badtz.org/pics/bart.gif before
finding out the hard way that REs are not powerful enough to parse HTML?
jue
------------------------------
Date: Mon, 17 Nov 2003 20:06:06 -0800
From: "Austin P. So (Hae Jin)" <haejin@ubc.ca>
Subject: Re: running a sub inside regex
Message-Id: <bpc5ri$cud$1@nntp.itservices.ubc.ca>
Tad McClellan wrote:
> Austin P. So (Hae Jin) <haejin@ubc.ca> wrote:
>>BTW...where is a reference for subroutine calls within a regex?
> Step 1 is to recognize that it isn't the regexness that matters,
> it is the double-quotishness that matters.
Uh...okay...obviously I haven't gotten to a point where I've had to
understand these kinds of subtleties in perl...
> Step 2 is to lookup subroutine calls within a double-quotish string. :-)
> perldoc -q expand
> How do I expand function calls in a string?
Hmmm...I guess I never really thought about the search pattern within a
regex to be considered a "double-quotish string"...
Austin
------------------------------
Date: Tue, 18 Nov 2003 03:29:53 GMT
From: Jeff Boes <jboes@qtm.net>
Subject: Re: where is DBI::DWIM?
Message-Id: <125ac75a8e2f4a642fdcfabddd5559db@news.teranews.com>
At some point in time, Eric Wilhelm <ewilhelm@somethinglike.sbcglobalDOTnet>
wrote:
>
>Otherwise, tell me why this is crazy before I go write DBI::DWIM
>
Quite a few, actually. I think what you are looking for are the various things
in the DBIx::* module grouping. (Ironically, there's even a "DBIx::DWIW" class.)
------------------------------
Date: Tue, 18 Nov 2003 05:10:48 GMT
From: "Greg Patnude" <gpatnude@adelphia.net>
Subject: Re: where is DBI::DWIM?
Message-Id: <sRhub.3421$m84.2034687@news1.news.adelphia.net>
Your concept of what SQL can do may be truncated...
UPDATE tbl WHERE condition....
--
Greg Patnude / The Digital Demention
2916 East Upper Hayden Lake Road
Hayden Lake, ID 83835
(208) 762-0762
"Eric Wilhelm" <ewilhelm@somethinglike.sbcglobalDOTnet> wrote in message
news:pan.2003.11.17.14.05.50.969954.1618@somethinglike.sbcglobalDOTnet...
> This is partly an SQL question but I'm also trying to find out if there is
> a perl module that has already solved it. Searching CPAN, google, and
> reading the DBI/DBD docs seems to indicate that this is just the status
> quo.
>
> I am new to SQL, but I'm shocked by the fact that there is no "set the
> value of this column in this row" command. I can INSERT or UPDATE, but
> first I must SELECT to see if the row already exists (unless I disable
> some warnings, do with autocommit and just '$ins->(@vals) or
> $upd->(@vals)', but this still requires me to write two SQL statements
> which basically express the same desire and then prepare two statement
> handles.
>
> At best, it seems to double (or triple) the amount of SQL-related code,
> but at worst, it inherently violates the "single point of truth" rule.
>
> REPLACE is not a good solution, since the rest of the row's contents
> should be left intact (but if it isn't there, we just want to create it
> and get on with our lives.)
>
> It seems like an UPDATE statement could easily enough be translated into
> the required INSERT statement (but maybe I haven't thought forward far
> enough in this idea.)
>
> If anyone could give me a tip that would allow one "statement of intent"
> to create whatever SQL statements are needed, that would be great.
>
> Otherwise, tell me why this is crazy before I go write DBI::DWIM
>
> With all of the sql use via Perl and the tendency of Perl to make you
> want to be consise, I would think that some kind of "make it so" function
> would have been cooked up by now.
>
> Thanks,
> Eric
------------------------------
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 5821
***************************************