[12750] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 160 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 15 23:07:23 1999

Date: Thu, 15 Jul 1999 20:05:10 -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           Thu, 15 Jul 1999     Volume: 9 Number: 160

Today's topics:
    Re: Accessing DBM file <pylim@ecr.mu.oz.au>
    Re: ADO Insert cursor to SQLServer (Abigail)
    Re: Authentication via form? (Abigail)
    Re: C-like #define macros in Perl <uri@sysarch.com>
        Can't locate... <keoksan@nus.edu.sg>
    Re: CGI.pm and redirect <jscott@oro.net>
    Re: crypt returns different values since ISP upgrade. (Abigail)
    Re: DBI - alternate row colors (brian d foy)
    Re: DBI - alternate row colors (Abigail)
    Re: DBI - alternate row colors <madebeer@igc.apc.org>
    Re: deep recursion (Abigail)
        dns admin <uncw@rz.uni-karlsruhe.de>
    Re: Do you think I can use this instead of form button  (Abigail)
    Re: Error Processing Directive (Abigail)
    Re: Every morning at 6.00 am on a NT-box... (Abigail)
    Re: How should I sort by different fields? (Larry Rosler)
    Re: How to combine two images. (Martien Verbruggen)
    Re: how to get command line filename argument back? (Anno Siegel)
    Re: MYSQL - Help (brian d foy)
        Newbie requires help in Perl please arpith@hotmail.com
        ok, DBI alt row colors - phrased better w/code <pmallasch@mail.starnews.com>
    Re: Old database is erased when I add new information (Neko)
    Re: Perl before Swine? (Anno Siegel)
    Re: PERL OPPORTUNITIES!! CHICAGO (Martien Verbruggen)
    Re: Perl...sockets. (brian d foy)
        ph file? (Tan Keok San)
    Re: regexp in substr? (Abigail)
    Re: regexp in substr? <uri@sysarch.com>
    Re: regular expression <uri@sysarch.com>
    Re: stripping html tags (Abigail)
    Re: stripping html tags (Abigail)
    Re: Tcl-to-Perl translator? (Neko)
    Re: TIe::IxHash (Anno Siegel)
    Re: using ParseWords (brian d foy)
    Re: using ParseWords <dchender@esn.net>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 16 Jul 1999 02:46:29 +0000
From: Paul Lim <pylim@ecr.mu.oz.au>
Subject: Re: Accessing DBM file
Message-Id: <378E9D05.90D4A367@ecr.mu.oz.au>

ok.... I have also tried tie and all the DBM types.  The only one that
even accesses the file is SDBM, but it just gives rubbish back.  THe
others just create a db file (passwd or passwd.db) as though the db
doesn't exist.

Anno Siegel wrote:
> 
> Paul Lim  <pylim@ecr.mu.oz.au> wrote in comp.lang.perl.misc:
> >I hope someone can help me with this issue.
> >
> >I have a Perl script that runs a hack of Selena Sol's Calendar.  I want
> >to now link the password authentication to the user database on my web
> >server (Apache).  However I don't seem to be able to open the password
> >file with the following code: (this was to test whether or not I could
> >read the data)
> >
> >       use DB_File;
> >       dbmopen (%DBM, "/www/vwliv/home/userdb/passwd", 0666)   || die
> >"Cannot open file passwd file: $!\n";
> >       while (($key, $value) = each %DBM) {
> >         print "key=$key, value=$value\n";
> >       }
> >       dbmclose %DBM;
> >
> >All this does when I run it is create a file "passwd" in the directory.
> >The passwd DB is an NDBM (i assume) database created using the
> >"user_manage.cgi" script, and is contained in the usual two files:
> >"passwd.dir" and "passwd.pag".
> 
> Well, if it is an NDBM file you want to use NDBM_File. DB_File uses
> Berkeley DB, which is different.  Also, the use of dbmopen is ancient
> and should not be used any more.  See perldoc -f tie for instructions.
> 
> Anno


------------------------------

Date: 15 Jul 1999 21:01:11 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: ADO Insert cursor to SQLServer
Message-Id: <slrn7ot4i9.c9j.abigail@alexandra.delanet.com>

Dorr Lewright (dlewright@nuworld.com) wrote on MMCXLIII September
MCMXCIII in <URL:news:378D1FD3.303283B3@nuworld.com>:
() Does anyone have an example using ADO where you prepare an insert cusor,
() then insert rows, then close the cursor?

I highly doubt you can prepare insert cusors and insert rows with an
old soccer team.

() I am inserting to a SQLServer 7.0 database.

Very interesting. What colour is your database? How long ago did you 
get it? Did you get any free airmiles with it? Does it play nice with
the kids? How often do you need to feed it? Also in wintertime? Can
it talk? Does the interface to the fridge work as the advertisement
said? How is the after support? 


Abigail
-- 
WTF has this to do with Perl?


  -----------== 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: 15 Jul 1999 21:07:14 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Authentication via form?
Message-Id: <slrn7ot4tk.c9j.abigail@alexandra.delanet.com>

Patrick Tully (pmt@top.mitre.org) wrote on MMCXLIV September MCMXCIII in
<URL:news:378E38D3.C3E749F1@top.mitre.org>:
<> Hi,
<>     I want to be able to authenticate a user via a form instead of a
<> browser pop-up window, with a .htaccess file.  Does anyone know of a
<> SMALL script that will simply check a user's id/pw with the .htaccess
<> file and log them in (without a pop-up window)?  If not any refrences on
<> how to go about doing this?  It seems as though it would be quite easy,
<> but i have found little information on it.



#!/opt/perl/bin/perl -w

use strict;

unless ($ENV {HTTP_USER_AGENT} =~ /\bLynx\b/i) {
    print <<TEXT;
Content-Type: text/plain

Please upgrade your browser to Lynx!
TEXT
}
else {
    print <<LOCATION;
Location: http://www.mitre.org/doc/with/.htaccess

LOCATION
}


__END__


No popup windows from now on!


Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== 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: 15 Jul 1999 22:08:44 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: C-like #define macros in Perl
Message-Id: <x7g12pmjmb.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@delanet.com> writes:

  A> Uri Guttman (uri@sysarch.com) wrote on MMCXLIV September MCMXCIII in
  A> <URL:news:x7n1wxnbjo.fsf@home.sysarch.com>:
  A> && 
  A> && d'oh! i knew that! can she allow her lusers to use deja? here is the url
  A> && for the post with the whole description of how i used -P

  A> Well, access to deja isn't forbidden, but access to the keyboard is.
  A> And there's no mouse.

yes there is. it is that footpedal on the floor. and your pc probably
has this neat motorized coffee cup holder too.

do i have to post that use of -P here?

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


------------------------------

Date: Fri, 16 Jul 1999 10:10:32 +0800
From: Tan Keok San <keoksan@nus.edu.sg>
Subject: Can't locate...
Message-Id: <3447D7F0AFD4D011AE0400608C14CE561183FD68@pfs01.ex.nus.edu.sg>
Keywords: config.ph

Got a Softare error:  Can't locate config.ph in @INC (did you run h2ph).
This is on Sol7.  Tried moving config.ph to the directories named -
didn't work.  Also isn't config.ph a .ph file already???

Any help as to what to do appreciated!

Keok San.
tel:       65-874-2536
fax:      65-777-2065



------------------------------

Date: Thu, 15 Jul 1999 12:41:29 -0700
From: oronet Tech - Joshua Scott <jscott@oro.net>
Subject: Re: CGI.pm and redirect
Message-Id: <378E3969.44D8AFBC@oro.net>

Then it gives me a document contains no data error.  This one has really
stumpped me.

Winter wrote:
> 
> don't print anything before $q->redirect. expecially $q->header
> 
> oronet Tech - Joshua Scott <> wrote in message
> news:378D33CA.5D210771@oro.net...
> > I am using the redirect in the CGI.pm.  For some reason I get this error
> > at the browser:
> >
> > Status: 302 Found Uri: http://www.oro.net Location: http://www.oro.net
> > Content-type: text/html
> >
> > Any insights would be greatly appreciated.
> >
> > =============================================================
> > Josh Scott                                           272.0799
> > oronet Technician                  http://www.oro.net/~jscott

-- 
=============================================================
Josh Scott                                           272.0799
oronet Technician                  http://www.oro.net/~jscott
"Everywhere you go, there you are." Buckaroo Bonzi


------------------------------

Date: 15 Jul 1999 21:15:16 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: crypt returns different values since ISP upgrade.
Message-Id: <slrn7ot5cm.c9j.abigail@alexandra.delanet.com>

Andrew J Perrin (aperrin@mcmahon.qal.berkeley.edu) wrote on MMCXLIII
September MCMXCIII in <URL:news:378CFC5B.42DA35CF@mcmahon.qal.berkeley.edu>:
\\ 
\\ if (crypt($user, substr($passwd, 0, 2)) eq $passwd) {


Useless use of 'substr'.

   if (crypt($user, $passwd) eq $passwd) {

will do fine.



Abigail
-- 
sub A::TIESCALAR{bless\my$x=>A};package B;@q=qw/Hacker Another
Perl Just/;use overload'""'=>sub{pop @q};sub A::FETCH{bless\my
$y=>B}; tie my $shoe => 'A';print "$shoe $shoe $shoe $shoe\n";


  -----------== 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: Thu, 15 Jul 1999 20:56:45 -0500
From: brian@pm.org (brian d foy)
Subject: Re: DBI - alternate row colors
Message-Id: <brian-1507992056450001@78.bloominton-01rs13-14rt.il.dial-access.att.net>

In article <F_rj3.344$Cs3.4007015@news.netdirect.net>, "K. Paul Mallasch"
<pmallasch@mail.starnews.com> wrote:

>Anyone have an easy way to alternate row colors when displaying results from
>a mySQL query?

rows don't have colors.  perhaps you should explain how you are
displaying results.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


------------------------------

Date: 15 Jul 1999 21:17:02 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: DBI - alternate row colors
Message-Id: <slrn7ot5g0.c9j.abigail@alexandra.delanet.com>

K. Paul Mallasch (pmallasch@mail.starnews.com) wrote on MMCXLIV September
MCMXCIII in <URL:news:F_rj3.344$Cs3.4007015@news.netdirect.net>:
\\ Anyone have an easy way to alternate row colors when displaying results from
\\ a mySQL query?


Yeah. Use a red crayon in your right hand, and a green crayon in your left.



Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== 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: Thu, 15 Jul 1999 18:47:54 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: DBI - alternate row colors
Message-Id: <APC&1'0'50775d93'bf6@igc.apc.org>

As you loop through the row results, have a counter variable, $i.

# pseudocode
if ( ($i mod 2) == 0)) {
  print "<FONT COLOR=green>\n";
} else {
  print "<FONT COLOR=red>\n";
}

-Michael



------------------------------

Date: 15 Jul 1999 21:19:20 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: deep recursion
Message-Id: <slrn7ot5kb.c9j.abigail@alexandra.delanet.com>

Mark Rogaski (wendigo@deathstar.jabberwock.org) wrote on MMCXLIV
September MCMXCIII in <URL:news:378d71bb@news.eclipse.net>:
// How deep does recursion have to go before Perl carps about deep recursion?

I'd know the answer, but I would just cut and paste that from the
manual. But that wouldn't be useful, cause you seem to not understand
the manual. Could you indicate which part is unclear? Then I will type
that part slowly when explaining it.



Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


  -----------== 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: Wed, 14 Jul 1999 13:56:39 +0100
From: "Volker Bertsch" <uncw@rz.uni-karlsruhe.de>
Subject: dns admin
Message-Id: <7mhtmq$849$1@news.rz.uni-karlsruhe.de>

Hi,

are there any scripts/modules to admin a dns-server (bind8)? I need it for
web-based interface to configure dns.

Thanx Volker.





------------------------------

Date: 15 Jul 1999 21:28:07 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Do you think I can use this instead of form button ?
Message-Id: <slrn7ot64q.c9j.abigail@alexandra.delanet.com>

Yeong Mo/Director Hana co. (factory@factory.co.kr) wrote on MMCXLIV
September MCMXCIII in <URL:news:7ml5po$tmu$1@news1.kornet.net>:
__ Do you think I can use this instead of form button ?


I would use a group of nude Greek atlethes.


What does your question have to do with Perl?



Abigail
-- 
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
          for (??;(??)x??;??)
              {??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'


  -----------== 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: 15 Jul 1999 21:31:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Error Processing Directive
Message-Id: <slrn7ot6aq.c9j.abigail@alexandra.delanet.com>

darkmanjs@my-deja.com (darkmanjs@my-deja.com) wrote on MMCXLIV September
MCMXCIII in <URL:news:7mkupm$is7$1@nnrp1.deja.com>:
:: I'm tring to get a perl counter to work on my page and I get this error
:: with every counter I've tried.  I'm my 5th one and it's nothing but a
:: basic text counter.  This is the error I get:
:: [an error occurred while processing this directive]

That's because counters are silly!

:: I have other Perl scripts working on my page.  Specifically a voting
:: script, but I can't get a counter to work.  The only thing I can think
:: of is that the voting script works because it's attached to a button
:: where as, this script is being run straight from the page. i've been
:: using
:: <!--#exec cgi="cgi-bin/counter.pl"-->
:: and that doesn't seem to work.  I've tried making the page a .shtml,
:: i've tried using <!--#include virtual="..., but nothing seems to work.
:: Please help!

It looks to me that you ruled out that the bug is in the Perl code,
otherwise, you would have supplied us with code and an error.

So, why are you posting this in a Perl group?



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


  -----------== 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: 15 Jul 1999 21:33:44 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Every morning at 6.00 am on a NT-box...
Message-Id: <slrn7ot6f8.c9j.abigail@alexandra.delanet.com>

Henri Schomäcker (hschomae@rz-online.de) wrote on MMCXLIII September
MCMXCIII in <URL:news:378c847d.9394296@news.rhein-zeitung.de>:
== 
== [ How to do cron on a silly OS ]
== 
== - Is there a possibility to let the perl-script do the control of time
==   and starting the actions every morning without any NT-Services?
==   Eg by a Win32::? Module?


Unlikely, unless you want it to run all the time.



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


  -----------== 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: Thu, 15 Jul 1999 17:56:31 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How should I sort by different fields?
Message-Id: <MPG.11f8231ee02d1ac989cdf@nntp.hpl.hp.com>

In article <378E7AB8.D006722F@email.com> on Fri, 16 Jul 1999 00:20:04 
GMT, Jordan Hiller <hiller@email.com> says...
> I have a tab-delimeted file something like this (just an example):
           tab-separated
 
> Bob	43	M
> Jane	42	F
> Joe	67	M
> 
> My perl script needs to read in this file and print it out as a HTML table. That
> part I can handle with a simple hash, split, and loop.

Forget the hash.  Read the data into an array.
 
> But, it must also be able to sort by any column before it makes the HTML table.
> I've read the docs on sort and I understand how to use it for a simple array,
> but I'm not sure what to do here. I'm not even sure how to lay out my data
> structure. Can someone give me a bit of help?

perlfaq4:  "How do I sort an array by (anything)?"

By the way, make your line lengths shorter on subsequent postings.  72 
is a nice number.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Fri, 16 Jul 1999 02:57:53 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How to combine two images.
Message-Id: <Rcxj3.115$8G5.6112@nsw.nnrp.telstra.net>

In article <378e5946@news.inch.com>,
	"Igor" <zigor@erols.com> writes:
> I want using perl or something else to combine two images.

Get ImageMagick.

Get the associated Perl module.

yahoo has a listing for it.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 


------------------------------

Date: 16 Jul 1999 01:19:55 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: how to get command line filename argument back?
Message-Id: <7mm1br$h04$1@lublin.zrz.tu-berlin.de>

Tom Kralidis  <tom.kralidis@ccrs.nrcanDOTgc.ca> wrote in comp.lang.perl.misc:
>Hi,
>
>The script I'm writing peruses a txt file, extracts the info needed and
>stores them to variables.  I now want to create a new file (same id as
>the txt file, given as argument on command line), with a different
>extension.  I have extracted the info from the first file by:
>
>while <> {
>if (stuff) {
>stuff
>  }
>}
>
>After this statement I am ready to write the variables to file.  Any
>suggestions?  I have tried 
>($file = shift @ARGV);, but get no results (script freezes, dies)

Too late.  <>-processing has eaten up @ARGV when you're through
with reading the file.  If you are processing just one file, you
can do $file = $ARGV[ 0] before the loop, or $file = $ARGV afterwards.

But note that this code isn't very robust.  If you mention more than
one file on the command line, initial $ARGV[ 0] will give you the
first one, and final $ARGV the last one.  Also, all the files will
be processed in your loop.

Anno


------------------------------

Date: Thu, 15 Jul 1999 21:19:49 -0500
From: brian@pm.org (brian d foy)
Subject: Re: MYSQL - Help
Message-Id: <brian-1507992119490001@78.bloominton-01rs13-14rt.il.dial-access.att.net>

In article <378defc1.0@news1.mweb.co.za>, "Ian Coetzee"
<seccoza@mweb.co.za> wrote:

>Im a newbie to Mysql , but I think its the greatest invention since sliced
>bread. Right now on to my problem
>
>I have a sql database (Lets use a search engine as example) I enter querry
>to recieve lets say
>
>select * where name ='whatever.....'
>
>Now it pops out 10 000 replies ? How can I say to SQL to only send through
>the first 20 or those replies that match between 20 and 40 ?


read the mysql documentation on SELECT queries.  it's in there.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


------------------------------

Date: Fri, 16 Jul 1999 01:51:39 GMT
From: arpith@hotmail.com
Subject: Newbie requires help in Perl please
Message-Id: <7mm377$1pd$1@nnrp1.deja.com>

Hi,

I'm learning Perl by looking at the code, and I am using Perl Win32 in
Win 95.

I run the pl programs simply like this:
perl prog.pl

I would like to know if there is a way of calling the pl program from
the browser.. So that I can pass values into the pl program through a
form.

Please help here,
Thanks,
Arpith.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Thu, 15 Jul 1999 21:54:47 -0600
From: "K. Paul Mallasch" <pmallasch@mail.starnews.com>
Subject: ok, DBI alt row colors - phrased better w/code
Message-Id: <q7xj3.350$Cs3.4178062@news.netdirect.net>



Here's the code:

---------------------------------------

print "<table>";

while (@row = $sth->fetchrow_array) {
 print "<tr>";
 print "<td>>$row[1] </td>";
 print "<td>$row[2]</td>";
 print "<td>$row[3] </td>";
 print "</tr>\n";
 
                                    }
print "</table>";

---------------------------------------


What I'd like to do is have <td> change to <td bgcolor="blue"> every other
time thru the script, resulting in an easier to read table.Is it possible?

Any pointers on how to go about this? Am I posting in the wrong place?

An if/then statement for each <td> each time thru? If so, what to check
against?

Thanx,
K. Paul Mallasch - Webmaster
http://www.thestarpress.com


------------------------------

Date: 16 Jul 1999 02:06:02 GMT
From: tgy@chocobo.org (Neko)
Subject: Re: Old database is erased when I add new information
Message-Id: <7mm42a$l9s$0@216.39.141.200>

On 15 Jul 1999 21:09:46 GMT, stanley@skyking.OCE.ORST.EDU (John Stanley)
wrote:

>In article <7mldgo$t7s$0@216.39.141.200>, Neko <tgy@chocobo.org> wrote:
>>On 15 Jul 1999 16:21:51 GMT, stanley@skyking.OCE.ORST.EDU (John Stanley)
>>wrote:
>>>Yes, perhaps, but unfortunately the person who can do that is much less
>>>likely to go around the net announcing his praise for you than the idiot
>>>who "fixes" your code and calls you unethical because you won't fix it
>>>for him. 
>>
>>Larry Wall's reputation is not enhanced because porters such as Chip and
>>Sarathy go around praising him for writing Perl.  
>
>If you don't understand what "less likely" means, I will be happy to
>explain it to you. Yes, some people spend their time passing out praise.
>Most users do not talk to you unless there is a problem.

You gain a good reputation by delivery a good product.  You get a better
product if you have others pointing out your mistakes.

>>Imagine where Perl would be today if Larry had hidden the source for fear
>>that someone might look under the hood -- edit, edit, edit -- and then rail
>>against him because Perl is broken.
>
>Imagine where you would be if the source code for the X-ray machine in
>your doctor's office had been modified by the medical transcriptionist
>and you had gotten overdosed on your last X-ray.

You shouldn't be writing X-ray machines, missile guidance systems, or dancing
dogs in Perl. :)

>The argument that everything must be open source because for some things
>it worked well is ridiculous. That is exactly what you are arguing when
>you use perl as an example of how well open source works.  Nobody is
>telling you not to give away whatever source you want to. Grant the
>right to make the decision to other people.

No one ever said open source works for everything.  No one wants to see a
cathedral with a thousand patches.  If you think you can build a better
mousetrap all by yourself, go ahead -- a lot of good software is written this
way.  If you think wielding the hood shut will lower the amount of luser mail
you get, go ahead -- they'll just yell at you after they dent their car
trying to pry the hood open. :)

>>Most patches pinpoint the problem.  
>
>And many patches conflict with other patches and the current code.

I agree.  I am constanly shocked that the Perl porters get anything done.

>>If you don't want to merge their code
>>with yours, you can still write it all from scratch.  No harm done.  No time
>>wasted.
>
>And just how do I verify that my version is compatible with theirs
>unless I study what they have done?

You don't.  There is absolutely no reason you must make your code compatible
with theirs.  You add whatever features you want.  Any features you don't add
aren't there.

>>Your two users have forked off entirely different programs.  
>
>No, not entirely different programs. Not unless you count every
>modification to a system as an entirely new system. I don't.

Yes.  If two programs work differently, I count them as different.

>>If you want all the credit, you do all the hard work yourself.  If you're
>>lazy, you get other people to do all the hard work for you.  You convince
>>them to send you patches.  
>
>And then you get the fun of merging everything back into one. It takes
>time either way. Claiming that people who patch their copies of your
>code for you saves you time is wrong.

If it's no fun, then don't merge.  Save oodles of time!  Again, you do not
have to accept patches, especially patches that aren't easy to apply.  And if
someone breaks your software (and calls it adding features), you do not have
to twist your software to make it compatible.

>>And when a bug is fixed, everyone can apply the
>>patch right there and then.  They don't have to wait for a free update.
>
>This is even more wonderful a situation. Now not only will all your
>users need to communicate with each other, they will all have to apply
>patches when someone else creates one, even if that patch doesn't effect
>them and even if it breaks something they want to use. How much time do
>I have to waste doing all this coordination instead of just fixing the
>code myself?

Users who do not want to apply patches can wait for the next official
release.  User who do, will have to keep informed, perhaps by subscribing to
a mailing list.

>>Hiding the source just keeps other programmers from helping you.  
>
>Except it isn't always a help. And it keeps non-programmers from hurting me. 
>In the case I am using as an example, the damage is limited because I
>have been keeping in contact with them and know what they are doing. If
>this were a typical commercial release, I wouldn't know who most of the
>users were, much less how good at programming they are, and they would
>not have consulted with me about the best way to implement what they
>want.

Again, I do not see why you must make your software conform to changes that
your users make.

>>stop the lusers -- they can just as easily corrupt a compiled program and
>>call you names for allowing such a thing to happen.
>
>Most lusers are smart enough to know they can't edit a binary with the
>text editor they have. The number of lusers who are not that smart are
>not worth worrying about.

The number of people who corrupt a binary file with FTP ASCII far outnumber
those who ever contemplate editing a Perl program.

-- 
Neko | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=


------------------------------

Date: 16 Jul 1999 01:35:49 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Perl before Swine?
Message-Id: <7mm29l$h1d$1@lublin.zrz.tu-berlin.de>

Burton Kent  <burton@lucent.com> wrote in comp.lang.perl.misc:
>How do I make Perl grab/conserve all the memory it can?	

Perl does that without your help.

>My program needs a lot more memory for recursion...

If perl runs out of memory there isn't any more.

Anno


------------------------------

Date: Fri, 16 Jul 1999 02:55:35 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: PERL OPPORTUNITIES!! CHICAGO
Message-Id: <Haxj3.114$8G5.6112@nsw.nnrp.telstra.net>

[Please do not post job advertisements on this group, especially if
they are not particularly for Perl programmers. Use one of the
newsgroups with job somewhere in its name]
[Please do not write your subject line in capitals. it's considered
rude]

In article <7mktsa$ifd$1@nnrp1.deja.com>,
	sadftef@my-deja.com writes:

> Tribune is a leading media company with operations in television and
> radio broadcasting, publishing, education and interactive ventures. 

Publishing? Education? 

Maybe you should reread your subject line and be ashamed. Very ashamed.

[snip]

> What we do…
> Tribune Information Systems and Tribune Interactive Media in partnership

Troubles with the editor? How do your 'publications' look?

> Applications include Oracle, Sybase, PeopleSoft, StoryServer, Novell,
> Java, and Cisco router, as well as a full suite of Microsoft products.

I never knew all of those were applications. Applications of what?

You hardly seem to understand what you are talking about.

> Check us out http://www.tribjobs.com   and apply on line!!!!

I don't think so. 

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 


------------------------------

Date: Thu, 15 Jul 1999 21:27:39 -0500
From: brian@pm.org (brian d foy)
Subject: Re: Perl...sockets.
Message-Id: <brian-1507992127390001@78.bloominton-01rs13-14rt.il.dial-access.att.net>

In article <378E2180.605EB3D2@wfubmc.edu>, Steve Miles <smiles@wfubmc.edu>
wrote:

>Search Amazon.com or go to oreilly.com and look for:
>
>"Web Client Programming with Perl"  by Clinton Wong

that's rather dated.  socket programming in Perl can be very much
like socket programming in C, or one could use the IO::Socket 
module which does all of the hard work for you.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


------------------------------

Date: 16 Jul 1999 02:00:27 GMT
From: ccetks@leonis.nus.edu.sg (Tan Keok San)
Subject: ph file?
Message-Id: <7mm3nr$kvu$1@nuscc.nus.edu.sg>

I've got a Software error:  Can't locate config.ph in @INC (did you run
h2ph) with a perl script on Sol 7.  Tried to move config.ph to the
directories shown but still couldn't get the script to work.  Also, isn't
script already in .ph form?  

Any help appreciated on what to do!



------------------------------

Date: 15 Jul 1999 20:36:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: regexp in substr?
Message-Id: <slrn7ot34m.c9j.abigail@alexandra.delanet.com>

Bart Lateur (bart.lateur@skynet.be) wrote on MMCXLIV September MCMXCIII
in <URL:news:378e33da.7114600@news.skynet.be>:
 .. 
 .. So you want the offset of the first '-' in  the string? You could check
 .. the length of $`, i.e. the substring on the left of the match, but I
 .. wouyldn't do that because it will slow EVERY regex in your script, or in
 .. any used module, down. BTW the full code would be
 .. 
 .. 	/-/ and $E = substr($_,length $`);


A solution that works for non fixed-length matches, and doesn't have the
overhead of $` and friends:

     /(RE)/g and $E = pos () - length $1;



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'


  -----------== 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: 15 Jul 1999 22:20:54 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: regexp in substr?
Message-Id: <x7d7xtmj21.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@delanet.com> writes:

  A> Bart Lateur (bart.lateur@skynet.be) wrote on MMCXLIV September MCMXCIII
  A> in <URL:news:378e33da.7114600@news.skynet.be>:
  A> .. 
  A> .. So you want the offset of the first '-' in  the string? You could check
  A> .. the length of $`, i.e. the substring on the left of the match, but I
  A> .. wouyldn't do that because it will slow EVERY regex in your script, or in
  A> .. any used module, down. BTW the full code would be
  A> .. 
  A> .. 	/-/ and $E = substr($_,length $`);


  A> A solution that works for non fixed-length matches, and doesn't have the
  A> overhead of $` and friends:

  A>      /(RE)/g and $E = pos () - length $1;

i think you forgot the substr. you assign the offset of RE to $E while
they store the string starting there.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


------------------------------

Date: 15 Jul 1999 21:58:05 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: regular expression
Message-Id: <x7k8s1mk42.fsf@home.sysarch.com>

>>>>> "h" == h0444vcs  <h0444vcs@rz.hu-berlin.de> writes:

  h> Each line has different fields seperated by ":" (like /etc/passwd ).

  h> @array = grep { !/$name/  } @array ;

  h> would remove all entries in the array where $name appears.
  h> But I want to ensure that only these entries are removed where
  h> $name appears in a certain field of the line.

@out = grep { (split ':')[$column] ne $name } @array ;

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


------------------------------

Date: 15 Jul 1999 20:38:08 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: stripping html tags
Message-Id: <slrn7ot373.c9j.abigail@alexandra.delanet.com>

Rita Van Leer (zigmart@zigmart.com) wrote on MMCXLIII September MCMXCIII
in <URL:news:378D23F1.3BB3CCEC@zigmart.com>:
"" 
"" is there any way to automatically strip the html tags out of the
"" description before it is sent


That has been asked before. Many, many times.



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'


  -----------== 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: 15 Jul 1999 20:39:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: stripping html tags
Message-Id: <slrn7ot38l.c9j.abigail@alexandra.delanet.com>

Winter (tungyat@yahoo.com) wrote on MMCXLIV September MCMXCIII in
<URL:news:7bdj3.2631$n5.54610@news1.rdc2.on.home.com>:
?? this is should work too:
?? 
?? $content =~ s/<([^\0]*?)>//g;


No, it doesn't.



Abigail
-- 
sub J::FETCH{Just   }$_.='print+"@{[map';sub J::TIESCALAR{bless\my$J,J}
sub A::FETCH{Another}$_.='{tie my($x),$';sub A::TIESCALAR{bless\my$A,A}
sub P::FETCH{Perl   }$_.='_;$x}qw/J A P';sub P::TIESCALAR{bless\my$P,P}
sub H::FETCH{Hacker }$_.=' H/]}\n"';eval;sub H::TIESCALAR{bless\my$H,H}


  -----------== 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 Jul 1999 02:16:02 GMT
From: tgy@chocobo.org (Neko)
Subject: Re: Tcl-to-Perl translator?
Message-Id: <7mm4l2$l9s$1@216.39.141.200>

On Thu, 15 Jul 1999 13:44:59 -0700, lr@hpl.hp.com (Larry Rosler) wrote:

>I am about to inherit a pile of Tcl code, whose primary purpose is to 
>produce SQL.  (Tk isn't involved at all.)  Rather than learn Yet Another 
>Language, I though it might be best to translate the stuff into Perl, 
>from which I can adapt, maintain and improve it.

It's not tcl2perl, but from CPAN:

  Tcl   RdcO Complete access to Tcl   MICB

-- 
Neko | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=


------------------------------

Date: 16 Jul 1999 01:57:59 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: TIe::IxHash
Message-Id: <7mm3j7$h6p$1@lublin.zrz.tu-berlin.de>

Joe Rocklin  <Joe.Rocklin@sdrc.com> posted 40+ lines of mime framework
to say

>Has anyone ever used this module to print the contents of a hash in
>insertion order?  I try it, but it doesn't seem to work.

Yes, I used it and it does what I expect.  What did you expect, and
in which way doesn't it to that?

Anno


------------------------------

Date: Thu, 15 Jul 1999 21:13:30 -0500
From: brian@pm.org (brian d foy)
Subject: Re: using ParseWords
Message-Id: <brian-1507992113300001@78.bloominton-01rs13-14rt.il.dial-access.att.net>

In article <378E41B6.D566273C@esn.net>, "M.A. Henderson"
<dchender@esn.net> wrote:

>I have just read a file into an array @lines.
>The lines in the format:
>     $variable = "younme@hitme.com  henshe@at.movies"
>
>will this parse the addresses into a list?

>use Text::ParseWords;
>&parse_line(\, $keep, /x"[$lines[$count]]*"x/]);

 what happened when you tried it?

what are those arguments?

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


------------------------------

Date: Thu, 15 Jul 1999 22:44:59 -0700
From: "M.A. Henderson" <dchender@esn.net>
Subject: Re: using ParseWords
Message-Id: <378EC6DA.C0FE678F@esn.net>

>  It should be:

&parse_line(\, $keep, /x"[$variable]*"x/]);

$keep is just boolean to remove or leave delimiters


When I try this though, it returns a syntax error on the &parse_line
function at the forward slash.

>
>
> >I have just read a file into an array @lines.
> >The lines in the format:
> >     $variable = "younme@hitme.com  henshe@at.movies"
> >
> >will this parse the addresses into a list?
>
> >use Text::ParseWords;
> >&parse_line(\, $keep, /x"[$lines[$count]]*"x/]);
>
>  what happened when you tried it?
>
> what are those arguments?
>
> --
> brian d foy
> CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
> Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>



------------------------------

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 160
*************************************


home help back first fref pref prev next nref lref last post