[13982] in Perl-Users-Digest
Perl-Users Digest, Issue: 1392 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 16 06:08:59 1999
Date: Tue, 16 Nov 1999 03:05:16 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942750316-v9-i1392@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 16 Nov 1999 Volume: 9 Number: 1392
Today's topics:
another Net::LDAP problem <m.scheferhoff@gmx.de>
Re: Can't get hostname with gethostbyaddr <gellyfish@gellyfish.com>
Re: Clarification of threads and locking <sisl@ihug.co.nz>
Re: developer required for advanced Perl work (Bretto)
Re: developer required for advanced Perl work <uri@sysarch.com>
Re: developer required for advanced Perl work <flavell@mail.cern.ch>
Re: FastCGI (wasRe: localtime object y2k compliant?) (Mark W. Schumann)
Re: Generating pi (Anno Siegel)
Re: Generating pi (Ilya Zakharevich)
Re: Generating pi (Anno Siegel)
getting started with MySQL and Perl <breville@mpce.mq.edu.au>
Re: Help (back for guru): using setsid() to invoke diss <rhear@cs.winthrop.edu>
Re: Help (back for guru): using setsid() to invoke diss <rhear@cs.winthrop.edu>
How to control the cursor's movement? <cyshieh@sis.com.tw>
Re: How to control the cursor's movement? <slanning@bu.edu>
Re: How to install DBI module in Win98 <crt@kiski.net>
Re: How to install DBI module in Win98 <rhardicr@mail.ford.com>
Re: how to step through list (Abigail)
Longest match (Bart Lateur)
Re: Making a Perl/Tk standalone executable (Abigail)
Move files. . . <sbrook@nildram.co.uk>
Re: Multiple scripts <anovikov@heron.itep.ru>
Re: Need help with arrays. <snapperhead_420NOsnSPAM@hotmail.com.invalid>
Re: Netscape messenger or other mail client accessable, <ter@my-deja.com>
O, and the answer is - <reembar@netvision.net.il>
Re: O, and the answer is - <uri@sysarch.com>
Re: O, and the answer is - (Craig Berry)
Re: OO woes (Abigail)
Re: OO woes (Damian Conway)
Re: OO woes (Damian Conway)
Problem with the sentence "use Win32::ODBC;" <n.vincentNOn.SPAM@cross-systems.com.invalid>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 16 Nov 1999 09:06:44 +0100
From: Michael Scheferhoff <m.scheferhoff@gmx.de>
Subject: another Net::LDAP problem
Message-Id: <38311094.E71042BB@gmx.de>
Hello,
I want to use the Net::LDAP module to access our Exchange Server, first
to get the email adresses of persons and to authenticate persons. Our
Exchange Server has everything enabled:
-anonymous
-clear text
-clear text SSL
-challenge/response
-challenge/response SSL
Anonymous access is no problem, but when I try to connect with the clear
text authentication method I can't connect. The code looks like:
use Mozilla::LDAP::Conn;
use Mozilla::LDAP::Utils;
$user=$ARGV[0]; #user name
$pass=$ARGV[1];#and his password
$conn = new Mozilla::LDAP::Conn("erra", "389", $user, $pass);
die "Could't connect to LDAP server ERRA" unless $conn;
Me not being a ldap specialist I have some problems with the $user
variable. In the manual is written that this should be the "bind DN". I
take the normal user name. Is this wrong?
Thanks for your help,
Michael
------------------------------
Date: 16 Nov 1999 10:12:18 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Can't get hostname with gethostbyaddr
Message-Id: <38312e02_2@newsread3.dircon.co.uk>
AcCeSsDeNiEd <dillon_rm@magix.com.sg> wrote:
> Hi,
> I'm trying to get the hostname from an IP address.
>
> My webhost does have the "hostname" and "socket" modules installed.
>
> The OS is: UNIX Type: L8(SCO UNIX Release 3.2v5.0.5, on Pentium)
>
> Perl Version: version 5.004_04 built for i486-pc-sco3.2v5.0
>
Works for me:
This is perl, version 5.005_03 built for i386-sco
SCO_SV pigment 3.2 5.0.5 i386
pigment.dircon.net] $ perl hostname.pl
shoot.pacific.net.sg
Maybe your resolver is broken on this machine of course that is a question
for one of the comp.unix.sco.* groups ...
/J\
--
"The most frightening thing on television since Anthea Turner revealed
she had a sister" - Suggs
------------------------------
Date: Tue, 16 Nov 1999 21:18:52 +1300
From: Grant McLean <sisl@ihug.co.nz>
Subject: Re: Clarification of threads and locking
Message-Id: <3831136C.CCEBFD69@ihug.co.nz>
Thank you Abigail for a lucid explanation. Looks like I've got some
more work to do.
Regards
Grant
Abigail wrote:
>
> Grant McLean (sisl@ihug.co.nz) wrote
> "" Tuomas J. Lukka said:
> "" > you should get the lock EVEN IF MANY THREADS ONLY READ THE
> "" > VARIABLE AND NO-ONE WRITES.
> "" Is this correct? If so, can someone explain why?
> Because reading a variable might change it.
>
> Consider:
>
> $foo = "3"; # $foo is a string.
> print 4 + $foo; # $foo is used in numerical context.
>
> When doing 4 + $foo, $foo is used in numerical context. However, all we
> have is "3", a string. Perl makes a number out of "3" *AND UPDATES THE
> VARIABLE BEHIND THE SCENES*. Now, $foo will have both "3" and 3 internally,
> so the next time $foo is used in numerical context, Perl doesn't have to
> turn a string into a number.
>
> "" I'm trying to make sure that one of my modules is thread safe
> "" and had assumed that making sure that all shared variables were
> "" either read-only or locked during reads/writes would be enough.
>
> No, that's not enough.
Thanks again
------------------------------
Date: Tue, 16 Nov 1999 06:11:54 GMT
From: news@moggy.com (Bretto)
Subject: Re: developer required for advanced Perl work
Message-Id: <3830f45b.30425120@news.lisp.com.au>
Thanks for your direction.
Rude, ignorant, but to the point.
------------------------------
Date: 16 Nov 1999 01:33:07 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: developer required for advanced Perl work
Message-Id: <x7iu33uesb.fsf@home.sysarch.com>
>>>>> "B" == Bretto <news@moggy.com> writes:
B> Thanks for your direction.
B> Rude, ignorant, but to the point.
hit you over the head with a clue stick, aware of the scope of this
group and it may have worked.
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: Tue, 16 Nov 1999 11:12:22 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: developer required for advanced Perl work
Message-Id: <Pine.HPP.3.95a.991116111202.14630D-100000@hpplus01.cern.ch>
On Tue, 16 Nov 1999, Bretto wrote:
> Rude, ignorant,
Yes, you were.
--
* Progress (n.): The process through which Usenet has evolved from
smart people in front of dumb terminals to dumb people in front of
smart terminals. -- obs@burnout.demon.co.uk
------------------------------
Date: 16 Nov 1999 00:35:28 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: FastCGI (wasRe: localtime object y2k compliant?)
Message-Id: <80qqf0$ve@junior.apk.net>
In article <Y0ZX3.13790$YI2.640682@typ11.nn.bcandid.com>,
Kragen Sitaker <kragen@dnaco.net> wrote:
>Have you used FastCGI? Does it live up to OpenMarket's performance
>claims? Is it easy to use from Perl?
0. Yes.
1. It's "fast," whatever OM says.
2. Yes, but you have to recompile Apache if that's what you're using.
------------------------------
Date: 16 Nov 1999 09:12:25 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Generating pi
Message-Id: <80r75q$fc$1@lublin.zrz.tu-berlin.de>
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote in comp.lang.perl.misc:
>[A complimentary Cc of this posting was sent to Anno Siegel
><anno4000@lublin.zrz.tu-berlin.de>],
>who wrote in article <80on94$usd$1@lublin.zrz.tu-berlin.de>:
>> >This one is quite fast, and will print out all the digits of pi:
>
>> > perl -we 'print "3."; {redo if print int rand 10}'
>
>> True if and only if pi contains infinitely many copies of each
>> possible digit. Is that known about pi?
>
>Why do you think this script will print infinitely many copies of each
>possible digit? Perl's rand() is not necessarily mapping to C rand(),
>you know...
I am sure something is escaping me in your reply. Anyhow...
I you assume about Perl's rand() what is true of all pseudo-random
generators, that it has an internal state that determines the next
number issued as well as the next state, it follows that the sequence
of random numbers will eventually become cyclic (there are only finitely
many states). So, unless a digit is missing from the resulting
cycle of digits (an event of negligible likelihood), every digit
will be generated an infinite number of times.
Anno
------------------------------
Date: 16 Nov 1999 09:32:46 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Generating pi
Message-Id: <80r8bu$kcb$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Anno Siegel
<anno4000@lublin.zrz.tu-berlin.de>],
who wrote in article <80r75q$fc$1@lublin.zrz.tu-berlin.de>:
> >Why do you think this script will print infinitely many copies of each
> >possible digit? Perl's rand() is not necessarily mapping to C rand(),
> >you know...
>
> I am sure something is escaping me in your reply. Anyhow...
>
> I you assume about Perl's rand() what is true of all pseudo-random
> generators, that it
Why do you think rand() is pseudo-random? It may be *random*. There
was some discussion on p5p about reading /dev/*random last year...
Ilya
------------------------------
Date: 16 Nov 1999 11:00:09 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Generating pi
Message-Id: <80rdfp$m7$1@lublin.zrz.tu-berlin.de>
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote in comp.lang.perl.misc:
>[A complimentary Cc of this posting was sent to Anno Siegel
><anno4000@lublin.zrz.tu-berlin.de>],
>who wrote in article <80r75q$fc$1@lublin.zrz.tu-berlin.de>:
>> >Why do you think this script will print infinitely many copies of each
>> >possible digit? Perl's rand() is not necessarily mapping to C rand(),
>> >you know...
>>
>> I am sure something is escaping me in your reply. Anyhow...
>>
>> I you assume about Perl's rand() what is true of all pseudo-random
>> generators, that it
>
>Why do you think rand() is pseudo-random? It may be *random*. There
>was some discussion on p5p about reading /dev/*random last year...
Not to belabor the point, but until further notice pseudo-randomness
still seems to be a reasonable assumption about a rand() function.
Though progress seems to be irresistible.
Anno
------------------------------
Date: Tue, 16 Nov 1999 19:52:41 +1100
From: "Brendan Reville" <breville@mpce.mq.edu.au>
Subject: getting started with MySQL and Perl
Message-Id: <80r65a$5vo$1@sunb.ocs.mq.edu.au>
hi all,
My ISP has installed Perl and MySQL, but apparently not the modules that let
Perl talk to MySQL.
First, I got them to install the "Msql-Mysql-modules" tar, which I thought
was the DBI layer. But now when I try running my simple Perl test script, I
get the following message.
install_driver(mysql) failed: Can't find 'boot_DBD__mysql' symbol
in /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
Which perhaps (!?) indicates that the DBD module is missing. Any idea what
I need to do to fix this?
Thanks heaps
- Brendan
P.S. If there's a better newsgroup for MySQL queries, please let me know.
My newsserver didn't list mysql in any newsgroup names.
------------------------------
Date: Tue, 16 Nov 1999 06:19:44 +0000
From: "Ryan T. Rhea" <rhear@cs.winthrop.edu>
Subject: Re: Help (back for guru): using setsid() to invoke dissassociated child -
Message-Id: <3830F780.63C17109@cs.winthrop.edu>
> Well, first of all, can't you simply exec() your shell from the perl
> process?
>
> Otherwise, the double fork is really a simple maneuver. You fork
> a subprocess (parent exits). The child forks again and exits, while
> the grandchild exec's the shell.
>
> Anno
Thanks again. I was looking too hard :)
Anybody know why the environment (i.e. PATH) doesn't get set correctly when
bash starts?
Ryan T. Rhea
Winthrop University
rhear@cs.winthrop.edu
------------------------------
Date: Tue, 16 Nov 1999 06:56:47 +0000
From: "Ryan T. Rhea" <rhear@cs.winthrop.edu>
Subject: Re: Help (back for guru): using setsid() to invoke dissassociated child -
Message-Id: <3831002E.AD257AB3@cs.winthrop.edu>
"Ryan T. Rhea" wrote:
> > Well, first of all, can't you simply exec() your shell from the perl
> > process?
> >
> > Otherwise, the double fork is really a simple maneuver. You fork
> > a subprocess (parent exits). The child forks again and exits, while
> > the grandchild exec's the shell.
> >
> > Anno
>
> Thanks again. I was looking too hard :)
>
> Anybody know why the environment (i.e. PATH) doesn't get set correctly when
> bash starts?
>
> Ryan T. Rhea
> Winthrop University
> rhear@cs.winthrop.edu
I answered my own question (again)...
Running exec("bash --login") sets up the environment exactly the way it
normally would (as if mingetty invoked bash from '/etc/passwd').
Thanks again,
Ryan
------------------------------
Date: 16 Nov 1999 09:10:37 GMT
From: "cyshieh" <cyshieh@sis.com.tw>
Subject: How to control the cursor's movement?
Message-Id: <80r72d$1r4$1@news.seed.net.tw>
hi all:
How can I control the cursor's movement under MS-DOS?
ex.
C:\> 1 <- print 1
C:\> 2 <- print 2 at the same line and pos
... ...
C:\> 5000 <- print 5000 at the same line and pos
Thanks!
------------------------------
Date: 16 Nov 1999 05:02:02 -0500
From: Scott Lanning <slanning@bu.edu>
Subject: Re: How to control the cursor's movement?
Message-Id: <kusn1seah5x.fsf@strange.bu.edu>
"cyshieh" <cyshieh@sis.com.tw> writes:
> How can I control the cursor's movement under MS-DOS?
> ex.
> C:\> 1 <- print 1
> C:\> 2 <- print 2 at the same line and pos
> ... ...
> C:\> 5000 <- print 5000 at the same line and pos
Do you simply want to overwrite the char? Like using backspace?
my $bs = "\010";
my $i = 1000;
while($i--){
print $i, $bs x 4;
}
or maybe in DOS you can use a carriage return:
my $cr = "\015";
my $i = 1000;
while($i--){
print $i, $cr;
}
but I don't have DOS, so... If it were Unix, I'd say
get the curses module from CPAN, but..
--
"If lightning is the anger of the gods, the gods are concerned mostly
with trees." --Lao Tse
------------------------------
Date: Mon, 15 Nov 1999 23:25:57 -0500
From: "Casey R. Tweten" <crt@kiski.net>
Subject: Re: How to install DBI module in Win98
Message-Id: <Pine.OSF.4.10.9911152325070.26406-100000@home.kiski.net>
On Tue, 16 Nov 1999, Ong wrote:
:How to install DBI module and make it run in Windows 98?
Read the documentation. *cough* ppm *cough*
:Kindly guide. Thank You.
No problem, have fun!
--
Casey R. Tweten y2k solution
Web Developer (free)
HighVision Associates s/y/k/ig;
crt@highvision.com japh
------------------------------
Date: Tue, 16 Nov 1999 09:11:49 +0000
From: Richard H <rhardicr@mail.ford.com>
Subject: Re: How to install DBI module in Win98
Message-Id: <38311FD5.E1DB01C6@mail.ford.com>
Ong wrote:
>
> How to install DBI module and make it run in Windows 98?
>
> Kindly guide. Thank You.
read the docs on 'ppm',
and if that doesnt work for whatever reason look at the binary list on :
http://www.activestate.com/packages
Richard H
------------------------------
Date: 16 Nov 1999 03:48:54 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: how to step through list
Message-Id: <slrn832aal.cvu.abigail@alexandra.delanet.com>
Kevin J. Davis (kev@tnw.org) wrote on MMCCLXVII September MCMXCIII in
<URL:news:B455CD63.3F2%kev@tnw.org>:
\\
\\ Here is some sample code in hopes that helps someone understand my quandry
\\ better :-)
\\
\\ To populate list @processingorders:
\\
\\ opendir (PROCESSING, "$orders_processing_path") || &CGIDie("Unable to
\\ open $orders_processing_path: $!");
\\ @processingorders = grep(/\.order/,readdir(PROCESSING));
\\
\\ $number_in_process = @processingorders;
\\
\\ print qq!
\\ The following orders are now marked "in process":\n
\\ <BR><BR>
\\ <FONT SIZE="-1">
\\ <OL>\n!;
That's illegal HTML.
\\ foreach $processingorder (@processingorders)
\\ {
\\ print qq!<LI> <A HREF="$temp_link?view_order=$processingorder"> Web
\\ Order \#$processingorder</A>\n!;
\\ }
\\
\\ closedir (PROCESSING);
\\
\\ So you see all I can do is show them in an HTML bulleted list. I would like
\\ to take list (219812.order,238935.order,9035709.order...) and view one, hit
\\ "next" button and automatically run the "view_order" routine on the next in
\\ the list. It would be nice if I go then move back and forth.
In your $temp_link program:
my $me = $cgi -> param ("view_order");
open PROCESSING, $orders_processing_path or die "...";
my @processingorders = sort grep /\.order/ => readdir PROCESSING;
my ($next, $prev);
foreach (my $i = 0; $i < @processingorders; $i ++) {
if ($processingorders [$i] eq $me) {
($prev, $next) = @processingorders [$i - 1, $i + 1];
last;
}
}
print "<a href = '$temp_link?view_order=$next'>Next</a>" if defined $next;
print "<a href = '$temp_link?view_order=$prev'>Prev</a>" if defined $prev;
Abigail
--
$" = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_) {print "$_ $_{$_} "}};
%_ = (Just => another => Perl => Hacker); &{%_};
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 16 Nov 1999 08:51:53 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Longest match
Message-Id: <383518e5.1648573@news.skynet.be>
Imagine you have the text snippet:
$_ = 'this is one that's two and this is three';
How can you easily find the longest substring of only spaces (at least
two)? Maybe even using only one regex? The aim is to find the best place
to cut text like this into two columns.
--
Bart.
------------------------------
Date: 16 Nov 1999 03:53:44 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Making a Perl/Tk standalone executable
Message-Id: <slrn832ajo.cvu.abigail@alexandra.delanet.com>
Christian Brunet (cbrunet@locus.ca) wrote on MMCCLXVII September MCMXCIII
in <URL:news:%tZX3.175$li5.7753@wagner.videotron.net>:
|| Hi,
Please don't post Jeopardy style. You might find yourself a k3wL |>00|>
for posting up side down, the rest of the world is normal.
|| The way I know is to use perl2exe
Read again what Nigel says:
|| > The reason for this is to generate software/Oracle DB installation
|| > scripts with a nice GUI which I can use on any Solaris box without
|| > having to install Perl/Tk.
Solaris. You really think 'perl2exe' will generate something to be
run on Solaris?
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54";
print if s/<<EOT/<<EOT/e;
Just another Perl Hacker
EOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 16 Nov 1999 09:23:09 -0000
From: "Sphere" <sbrook@nildram.co.uk>
Subject: Move files. . .
Message-Id: <80r7bg$iv5$1@supernews.com>
Is there a "safe" command in Perl that I can use to move text files from one
place to another on a unix system - or should I be asking a unix group?
------------------------------
Date: Tue, 16 Nov 1999 12:33:59 +0300
From: Alexei Novikov <anovikov@heron.itep.ru>
Subject: Re: Multiple scripts
Message-Id: <38312507.2D1C5FE8@heron.itep.ru>
Alexei Novikov wrote:
>
> Dear All,
> I have a multiple perl scripts within my program. All of them share some
> information, like the path to the files to process, passwords to access
> db, etc. I was wondering if there is a tool that will be able to read
> this information from one file and then write it to all script files ? I
> think that MakeMaker can do this but I have no clue how. Any
> suggestions, pointers ?
> Chao,
> Alexei.
I'm afraid I did not explained my problem correctly. Surely I can write
a config file and parse it, or I can put all variables in the module and
load them from it, but there are 2 things that should be defined at
"compile" time, - path to the perl executable and "prefix" (like
/usr/share or smth else). How can I assign these 2 parameters with
MakeMaker ?
Alexei.
------------------------------
Date: Mon, 15 Nov 1999 22:22:23 -0800
From: John Iyezack <snapperhead_420NOsnSPAM@hotmail.com.invalid>
Subject: Re: Need help with arrays.
Message-Id: <0a0133f8.98878bda@usw-ex0101-001.remarq.com>
Thanks for the help! You should have seen what I was previously using.
It must have been 100 lines just to do that! I was tring to use hash's
then array's in while loops, for loops, untils....
I think I need more practice then I thought. I _thought_ I was pretty
decent at perl. But, it looks like I was dead wrong :)
Anyway, thanks, gave me a better perspective on things.
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Tue, 16 Nov 1999 08:36:41 GMT
From: Tim Richardson <ter@my-deja.com>
Subject: Re: Netscape messenger or other mail client accessable, Win 32?
Message-Id: <80r52p$i9k$1@nnrp1.deja.com>
In article <38309C4E.24EC9FF2@mail.cor.epa.gov>,
David Cassell <cassell@mail.cor.epa.gov> wrote:
> Tim Richardson wrote:
> >
> > I'd like to have Perl do some processing of email messages in my POP
> > client; this would include moving messages between folders and
sending
> > mail (which I can do with other modules already, I know).
>
> You do know about the modules for POP3, right? Like
> Mail::POP3Client ? Just checking...
Yes. I've even fiddled with them, and got as far as reading
message headers and so on. But I don't want to rewrite a decent mail
client.
>
> > I like to use Netscape on Win 32.
> > Is there a module that allows Perl to access the Netscape mail
database?
>
> There are a host of Perl modules to address a variety of APIs.
> Do you know if Nyetscape mail does MAPI, for example?
It does do MAPI. I looked on CPAN and didn't find a MAPI interface.
Can you give me a lead? I'd like to look into this...
>
--
Tim Richardson
(search string: qweeblebeast)
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 16 Nov 1999 06:00:32 +0200
From: Re'em Bar <reembar@netvision.net.il>
Subject: O, and the answer is -
Message-Id: <3830D6E0.1FB55D5E@netvision.net.il>
$text=~s/<!--.*?-->//gs;
did the trick just fine.
thanks, Larry Rosler, for your remark about the /s modifier.
--
Re'em
http://snark.co.il
------------------------------
Date: 16 Nov 1999 00:14:31 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: O, and the answer is -
Message-Id: <x7n1sfuifc.fsf@home.sysarch.com>
>>>>> "RB" == Re'em Bar <reembar@netvision.net.il> writes:
RB> $text=~s/<!--.*?-->//gs;
RB> did the trick just fine.
RB> thanks, Larry Rosler, for your remark about the /s modifier.
and that will fail for various forms of comments. if abigail didn't
killfile you (i doubt she hasn't) she would show you some typical
counter examples.
you had better learn what you are doing rather than just using what
works. it is called cargo cult or cut and paste programming. i bet you
don't even really grok the regex above regarding where it can fail.
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: Tue, 16 Nov 1999 07:23:48 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: O, and the answer is -
Message-Id: <s321k47nhsq34@corp.supernews.com>
Re'em Bar (reembar@netvision.net.il) wrote:
: $text=~s/<!--.*?-->//gs;
: did the trick just fine.
Do note that that can fail in infinitely many ways. Apply it with due
caution to pages which you do not control, or if you do not well
understand the weaknesses of that regex.
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: 15 Nov 1999 23:17:04 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: OO woes
Message-Id: <slrn831qcv.cvu.abigail@alexandra.delanet.com>
Damian Conway (damian@cs.monash.edu.au) wrote on MMCCLXVII September
MCMXCIII in <URL:news:80pmsa$kd6$1@towncrier.cc.monash.edu.au>:
@@ NukeEmUp@ThePentagon.com (David Cantrell) writes:
@@
@@ > I can't look in Damian Conway's excellent OO-perl book ATM cos it's
@@ > about 200 miles away :-(
@@
@@ Fortunately, the man himself is only 10000 miles away :-)
How far away is the errata list?
Abigail
--
$" = "/"; split $, => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_) {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 16 Nov 1999 06:02:19 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: OO woes
Message-Id: <80qs1b$og2$1@towncrier.cc.monash.edu.au>
abigail@delanet.com (Abigail) writes:
>@@ Fortunately, the man himself is only 10000 miles away :-)
> How far away is the errata list?
287 bits: http://www.manning.com/Conway/Errata.html
Damian
------------------------------
Date: 16 Nov 1999 06:18:28 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: OO woes
Message-Id: <80qsvk$oip$1@towncrier.cc.monash.edu.au>
abigail@delanet.com (Abigail) writes:
>How far away is the errata list?
Oops! Abigail was charmingly pointing out in the subtlest manner that I had
fallen into the old "Not Of This Package" trap.
What I shoudl have suggested was:
package A;
sub method
{
$B::objectA = $_[0];
my $objectB = B->new();
}
package B;
sub new
{
print $objectA->{name}, "\n";
}
package main;
my $objectA = bless { name => 'objA' }, A;
$objectA->method();
The previous version I posted didn't work because I declared the methods:
sub A::method {...}
and
sub B::new {...}
which meant that the *bodies* of those subroutines were actually
declared in the main package, so the unqualified reference to $objectA
in B::new, was in fact a reference to $main::objectA, not $B::objectA.
Mea culpa, mea culpa!
Damian
------------------------------
Date: Tue, 16 Nov 1999 02:44:57 -0800
From: Nancy <n.vincentNOn.SPAM@cross-systems.com.invalid>
Subject: Problem with the sentence "use Win32::ODBC;"
Message-Id: <0f2017c3.527d3bf2@usw-ex0106-044.remarq.com>
hi,
firstly, I would like to thank you for your previous help, my last
problem is solved now, but I face a new problem when I want to make a
search, from the Web, in an access database via ODBC.
In a first script, I ask the user to fill in a form.
I want to compare these information with my Access Database and give an
answer to the user in a HTML page.
But when I launch the second Perl script, which will consult the
database, the navigator asks me if I Want to save or Open the script on
the disk. if I choose to open it, the script is executed in a dos
window, and I can't never see any information in a HTML Page. If I skip
the "use Win32::ODBC;", I can see the code in a HTML page but, of
course, I don't make access to my database.
When I execute this script in a dos window, I have no error messages,
and I made the test (with success) for the ODBC connections. The "use
Win32::ODBC;" is just at the beginning of the script and I have no
problem to execute other scripts in the navigator.
Can anyone tell me if he has already met such a problem, if there is a
problem of configuration (of my navigator) or a problem in my script or
anything else....
Thanks in advance,
nancy
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
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 1392
**************************************