[19537] in Perl-Users-Digest
Perl-Users Digest, Issue: 1732 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 11 11:05:30 2001
Date: Tue, 11 Sep 2001 08:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1000220707-v10-i1732@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 11 Sep 2001 Volume: 10 Number: 1732
Today's topics:
Re: a mystery to me: EOF <nospam-abuse@ilyaz.org>
Re: concatenating files with the same name <Thomas@Baetzler.de>
Re: concatenating files with the same name <dtweed@acm.org>
Re: Convert hex dump to binary (Tad McClellan)
CPAN problems on OSX (kerin)
Re: CPAN problems on OSX <fiendy@claraNO-SPAM.co.uk>
dbmopen file extensions <fiendy@claraNO-SPAM.co.uk>
Re: How to code windows service ? (Samppa)
how to get the size of each attachment? <bing-du@tamu.edu>
Re: how to substitute letters within a string <tinamue@zedat.fu-berlin.de>
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: PERL DBI module question <tschultz@lynx.neu.edu>
Re: PERL DBI module question (John J. Trammell)
Re: PERL modules and GPL license (Samppa)
Re: Really bizzare syntax error (Stan Brown)
Re: Really bizzare syntax error <jgrg@sanger.ac.uk>
Re: Really bizzare syntax error (Tad McClellan)
Re: Regular expression (John J. Trammell)
Re: Regular expression (Tad McClellan)
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
Why would the perl compiler report errors on the wrong (Stan Brown)
Re: Why would the perl compiler report errors on the wr (Tad McClellan)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 11 Sep 2001 14:54:57 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: a mystery to me: EOF
Message-Id: <9nl8k1$v0l$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Trewth Seeker
<trewth_seeker@yahoo.com>], who wrote in article <d690a633.0109061741.2fdb750f@posting.google.com>:
> > > For plain files, read will always return the number of bytes that the
> > > programmer requested,
> >
> > Nope,
>
> One should be quite sure before naysaying someone.
I do.
> The context of Mark's remark was set by Juha Laiho's
> "F.ex. on Unix systems," -- EMX is not a Unix system.
Mark's remark is context-free.
Ilya
------------------------------
Date: Tue, 11 Sep 2001 15:05:32 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: concatenating files with the same name
Message-Id: <lv2spt49pok0pbfp3ld5g8abckir6svttb@4ax.com>
On 10 Sep 2001, soumitra@mailandnews.com (soumitra bhattacharya)
wrote:
>Hi!
>I have files with the same name but in different directories.
>I have four directories a,b,c,d
>within each directory I have files with the same name.
>Like within "a" directory I have
>k.txt (100Kb),l.txt(50Kb),m.txt(70Kb)
>again within "b" directory I have
>k.txt(77Kb),l.txt(70Kb),m.txt(770Kb)
>again within "c" directory I have
>k.txt(200Kb),l.txt(100Kb),m.txt(10Kb)
>
>
>I want to make a new directory "concatenated"
>where I will have files
>k.txt(file size= 100+77+200).....
>l.txt(file size = 50+7++100).....
>k.txt(377Kb),l.txt(220Kb),m.txt(850Kb)
#!/usr/bin/perl
my %dirs = (
'a' => 1,
'b' => 2,
'c' => 4,
'd' => 8
);
my %dirindex = map { $dirs{$_} => $_ } keys %dirs;
my %files;
foreach $dir ( keys %dirs ){
opendir( DIR, "$dir" ) or die "opendir of '$dir' failed: $!\n";
while( defined( my $file = readdir( DIR ) ) ){
next if $file =~ m/\.\.?/ || !-f $file;
$files{ $file } += $dirs{$dir};
}
}
foreach my $file ( keys %files ){
open( OUT, ">out/$file" ) or die "Can't write 'out/$file': $!\n";
for my $i ( sort keys %dirindex ){
if( $files{$file} & $i == $i ){
open( IN, "$dirs{$i}/$file" )
or die "Can't read '$dirs{$i}/$file': $!\n";
{
local $/ = undef;
print OUT <IN>;
}
close( IN );
}
}
close( OUT );
}
HTH,
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";
------------------------------
Date: Tue, 11 Sep 2001 13:48:10 GMT
From: Dave Tweed <dtweed@acm.org>
Subject: Re: concatenating files with the same name
Message-Id: <3B9E14F8.79189128@acm.org>
soumitra bhattacharya wrote:
> I have files with the same name but in different directories.
>
> I want to make a new directory "concatenated"
> where I will have files
> k.txt(file size= 100+77+200).....
> l.txt(file size = 50+7++100).....
> k.txt(377Kb),l.txt(220Kb),m.txt(850Kb)
> these files will contain the
> concatenated data of all the
> files with the same name from all the directories.
> I need to do this recursively as there are 10000+ files in each directory.
Here's some code that should get you started. Although you hint that
they're text files, I'm copying them in binmode just in case they're
not and you're on a platform that cares about the difference. Set
$verbose to 0 if you don't want all the progress messages.
-- Dave Tweed
#!perl -w
@dirs = ('a', 'b', 'c', 'd');
$outdir = 'concatenated';
$blocksize = 65536;
$verbose = 1;
# collect all the names together in one place,
# along with the directories they're found in
for my $dir (@dirs) {
opendir (DIR, $dir) || die "can't read $dir: $!";
my @names = grep (-f "$dir/$_", readdir DIR);
closedir DIR;
for (@names) {
push @{$all{$_}}, $dir;
}
}
# go through the names and copy/concatenate the files
for my $name (sort keys %all) {
print "$name:" if $verbose; # progress message
open (OUT, ">$outdir/$name") || die "can't write $outdir/$name: $!";
binmode OUT; # just in case
for my $indir (@{$all{$name}}) {
print " $indir" if $verbose; # progress message
open (IN, "$indir/$name") || die "can't read $indir/$name: $!";
binmode IN; # just in case
my $buffer;
while (read (IN, $buffer, $blocksize)) {
print OUT ($buffer) || die "can't print $outdir/$name: $!";
}
close IN;
}
close OUT || die "can't close $outdir/$name: $!";
print "\n" if $verbose; # progress message
}
------------------------------
Date: Tue, 11 Sep 2001 14:08:47 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Convert hex dump to binary
Message-Id: <slrn9ps3nu.5jc.tadmc@tadmc26.august.net>
Phil Hibbs <phil.hibbs@capgemini.co.uk> wrote:
>Is there anything around that would help me take something like this:
[snip]
>and convert it to a plain text file containing "Application exception
>occurred:" etc.
------------------------------------
#!/usr/bin/perl -w
use strict;
while(<DATA>) {
foreach my $hex ( split /\s+/, substr($_, 6, 23) ) {
print chr hex $hex;
}
}
__DATA__
0000: 0d 0a 0d 0a 41 70 70 6c ....Appl
0008: 69 63 61 74 69 6f 6e 20 ication.
0010: 65 78 63 65 70 74 69 6f exceptio
0018: 6e 20 6f 63 63 75 72 72 n.occurr
0020: 65 64 3a 0d 0a ed:
------------------------------------
Or replace the foreach loop above with:
print chr hex $_ for split /\s+/, substr($_, 6, 23);
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 11 Sep 2001 07:43:12 -0700
From: kerin@airside.co.uk (kerin)
Subject: CPAN problems on OSX
Message-Id: <31515748.0109110643.332731e1@posting.google.com>
Hi everyone,
I'm pretty much a Perl newbie (I'm a PHP developer by trade), but
today I've had to delve into the world of Perl and CPAN, and I'm
having problems.
Whenever I try and install any module whatsoever, I get an error like
this:
cpan> install Bundle::Mysql
CPAN: MD5 security checks disabled because MD5 not installed.
Please consider installing the MD5 module.
zsh: no such file or directory:
y/sources/authors/id/J/JW/JWIED/Msql-Mysql-modules-1.1835.tar.gz
tar: End of archive volume 1 reached
tar: Sorry, unable to determine archive format.
y/sources/authors/id/J/JW/JWIED/Msql-Mysql-modules-1.1835.tar.gz: No
such file or directory
Couldn't uncompress y/sources/authors/id/J/JW/JWIED/Msql-Mysql-modules-1.1835.tar.gz
CPAN never finds any files, ever, and always gives the "unable to
determine archive format" error message.
I realise that I'm probably doing something really dumb, and I've been
hunting through the cpan.org documentation for hours, and I can't
track this down.
Can anybody help?
TIA,
Kerin
------------------------------
Date: Tue, 11 Sep 2001 16:05:12 +0100
From: "Fiendy" <fiendy@claraNO-SPAM.co.uk>
Subject: Re: CPAN problems on OSX
Message-Id: <EIpn7.40742$y_3.2988502@nnrp3.clara.net>
I've don't usually install modules via the CPAN module, I use the manual
method, but from what it looks like either, i) you don't have access to the
net (or are behind a firewall) whilst trying the install, or ii) the file it
is trying to access doesn't exist anymore. It is an old module, the lastest
version appears to be 1.2216.
Have a look at the readme , specifically the INSTALLATION section here:
http://cpan.valueclick.com/authors/id/JWIED/Msql-Mysql-modules-1.2216.readme
for info on how to install manually.
One other note, the archives are compressed using GNU gzip - do you have
that installed on your system?
Hope this is of some help.
Fiendy.
"kerin" <kerin@airside.co.uk> wrote in message
news:31515748.0109110643.332731e1@posting.google.com...
> Hi everyone,
>
> I'm pretty much a Perl newbie (I'm a PHP developer by trade), but
> today I've had to delve into the world of Perl and CPAN, and I'm
> having problems.
>
> Whenever I try and install any module whatsoever, I get an error like
> this:
>
> cpan> install Bundle::Mysql
>
> CPAN: MD5 security checks disabled because MD5 not installed.
> Please consider installing the MD5 module.
>
> zsh: no such file or directory:
> y/sources/authors/id/J/JW/JWIED/Msql-Mysql-modules-1.1835.tar.gz
> tar: End of archive volume 1 reached
> tar: Sorry, unable to determine archive format.
> y/sources/authors/id/J/JW/JWIED/Msql-Mysql-modules-1.1835.tar.gz: No
> such file or directory
> Couldn't uncompress
y/sources/authors/id/J/JW/JWIED/Msql-Mysql-modules-1.1835.tar.gz
>
> CPAN never finds any files, ever, and always gives the "unable to
> determine archive format" error message.
>
> I realise that I'm probably doing something really dumb, and I've been
> hunting through the cpan.org documentation for hours, and I can't
> track this down.
>
> Can anybody help?
>
> TIA,
>
> Kerin
------------------------------
Date: Tue, 11 Sep 2001 15:01:19 +0100
From: "Fiendy" <fiendy@claraNO-SPAM.co.uk>
Subject: dbmopen file extensions
Message-Id: <KMon7.40724$y_3.2978623@nnrp3.clara.net>
Hi,
I've just moved from Perl 5.005-03 on Redhat 6 to Perl 5.6.0 on Linux
Mandrake 8 and I'm now having problems with accessing DB files via dbmopen.
Previously, I only needed to specify the filename, but now I have to specify
the filename AND extension Eg:
To open a DB file called '/tmp/MyDb.db':-
Perl 5.005 code = dbmopen(%H,'/tmp/MyDb', 0666);
Perl 5.6.0 code = dbmopen(%H,'/tmp/MyDb.db', 0666);
How do I get Perl 5.6.0 to add the extension automatically?
I don't really want to have to go through all the code changing every
instance unless absolutely necessary as there's a lot of it!
Thanks for any help in advance,
Mark.
------------------------------
Date: 11 Sep 2001 06:24:35 -0700
From: sami@xenetic.fi (Samppa)
Subject: Re: How to code windows service ?
Message-Id: <30586a1d.0109110524.272361d@posting.google.com>
"Simon Flack" <news@simonflack.com> wrote in message news:<9nitf2$7tt2u$1@ID-83895.news.dfncis.de>...
> > 2. Dave Roth's win32::daemon module
> > This module is released under gnu GPL license and
> > it requires external ini file. Both of these features
> > does not suit to my purpose.
> I've used Win32::Daemon several times and haven't ever had to use an
> external ini file. Can you explain what you mean?
I have obviously misunderstood the examples in
the daemon_5006.zip. Sorry about that.
Sami
------------------------------
Date: Tue, 11 Sep 2001 09:53:53 -0500
From: Bing Du <bing-du@tamu.edu>
Subject: how to get the size of each attachment?
Message-Id: <3B9E2581.AEE526A2@tamu.edu>
Hi,
'Content-Length' returned by uploadInfo() is the length of the entire
form content, right? If the form allows users to upload multiple files,
how should I get the size of each uploaded file?
Thanks,
Bing
------------------------------
Date: 11 Sep 2001 14:04:10 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: how to substitute letters within a string
Message-Id: <9nl5kq$872gp$3@fu-berlin.de>
Paul Spitalny <pauls_spam_no@pauls.seanet.com> wrote:
> I wish to substitute any occurrences of an uppercase I in a variable
> with the lower case i. I am familiar with using:
> s/I/i/g;
> but this operates on the standard input $_
> whereas I have a variable ( $fred) who's value is a string with
> possible occurrences of "I" within it. SO, how do I get the substitute
> command to work on $fred ??
forget s/// in this case.
$fred =~ tr/I/i/;
hth, tina
--
http://www.tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: Tue, 11 Sep 2001 13:45:52 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <tps5cgaarske36@corp.supernews.com>
Following is a summary of articles from new posters spanning a 8 day
period, beginning at 03 Sep 2001 14:44:43 GMT and ending at
11 Sep 2001 23:18:55 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2001 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 118 (34.9% of all posters)
Articles: 201 (18.0% of all articles)
Volume generated: 381.0 kb (18.3% of total volume)
- headers: 162.2 kb (3,312 lines)
- bodies: 214.2 kb (7,210 lines)
- original: 149.5 kb (5,301 lines)
- signatures: 4.3 kb (97 lines)
Original Content Rating: 0.698
Averages
========
Posts per poster: 1.7
median: 1.0 post
mode: 1 post - 74 posters
s: 1.7 posts
Message size: 1940.8 bytes
- header: 826.6 bytes (16.5 lines)
- body: 1091.2 bytes (35.9 lines)
- original: 761.6 bytes (26.4 lines)
- signature: 22.1 bytes (0.5 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
9 11.7 ( 7.1/ 4.5/ 2.6) Greg Coffman <Laocoon@eudoramail.com>
8 14.4 ( 8.4/ 6.0/ 2.3) "Tintin" <tintin@snowy.calculus>
5 9.1 ( 5.1/ 4.0/ 2.5) chris-usenet@roaima.demon.co.uk
5 10.3 ( 6.1/ 3.0/ 0.7) Mark Mynsted <mmynsted@prodigy.net>
5 19.6 ( 4.5/ 15.1/ 10.4) Sudhir Krishnan <sudhir@newmail.net>
4 8.4 ( 3.2/ 5.2/ 3.5) "Mr. Sunblade" <djberge@qwest.com>
4 11.7 ( 3.8/ 7.3/ 5.9) lar3ry@mediaone.net
3 6.1 ( 2.0/ 4.1/ 2.4) Doyle Rivers <doylerivers@home.com>
3 7.5 ( 2.4/ 5.1/ 3.0) John@home.net
3 8.8 ( 2.8/ 5.2/ 3.6) Ilmari Karonen <usenet11572@itz.pp.sci.fi>
These posters accounted for 4.4% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
19.6 ( 4.5/ 15.1/ 10.4) 5 Sudhir Krishnan <sudhir@newmail.net>
14.4 ( 8.4/ 6.0/ 2.3) 8 "Tintin" <tintin@snowy.calculus>
13.7 ( 1.9/ 11.9/ 10.4) 3 Mark Pennington <Mark.Pennington@sdrc.com>
11.7 ( 3.8/ 7.3/ 5.9) 4 lar3ry@mediaone.net
11.7 ( 7.1/ 4.5/ 2.6) 9 Greg Coffman <Laocoon@eudoramail.com>
10.3 ( 6.1/ 3.0/ 0.7) 5 Mark Mynsted <mmynsted@prodigy.net>
9.2 ( 0.6/ 8.6/ 8.1) 1 Rich Daley <owl@theowls.co.uk>
9.1 ( 5.1/ 4.0/ 2.5) 5 chris-usenet@roaima.demon.co.uk
8.8 ( 2.8/ 5.2/ 3.6) 3 Ilmari Karonen <usenet11572@itz.pp.sci.fi>
8.6 ( 2.5/ 6.2/ 3.4) 3 Steffen Bachmann <Steffen.Bachmann@t-online.de>
These posters accounted for 5.6% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.928 ( 2.2 / 2.4) 3 "WebMeester" <wm@rd66.rr.nu>
0.925 ( 1.2 / 1.3) 3 Alicia <alicia090677@hotmail.com>
0.924 ( 1.3 / 1.4) 3 Graham W. Boyes <thepro@toao.net>
0.875 ( 10.4 / 11.9) 3 Mark Pennington <Mark.Pennington@sdrc.com>
0.818 ( 5.9 / 7.3) 4 lar3ry@mediaone.net
0.747 ( 2.7 / 3.6) 3 Jennifer <jennlee.2@eudoramail.com>
0.716 ( 1.3 / 1.8) 3 shijialeee@yahoo.com
0.686 ( 10.4 / 15.1) 5 Sudhir Krishnan <sudhir@newmail.net>
0.682 ( 3.6 / 5.2) 3 Ilmari Karonen <usenet11572@itz.pp.sci.fi>
0.667 ( 3.5 / 5.2) 4 "Mr. Sunblade" <djberge@qwest.com>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.632 ( 2.5 / 4.0) 5 chris-usenet@roaima.demon.co.uk
0.595 ( 3.0 / 5.1) 3 John@home.net
0.580 ( 2.4 / 4.1) 3 Doyle Rivers <doylerivers@home.com>
0.579 ( 2.6 / 4.5) 9 Greg Coffman <Laocoon@eudoramail.com>
0.552 ( 3.4 / 6.2) 3 Steffen Bachmann <Steffen.Bachmann@t-online.de>
0.387 ( 2.3 / 6.0) 8 "Tintin" <tintin@snowy.calculus>
0.372 ( 1.7 / 4.6) 3 "stewie" <y_h@pi.be>
0.317 ( 0.5 / 1.6) 3 Uwe Schneider <uwe@richard-schneider.de>
0.221 ( 0.7 / 3.0) 5 Mark Mynsted <mmynsted@prodigy.net>
0.213 ( 0.6 / 3.0) 3 "Admin UsePad" <spam@funnybytes.com>
20 posters (16%) had at least three posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
19 alt.perl
10 comp.lang.perl.tk
7 cz.comp.lang.perl
6 alt.comp.perlcgi.freelance
6 alt.perl.sockets
6 comp.lang.perl
5 be.comp.internet
4 comp.lang.perl.modules
3 comp.protocols.snmp
3 de.comp.lang.perl.misc
Top 10 Crossposters
===================
Articles Address
-------- -------
6 "WebMeester" <wm@rd66.rr.nu>
6 William Seeley <william-seeley@home.com>
6 Doyle Rivers <doylerivers@home.com>
3 "matt mcConnell" <matt@m-centric.com>
3 chris-usenet@roaima.demon.co.uk
2 "Wes" <wespog@hotmail.com>
2 "Dan Nguyen" <Dan.Nguyen@lsil.com>
2 "guest" <guest@email.com>
2 Greg Coffman <Laocoon@eudoramail.com>
1 James Gilbert <jgrg@sanger.ac.uk>
------------------------------
Date: Tue, 11 Sep 2001 13:13:49 GMT
From: "Tim Schultz" <tschultz@lynx.neu.edu>
Subject: Re: PERL DBI module question
Message-Id: <76on7.1983$m5.2094171@newsfeed1.thebiz.net>
John,
Thanks for the rapid response time.
The script I'll be using is the simplest use of the DBI module. It makes no
fopen or calls to a log file. Does DBI have a built-in call to write to a
log file? (code below):
#!/usr/bin/perl
use lib qw(/data/web/65962/modules/DBI);
use DBI ();
use DBD::mysql ();
my $dbh =
DBI->connect("DBI:mysql:database=65962_1;host=mysql.hostcentric.net",
"bardavon", "romi7ruj7646",
{'RaiseError' => 1});
my $sth = $dbh->prepare("SELECT * FROM press_releases WHERE id = 13");
$sth->execute();
while (my $ref = $sth->fetchrow_hashref()) {
print "Found a row: id = $ref->{'id'}, Headline =
$ref->{'headline'}\n";
}
$sth->finish();
# Disconnect
$dbh->disconnect();
Thanks much,
-Tim
"John J. Trammell" <trammell@haqq.hypersloth.invalid> wrote in message
news:slrn9ppq4b.npc.trammell@haqq.hypersloth.net...
> On Mon, 10 Sep 2001 16:02:52 GMT, Tim Schultz <tschultz@lynx.neu.edu>
wrote:
> > I have the DBI module (or specifically the Msql-Mysql-modules)
installed.
> > (Linux Apache PERL 5.00503)
> > My test script (chmod 755ed) compiles and runs fine from the command
line
> > however running this script from the browser generates the garden
variety
> > 505. tailing the error log generates "failed to open log file fopen:
> > Permission denied".
> > Server config problem?.Anyone have any suggestions?
>
> Is your script trying to open the log file? My guess is that your
> Apache daemon is running your CGI script as nobody.nobody, and that's
> your problem. Not a Perl problem, really.
>
> --
> If the organizational structure is threatening in any way, nothing is
> going to be documented until it is completely defensible.
> - F. Brooks, _The Mythical Man-Month_
------------------------------
Date: 11 Sep 2001 14:00:49 GMT
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: PERL DBI module question
Message-Id: <slrn9ps68h.tog.trammell@haqq.hypersloth.net>
On Tue, 11 Sep 2001 13:13:49 GMT, Tim Schultz wrote:
> Thanks for the rapid response time.
> The script I'll be using is the simplest use of the DBI module.
> It makes no fopen or calls to a log file. Does DBI have a built-in
> call to write to a log file?
Lessee...
[ /usr/local/lib/site_perl/i386-linux ] grep -i fopen `locate DBI.pm`
[ /usr/local/lib/site_perl/i386-linux ] locate DBI.pm
/usr/local/lib/site_perl/i386-linux/Bundle/DBI.pm
/usr/local/lib/site_perl/i386-linux/DBI.pm
[ /usr/local/lib/site_perl/i386-linux ] grep -i fopen `locate DBI.pm`
[ /usr/local/lib/site_perl/i386-linux ]
Nope.
A couple of comments on your code:
0. use warnings;
1. use strict;
2. no need to 'use DBD...'
3. if you're coding a CGI app, use the CGI module, and read
up on CGI. There are some things you're missing...
4. your DBI code looks fine.
[code snipped]
--
Only a very small fraction of our DNA does anything; the rest is all
comments and ifdefs.
------------------------------
Date: 11 Sep 2001 07:12:02 -0700
From: sami@xenetic.fi (Samppa)
Subject: Re: PERL modules and GPL license
Message-Id: <30586a1d.0109110612.7df30619@posting.google.com>
mjd@plover.com (Mark Jason Dominus) wrote in message news:<3b97a8bf.7290$218@news.op.net>...
> In article <30586a1d.0109060149.2fa2141a@posting.google.com>,
> Samppa <sami@xenetic.fi> wrote:
> >We are planning to distribute the code as binary
> >version only, but without license payments.
>
> Sometimes companies whose activities cross the line of what
> the GNU GPL permits plead for permission, saying that they
> ``won't charge money for the GNU software'' or such like. They
> don't get anywhere this way. Free software is about freedom,
> and enforcing the GPL is defending freedom. When we defend
> users' freedom, we are not distracted by side issues such as
> how much of a distribution fee is charged. Freedom is the
> issue, the whole issue, and the only issue.
>
> http://www.fsf.org/philosophy/selling.html
Feelings ....
I try to understand all this discussion.
feeling #1:
I feel, that basicly every time when using Perl module
under GPL license the code must be released under GPL too.
feeling #2:
If I am running the GPL code as separate program (= own process)
then I can make my own license rules.
feeling #3
The GPL philosofy says :
'Free software is about freedom, and enforcing the GPL is defending freedom.'
I wonder that. If you decide to use modules under GPL you
do not have the freedom to choose if you want or not
release the source code.
I think that there is alot of programmers who must
do the whole work again, because they do not want or
can not release their source code some reason or other.
This is very sad :(
regards, Sami
------------------------------
Date: 11 Sep 2001 09:40:35 -0400
From: stanb@panix.com (Stan Brown)
Subject: Re: Really bizzare syntax error
Message-Id: <9nl48j$2jg$1@panix1.panix.com>
In <3b9e0b80.2904$10@news.op.net> mjd@plover.com (Mark Jason Dominus) writes:
>In article <9nkvpc$m4c$1@panix1.panix.com>, Stan Brown <stanb@panix.com> wrote:
>>However the caused the following sunroutine to be declared to have a syntax
>>error by the compiler!
>It appears that there is a bug in the 'Switch' module.
Thanks for the sanity check. Guess I'll go back to nested if's :-(
To bad. Since my first real production language was C, I _miss_ switch.
------------------------------
Date: Tue, 11 Sep 2001 14:50:13 +0100
From: James Gilbert <jgrg@sanger.ac.uk>
To: Stan Brown <stanb@panix.com>
Subject: Re: Really bizzare syntax error
Message-Id: <3B9E1695.2435B7B7@sanger.ac.uk>
Stan Brown wrote:
>
> In <3b9e0b80.2904$10@news.op.net> mjd@plover.com (Mark Jason Dominus) writes:
>
> >In article <9nkvpc$m4c$1@panix1.panix.com>, Stan Brown <stanb@panix.com> wrote:
> >>However the caused the following sunroutine to be declared to have a syntax
> >>error by the compiler!
>
> >It appears that there is a bug in the 'Switch' module.
>
> Thanks for the sanity check. Guess I'll go back to nested if's :-(
>
> To bad. Since my first real production language was C, I _miss_ switch.
It will be in Perl 6 (but under a different name "given", "when"
instead of "switch", "case").
------------------------------
Date: Tue, 11 Sep 2001 14:08:45 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Really bizzare syntax error
Message-Id: <slrn9ps1l0.5jc.tadmc@tadmc26.august.net>
Stan Brown <stanb@panix.com> wrote:
>my $argtmp = join ', ', map {defined($_[$_])
> ? "Arg$_ ->$_[$_]<-"
> : "Arg$_ ->*UNDEF*<-"
> } 0 .. $#_;
>
>However the caused the following sunroutine to be declared to have a syntax
>error by the compiler!
What is the error message text?
Error messages are meant to help in troubleshooting, so you should
provide the messages when asking for help with troubleshooting.
>#!/usr/local/bin/perl
#!/usr/local/bin/perl -w
use strict;
>It seems to be
^^^^^^^^^^^
Why not show us the error message text? We might be able to
firm that statement up a bit.
>compalining about the first swithc statement.
>What dumb user error have I made, here?
Asking for help with a syntax error without showing the text of
the syntax error message.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 11 Sep 2001 14:03:44 GMT
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: Regular expression
Message-Id: <slrn9ps6e0.tog.trammell@haqq.hypersloth.net>
On Tue, 11 Sep 2001 09:39:44 +0200, Tim Lauterborn wrote:
> I want to use the following line:
>
> $file_content =~ s/This is/These are/gis;
>
> Unfortunately "This is" is not replaced by "These are". Does someone know a
> solution?
[ ~ ] perl -pe 's/This is/These are/gis'
This is my rifle, this is my gun.
These are my rifle, These are my gun.
[ ~ ]
------------------------------
Date: Tue, 11 Sep 2001 14:08:46 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Regular expression
Message-Id: <slrn9ps348.5jc.tadmc@tadmc26.august.net>
Rainer Klier <Rainer.Klier@erl.sbs.de> wrote:
>Tim Lauterborn wrote:
>>
>> $file_content =~ s/This is/These are/gis;
>>
>> Unfortunately "This is" is not replaced by "These are". Does someone know a
>> solution?
>
>There must be something else broken in your code.
^^^^^^^^^^^^
The code looks fine. If the pattern is not matching and the pattern
(code) is OK, then it must be because of the _data_ rather than
the code.
There are 2 things to consider when a pattern match isn't doing
what you expect: the pattern and the string to be matched against.
It is easy to be sucked into concentrating on the pattern to the
exclusion of the other possibility :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 11 Sep 2001 13:45:50 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <tps5ceesn1jo35@corp.supernews.com>
Following is a summary of articles spanning a 8 day period,
beginning at 03 Sep 2001 14:44:43 GMT and ending at
11 Sep 2001 23:18:55 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2001 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Excluded Posters
================
perlfaq-suggestions\@(?:.*\.)?perl\.com
faq\@(?:.*\.)?denver\.pm\.org
Totals
======
Posters: 338
Articles: 1118 (470 with cutlined signatures)
Threads: 299
Volume generated: 2078.0 kb
- headers: 924.1 kb (18,078 lines)
- bodies: 1092.4 kb (36,203 lines)
- original: 684.1 kb (24,682 lines)
- signatures: 60.4 kb (1,355 lines)
Original Content Rating: 0.626
Averages
========
Posts per poster: 3.3
median: 2.0 posts
mode: 1 post - 167 posters
s: 5.7 posts
Posts per thread: 3.7
median: 3 posts
mode: 1 post - 79 threads
s: 4.2 posts
Message size: 1903.3 bytes
- header: 846.4 bytes (16.2 lines)
- body: 1000.6 bytes (32.4 lines)
- original: 626.6 bytes (22.1 lines)
- signature: 55.3 bytes (1.2 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
52 125.6 ( 41.7/ 81.0/ 49.8) Benjamin Goldberg <goldbb2@earthlink.net>
44 64.3 ( 38.6/ 25.3/ 14.4) Bart Lateur <bart.lateur@skynet.be>
40 103.3 ( 45.4/ 52.4/ 37.0) tadmc@augustmail.com
22 37.0 ( 18.0/ 18.3/ 5.4) "John W. Krahn" <krahnj@acm.org>
20 48.5 ( 20.7/ 27.8/ 21.6) Jonadab the Unsightly One <jonadab@bright.net>
20 39.4 ( 17.3/ 19.8/ 9.1) timmy@cpan.org
19 34.1 ( 13.4/ 20.7/ 16.2) Stan Brown <stanb@panix.com>
18 23.2 ( 12.7/ 9.4/ 9.3) Rafael Garcia-Suarez <rgarciasuarez@free.fr>
17 30.5 ( 11.2/ 14.6/ 7.3) Randal L. Schwartz <merlyn@stonehenge.com>
17 28.5 ( 13.3/ 15.2/ 4.8) Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
These posters accounted for 24.1% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
125.6 ( 41.7/ 81.0/ 49.8) 52 Benjamin Goldberg <goldbb2@earthlink.net>
103.3 ( 45.4/ 52.4/ 37.0) 40 tadmc@augustmail.com
64.3 ( 38.6/ 25.3/ 14.4) 44 Bart Lateur <bart.lateur@skynet.be>
48.5 ( 20.7/ 27.8/ 21.6) 20 Jonadab the Unsightly One <jonadab@bright.net>
39.4 ( 17.3/ 19.8/ 9.1) 20 timmy@cpan.org
37.0 ( 18.0/ 18.3/ 5.4) 22 "John W. Krahn" <krahnj@acm.org>
36.2 ( 16.6/ 14.1/ 7.0) 15 Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
34.1 ( 13.4/ 20.7/ 16.2) 19 Stan Brown <stanb@panix.com>
33.3 ( 13.1/ 20.2/ 15.9) 15 "Godzilla!" <godzilla@stomp.stomp.tokyo>
30.5 ( 11.2/ 14.6/ 7.3) 17 Randal L. Schwartz <merlyn@stonehenge.com>
These posters accounted for 26.6% of the total volume.
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 1.1 / 1.1) 5 TM <tm@kernelconsult.com>
0.989 ( 9.3 / 9.4) 18 Rafael Garcia-Suarez <rgarciasuarez@free.fr>
0.975 ( 3.5 / 3.6) 5 BUCK NAKED1 <dennis100@webtv.net>
0.951 ( 13.9 / 14.6) 14 abigail@foad.org
0.789 ( 15.9 / 20.2) 15 "Godzilla!" <godzilla@stomp.stomp.tokyo>
0.784 ( 16.2 / 20.7) 19 Stan Brown <stanb@panix.com>
0.775 ( 21.6 / 27.8) 20 Jonadab the Unsightly One <jonadab@bright.net>
0.766 ( 2.7 / 3.5) 6 Ian Boreham <ianb@ot.com.au>
0.759 ( 8.3 / 11.0) 10 peter pilsl <pilsl_@goldfisch.at>
0.758 ( 9.3 / 12.3) 9 Dave Tweed <dtweed@acm.org>
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.451 ( 5.8 / 12.8) 12 Bob Walton <bwalton@rochester.rr.com>
0.432 ( 2.9 / 6.7) 6 efflandt@xnet.com
0.414 ( 1.1 / 2.6) 5 Peter J. Acklam <jacklam@math.uio.no>
0.405 ( 1.1 / 2.7) 5 Tony Curtis <tony_curtis32@yahoo.com>
0.403 ( 1.3 / 3.2) 5 garry@zvolve.com
0.387 ( 2.3 / 6.0) 8 "Tintin" <tintin@snowy.calculus>
0.343 ( 3.7 / 10.8) 16 news@tinita.de
0.314 ( 4.8 / 15.2) 17 Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
0.297 ( 5.4 / 18.3) 22 "John W. Krahn" <krahnj@acm.org>
0.221 ( 0.7 / 3.0) 5 Mark Mynsted <mmynsted@prodigy.net>
53 posters (15%) had at least five posts.
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
41 Undef'ing multiple variables
24 Recommendations for a PERL editor
22 references, slices, voodoo
15 Baiting Gozilla to obtain quality code for nothing!!
14 How can I find the PID's of my children?
14 printing all even || odd numbers from array
13 win32 rmdir questions
13 Where can I find a Perl SSH Telnet Client?
12 Why doesn't this regex work?
12 Open 2 exes from Perl
These threads accounted for 16.1% of all articles.
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
71.0 ( 37.9/ 27.8/ 14.4) 41 Undef'ing multiple variables
49.6 ( 20.5/ 25.6/ 16.1) 22 references, slices, voodoo
41.8 ( 22.0/ 18.2/ 9.6) 24 Recommendations for a PERL editor
28.6 ( 5.0/ 23.1/ 15.9) 6 Arrays, References and indexes.
28.4 ( 11.2/ 16.5/ 10.1) 14 How can I find the PID's of my children?
28.1 ( 16.7/ 10.7/ 5.8) 15 Baiting Gozilla to obtain quality code for nothing!!
25.0 ( 11.0/ 13.4/ 7.8) 10 OT: Re: Recommendations for a PERL editor
24.2 ( 7.1/ 15.7/ 11.2) 8 HASH question
23.4 ( 8.6/ 13.0/ 8.8) 10 Confused (again) over complex data structures.
23.2 ( 5.8/ 17.0/ 11.6) 6 ActivePerl says Out of Memory, but I'm not out of memory? Is this a limitation in the Perl build I have?
These threads accounted for 16.5% of the total volume.
Top 10 Threads by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.920 ( 1.9/ 2.0) 6 sending email
0.839 ( 2.5/ 3.0) 5 pictures saving problem...
0.826 ( 12.4/ 15.0) 7 Godzilla DOS Internal Script Timer
0.820 ( 1.5/ 1.9) 6 from .pl to .exe on Win2K
0.761 ( 3.6/ 4.7) 8 File::Find not recursing on Win32 Perl 5.001
0.744 ( 4.7/ 6.4) 6 ignoring lines in file using array of phrases to skip
0.723 ( 1.8/ 2.5) 5 Is PERL supported
0.719 ( 3.5/ 4.8) 6 start a script when a process exits
0.717 ( 3.2/ 4.4) 5 cgi.pm cookie function - am I missing something?
0.715 ( 11.2/ 15.7) 8 HASH question
Bottom 10 Threads by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.461 ( 3.4 / 7.4) 5 guestbook
0.458 ( 1.8 / 3.9) 6 @INC on VMS
0.458 ( 1.9 / 4.1) 6 Simple regexp
0.438 ( 2.2 / 4.9) 7 Black Perl
0.428 ( 3.4 / 8.0) 12 Open 2 exes from Perl
0.428 ( 1.2 / 2.8) 5 dec2hex conversion ,uninitialized value
0.421 ( 2.7 / 6.3) 8 Daily iteration
0.409 ( 3.4 / 8.4) 7 Problem with parsing more than one line ( Please HELP )
0.385 ( 1.8 / 4.6) 8 Genericly printing the arguments to s afunction?
0.373 ( 1.8 / 4.8) 9 How do I use a / in a regular expression?
79 threads (26%) had at least five posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
19 alt.perl
10 comp.lang.perl.tk
7 cz.comp.lang.perl
6 alt.comp.perlcgi.freelance
6 alt.perl.sockets
6 comp.lang.perl
5 be.comp.internet
4 comp.lang.perl.modules
3 comp.protocols.snmp
3 de.comp.lang.perl.misc
Top 10 Crossposters
===================
Articles Address
-------- -------
9 Smiley <gurm@intrasof.com>
6 William Seeley <william-seeley@home.com>
6 "WebMeester" <wm@rd66.rr.nu>
6 Benjamin Goldberg <goldbb2@earthlink.net>
6 Doyle Rivers <doylerivers@home.com>
6 Joe Smith <inwap@best.com>
3 chris-usenet@roaima.demon.co.uk
3 "matt mcConnell" <matt@m-centric.com>
2 "Dan Nguyen" <Dan.Nguyen@lsil.com>
2 garry@zvolve.com
------------------------------
Date: 11 Sep 2001 09:44:46 -0400
From: stanb@panix.com (Stan Brown)
Subject: Why would the perl compiler report errors on the wrong line nO.?
Message-Id: <9nl4ge$31v$1@panix1.panix.com>
Sometime yesterday, for a particualr script, the perl compile sudenly
started reporting syntax errors as 1 to 2 lines _prior_ to the actual
placement of the error.
Any sugestions as to what may be causing this?
------------------------------
Date: Tue, 11 Sep 2001 14:31:17 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Why would the perl compiler report errors on the wrong line nO.?
Message-Id: <slrn9ps4uh.5ns.tadmc@tadmc26.august.net>
Stan Brown <stanb@panix.com> wrote:
>Sometime yesterday, for a particualr script, the perl compile sudenly
^^^^^^^
Soon after you edited the program, I assume? :-)
>started reporting syntax errors as 1 to 2 lines _prior_ to the actual
>placement of the error.
Again no code and no message?
We are reduced to merely guessing yet again, an inefficient
approach to resolving the problem.
'Cmon man, give us something to work with!
>Any sugestions as to what may be causing this?
It is normal.
Error detection/recovery in parsers is Hard.
You get the same thing with (nearly?) all machine language parsers.
It is a "compiler theory" thing, nothing specific to Perl in it.
You're stil typing tooo fst. :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
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 1732
***************************************