[12058] in Perl-Users-Digest
Perl-Users Digest, Issue: 5658 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 14 04:07:20 1999
Date: Fri, 14 May 99 01:00:32 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 14 May 1999 Volume: 8 Number: 5658
Today's topics:
'No such file' from Data::Flow using h2xs <karner@andrew.cmu.edu>
best way to database stuff using Perl? owner@btinternet.com
Re: best way to database stuff using Perl? (Charles R. Thompson)
Re: best way to database stuff using Perl? owner@btinternet.com
Re: browser call opens text does not run perl script <baliga@synopsys.com>
bug <malsbet@mail.state.fl.us>
calling runtime added functions <neb@one.net>
Re: CGI timeout in web-based listserv <nospam@atanytimeonthe.net>
cgi-lib.pl and uploads jhenzel@gci-net.com
comp.lang.perl.* archive? <pkotala@logis.cz>
Re: Creating $userid from $surname and $givenname <baliga@synopsys.com>
Re: Different Database Modules (GDBM) <Tim.Potter@anu.edu.au>
Re: Error on xsubpp. help. <okpolis@okpolis.joo.net>
Generating data from regular expressions <stevem@rational.REMOVE.com>
Re: Generating data from regular expressions (Tad McClellan)
Re: How to get current working directory? (H. Tiltmann)
Re: How to get current working directory? (Bob Trieger)
I need some help tex2121@my-dejanews.com
Re: I need some help <ebohlman@netcom.com>
Re: japh tags (Benjamin Franz)
Re: man pages and FAQs: why posted? (Lee)
Re: man pages and FAQs: why posted? <ebohlman@netcom.com>
Match string at the beginning of each line <seugenio@man.amis.com>
Re: Newbie question on CGI developing (Fuzzy Warm Moogles)
Re: Newbie question on CGI developing (Arjun Ray)
Re: perl install on bsd/os 3.1 (Konstantinos Agouros)
perlcc <---problem!? (Ryan Ngi)
Re: PERLFUNC: eval - catch exceptions or compile code (Gary E. Ansok)
Perlish linguistics (aka shibbolethim) <fbart@sprynet.com>
Re: Please Help: Am I creating the hash wrong, or acce (Andrew Allen)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 13 May 1999 18:42:48 -0400
From: Keith A Arner <karner@andrew.cmu.edu>
Subject: 'No such file' from Data::Flow using h2xs
Message-Id: <Pine.SOL.3.96L.990513183530.1445H-100000@unix6.andrew.cmu.edu>
I'm attempting to figure out XS, and am following the example on page 297
of _Advanced Perl Programming_. I've got a file, mytest.c, which contains
a hello world, and a mytest.h for it.
When I run:
h2xs -x -n MyTest mytest.h
I get the following output:
Scanning typemaps...
Scanning /usr/local/lib/perl5/ExtUtils/typemap
Scanning mytest.h for functions...
:1: mytest.h: No such file or directory
:1: mytest.h: No such file or directory
Writing MyTest/MyTest.pm
Writing MyTest/MyTest.xs
Writing MyTest/Makefile.PL
Writing MyTest/test.pl
Writing MyTest/Changes
Writing MyTest/MANIFEST
Poking around in the code for h2xs, it looks like the 'No such file...'
is coming from within either Data::Flow::new() or Data::Flow::set(), but I
can't nail it down any closer than that.
I'm using
h2xs v1.18
C::Scan v0.51
Data::Flow v0.05
Anyone have any brainstorms on what's going wrong?
Thanks,
Keith
------------------------------
Date: Fri, 14 May 1999 01:21:49 +0100
From: owner@btinternet.com
Subject: best way to database stuff using Perl?
Message-Id: <373B6C9D.7F18C9B@btinternet.com>
People,
I know that the preffered way these days is Cold Fusion, but
say I want to do this via Perl, how would I go about this?
Many thanks
Ben
------------------------------
Date: Thu, 13 May 1999 23:34:23 GMT
From: design@raincloud-studios.com (Charles R. Thompson)
Subject: Re: best way to database stuff using Perl?
Message-Id: <MPG.11a52ce0924a30ec9896c0@news>
[ Congratulations, owner@btinternet.com you could be a winner! Return to
comp.lang.perl.misc to claim your prize. ]
In article <373B6C9D.7F18C9B@btinternet.com>, owner@btinternet.com
says...
> I know that the preffered way these days is Cold Fusion, but
Like #%(*%# it is. Bad newbie! Bad! :)
> say I want to do this via Perl, how would I go about this?
Depends on alot. There is a big difference between your choices if you
are running your own server in a LAN or WAN deal and renting a little
virtual server. Also, depends on what platform you are going to run on.
What is the target enviroment for the script(s)? Owned LAN, Virtual
Server, Self Maintained Web Server, Windows, UNIX, MAC. The list goes on.
--
Charles R. Thompson
RainCloud Studios
"That? That's no script. That's your attempt at a rather complex README
file."
------------------------------
Date: Fri, 14 May 1999 02:05:03 +0100
From: owner@btinternet.com
Subject: Re: best way to database stuff using Perl?
Message-Id: <373B76BE.34D09921@btinternet.com>
OK.....to be short and sweet, access to a cgi-bin on a virtual server. I've
heard a lot about these modules, and am wondering if someone can
explain/advise on the best way of modifying/querying a database file (created
from scratch or an existing, preferably MS Access, one)
Thanks again
Ben
Charles R. Thompson wrote:
> [ Congratulations, owner@btinternet.com you could be a winner! Return to
> comp.lang.perl.misc to claim your prize. ]
>
> In article <373B6C9D.7F18C9B@btinternet.com>, owner@btinternet.com
> says...
> > I know that the preffered way these days is Cold Fusion, but
>
> Like #%(*%# it is. Bad newbie! Bad! :)
>
> > say I want to do this via Perl, how would I go about this?
>
> Depends on alot. There is a big difference between your choices if you
> are running your own server in a LAN or WAN deal and renting a little
> virtual server. Also, depends on what platform you are going to run on.
>
> What is the target enviroment for the script(s)? Owned LAN, Virtual
> Server, Self Maintained Web Server, Windows, UNIX, MAC. The list goes on.
>
> --
> Charles R. Thompson
> RainCloud Studios
> "That? That's no script. That's your attempt at a rather complex README
> file."
------------------------------
Date: Thu, 13 May 1999 16:35:29 -0700
From: Yogish Baliga <baliga@synopsys.com>
Subject: Re: browser call opens text does not run perl script
Message-Id: <373B61C1.DAAEE796@synopsys.com>
This has something to do with the web server configuration.
Try giving .cgi extension instead of .pl
-- Baliga
earlie wrote:
> Why does the browser open the .pl as a text file in notepad rather than
> run the script?
> This is specific to one comp on the network (as far as i can tell) and
> the others run the script just fine.
>
> Thanks
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> ---Share what you know. Learn what you don't.---
------------------------------
Date: Tue, 11 May 1999 13:21:25 -0400
From: Tara Malsberger <malsbet@mail.state.fl.us>
Subject: bug
Message-Id: <37386715.D6589641@mail.state.fl.us>
I can find no information about this particular instance. I'm trying
out Win32::Netresource and AddConnection.
This is a copy of the code (from Dave Roth's book _Win32 Perk Prog._)
use win32::netresource;
%netresource = (
LocalName => "R:",
RemoteName => "\\smsis08apps\all_apps"
);
$user = "";
$password = "";
if( Win32::netresource::addconnection( \%netresource, $password, $user,
1 ))
{
print "Successful!\n";
}else{
print neterror();
}
This is the error produced across multiple machines and Windows OS's
using ActiveState v.515
X:\Perl>perl h:\perlsc~1\netres~1.pl
Can't load 'D:\PERL\site\lib/auto/Win32/NetResource/NetResource.dll' for
module
Win32::NetResource: load_file:A device attached to the system is not
functioning
at D:\PERL\lib/DynaLoader.pm line 169.
at h:\perlsc~1\netres~1.pl line 1
BEGIN failed--compilation aborted at h:\perlsc~1\netres~1.pl line 1.
X:\Perl>
Please respond to this email address, as I seem to have a poor News
reader.
Thanks to all you's ;)
Tara
malsbet@mail.state.fl.us
------------------------------
Date: Thu, 13 May 1999 20:34:14 -0400
From: Ben <neb@one.net>
Subject: calling runtime added functions
Message-Id: <373B6F86.756A8BB7@one.net>
I am adding a function with the Safe package which I need to
call with a argument later on in order to continue my program.
I am currently doing something like this:
foreach ...... (&{$::{$nameofcall}}($argument)) {..etc.
to do this. It doesnt work when I use the Safe package.
Specifically I am calling rdo on a filehandle and then checking
to see if it has constructed a function of name with the varglob
method. I can't figure out how to do this correctly.
I need the results (in a array) of the call so and I don't know the
name ahead of time so doing something like:
eval {
push @tmp, $nameofcall($argument);
}
doesnt seem to work.
If you can help, please email a responce.
Thanks,
Ben.
------------------------------
Date: Thu, 13 May 1999 21:06:22 -0700
From: N <nospam@atanytimeonthe.net>
Subject: Re: CGI timeout in web-based listserv
Message-Id: <373BA13E.8E3@atanytimeonthe.net>
> When a message is sent to a list of 800 subscribers, it takes so long to write
> out all the messages into the spool directory that there is a timeout before
> the "done" page can be written to the sender's waiting browser.
I got this from a web server admin..
>Your scripts are most likely being killed by us. We have a daemon
>that kills all user processes that exceed a running time of
>5 minutes. We have found that some people are poor perl coders
>and some of the cgi's if left on their own will run forever.
>In order to make the machine more efficient we kill all processes
>that have run for longer than 5 minutes.
So how about that??
Here's a plan, have your script log every thing to a file, like a
counter of things done, where in a file you are or something , every
time you COMPLETE something, log it to this file.
Make sure script never runs more than 5 minutes, and MAYBE even can run
TWO / THREE or whatever copies at the same time, meaning use LOCK for
the files and such, and remember that it could be running at the same
time as other programs like it (is there a way to check to see if your
script is already running? So then you just quit if it is ?)
THEN - have it send a browser these lines:
print "Content-Type: text/html\n\n";
print "\n<HTML>\n<HEAD>\n<TITLE>My CGI Script</TITLE>\n";
print "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"300\">\n";
print "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n";
print "\n</HEAD>\n<BODY>\n";
Set the refresh where you like in seconds, and as long as you have a
connection and the cgi is "open" as a page, then it will re-load it's
self!
I basicly have it do a few things (way under the 5 minutes), and then it
quits, waits till it's reloaded again. My ISP loves me...
Have fun!
Hey guys, what does your server admin say about this?
------------------------------
Date: Thu, 13 May 1999 23:10:37 GMT
From: jhenzel@gci-net.com
Subject: cgi-lib.pl and uploads
Message-Id: <373b5bb4.33696012@news.gci-net.com>
Hi
I am posting here partly b/c this is a perl question as well as a cgi
question. Not sure where the problem is.
I am using cgi-lib.pl to setup a file upload via a website.
https://bigx.agforbes.arizona.edu/biod/fup.html. The problem I seem
to be having is that the upload bombs out after about 500k. Same
limit for both IE and Netscape. My uses will have larger files to
upload. I have checked the paramters in the library and even cranked
the maxsize parameter way up and still no luck . Any suggestions
would be greatly appreciated.
BTW, this page will get password protection once it is finished so
having a larger file size will not be a problem since only a few
users will use the capability.
Thanks
Jerry Henzel
------------------------------
Date: Fri, 14 May 1999 09:21:50 +0200
From: "Pavel Kotala" <pkotala@logis.cz>
Subject: comp.lang.perl.* archive?
Message-Id: <926666515.495914@gate.logis.cz>
Exists any way to explore historical news? I am biginner in discussion
groups.
Thank you
Pavel Kotala
------------------------------
Date: Thu, 13 May 1999 16:33:24 -0700
From: Yogish Baliga <baliga@synopsys.com>
Subject: Re: Creating $userid from $surname and $givenname
Message-Id: <373B6144.C1C12FE7@synopsys.com>
michael.amper@tekconnect.com wrote:
> Never mind, found it in the perlfaq4.html...
>
> #create userid
> $initial = lc(substr($givenname,0,1));
>
> $sur = $surname;
> $sur =~ s/\s//;
Give g at the end otherwise only the first occurence of a white space is
replaced with null.
>
>
> $first7sur = lc(substr($sur,0,7));
>
> $userid = "$initial" . "$first7sur";
>
> "That'll do pig, that'll do..."
>
> In article <7hf83n$nmr$1@nnrp1.deja.com>,
> michael.amper@tekconnect.com wrote:
> > I have a comma-delimited file with the format:
> >
> > surname,givenname
> >
> > from which I need to generate a userid and spit everything out to an
> > LDIF file. I solved the LDIF part, but I can't seem to get a userid
> out
> > of these two fields. I can:
> >
> > ($surname,$givenname) = split /,/; #get the values
> >
> > but what I'd like to do now is:
> >
> > $given = (the first character of $givenname);
> > $sur = (the first seven non-white characters of $surname);
> > $userid = "$given" . "$sur";
> >
> > so I can continue with the script.
> >
> > Can any one help me out with a snippet?
> >
> > Michael Craig Amper
> > Systems Designer
> > TekConnect Corporation
> > michael.amper@tekconnect.com
> >
> > --== Sent via Deja.com http://www.deja.com/ ==--
> > ---Share what you know. Learn what you don't.---
> >
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> ---Share what you know. Learn what you don't.---
------------------------------
Date: 14 May 1999 12:06:50 +1000
From: Tim Potter <Tim.Potter@anu.edu.au>
To: nkaiser@my-dejanews.com
Subject: Re: Different Database Modules (GDBM)
Message-Id: <6y675wo151.fsf@acronym.anu.edu.au>
nkaiser@my-dejanews.com writes:
> I have a CGI which uses the GDBM_File module for storing data. I'm
> finding that porting this program to different servers is difficult -
> many do not have the GDBM_File module. Is there a different database
If you are building your own Perl, GDBM needs to be installed on a
machine before Perl is compiled as it comes as part of the Perl
distribution.
> module I could use that most unix/NT machines always have? I'm looking
> for one that won't involve much code changing either. The way I use
> GDBM is like this : tie (%HASH,GDBM_File,"file.hash",GDBM_WRCREAT),0700);
Try using any of the other DBM modules: SDBM_File, NDBM_File,
ODBM_File or any others listed in the AnyDBM_File man page, although
you may run in to exactly the same problem.
> Also, why can't I find the GDBM_File module from the CPAN? Is the only
> way to install that module by recompiling Perl after installing the
> libgdbm.a?
I believe so.
> One last thing - Sometimes I don't have the privelege to do a "make
> install" on a Perl module. Is it possible to use a module without doing
> a "make install"?
Try doing a 'perl Makefile.PL PREFIX=/home/tpot/perl' and then
installing the module. You'll need to set the PERLLIB environment
variable to point to this directory.
Tim.
>
> Thanks!
>
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> ---Share what you know. Learn what you don't.---
--
Tim Potter, System Admin/Programmer, Head Bee Guy
Advanced Computational Systems CRC, RSISE Bldg Australian National University,
Canberra 0200, AUSTRALIA Ph: +61 2 62798813 Fax: +61 2 62798602
------------------------------
Date: Fri, 14 May 1999 07:42:46 +0900
From: =?euc-kr?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?= <okpolis@okpolis.joo.net>
Subject: Re: Error on xsubpp. help.
Message-Id: <7hfkmu$qs9$1@news2.kornet.net>
SGkuDQoNCkkgZG9uJ3Qga25vdyB3aGF0IEkgd3JvbmcuDQoNCkM6XFdXV1xHQURcRGF0YS1EdW1w
ZXItMi4xMD5wZXJsIG1ha2VmaWxlLnBsDQpDaGVja2luZyBpZiB5b3VyIGtpdCBpcyBjb21wbGV0
ZS4uLg0KTG9va3MgZ29vZA0KVXNhZ2U6IHhzdWJwcCBbLXZdIFstQysrXSBbLWV4Y2VwdF0gWy1w
cm90b3R5cGVzXSBbLW5vdmVyc2lvbmNoZWNrXSBbLW5vbGluZW51bWINCmVyc10gWy1zIHBhdHRl
cm5dIFstdHlwZW1hcCB0eXBlbWFwXS4uLiBmaWxlLnhzDQpXcml0aW5nIE1ha2VmaWxlIGZvciBE
YXRhOjpEdW1wZXINCg0KSSB1c2UgQWN0aXZlU3RhdGUgUGVybCA1MTUgYW5kIEJvcmxhbmQgQ0J1
aWxkZXIuIEkgZG9uJ3Qga25vdyB3aHkgSQ0KaGF2ZSBhIG1lc3NhZ2UgdGhhdCBJIGRpZG4ndCBz
ZWVuIGF0IHVuaXguDQoNClVzYWdlOiB4c3ViLi4gd2hhdCdzIHRoYXQ/Pw0KDQpUaGFuayB5b3Uu
DQoNCg==
------------------------------
Date: Thu, 13 May 1999 16:09:53 -0700
From: Steve Moore <stevem@rational.REMOVE.com>
Subject: Generating data from regular expressions
Message-Id: <373B5BC1.54B79F97@rational.REMOVE.com>
Does anyone know if there is shareware that will generate data based on
a regular expression?
Thanks.
-------------------
Steve Moore
Rational Software Corp.
stevem@rational.com
------------------------------
Date: Thu, 13 May 1999 16:39:03 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Generating data from regular expressions
Message-Id: <79dfh7.1j2.ln@magna.metronet.com>
Steve Moore (stevem@rational.REMOVE.com) wrote:
: Does anyone know if there is shareware that will generate data based on
: a regular expression?
What would you have it generate?
/.*/s
That is going to generate a rather large list...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 14 May 99 04:03:17 GMT
From: hti@lago.ping.de (H. Tiltmann)
Subject: Re: How to get current working directory?
Message-Id: <7hfl4f$ksn$1@lilly.ping.de>
In article <373A4BA5.8DEA8B50@ust.hk>, Chim Kin Sang <mecks@ust.hk> wrote:
>Kevin A. Collins wrote:
>
>> Hi there,
>>
>> I was just wondering if there is a standard way to get the path of the
>> current working directory. I've looked through a lot of the Perl
>> documentation, but haven't found an easy solution. I'm using Perl for
>> Win32 right now and there is a Win32::GetCwd() function, but I just
>> thought there might be a more portable solution.
>>
Hi Kevin,
a book of mine says 'Cwd' is a standard module for that, which (by its name)
looks quite portable. I'm afraid I cannot try this right now.
Anyway, if my book is right, I am very interested in _why_ it is necessary to
provide a platform specific function if there is a portable one already.
Any comments?
Helmut
------------------------------
Date: Thu, 13 May 1999 23:36:45 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: How to get current working directory?
Message-Id: <7hfmhn$h04$1@holly.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
hti@lago.ping.de (H. Tiltmann) wrote:
>In article <373A4BA5.8DEA8B50@ust.hk>, Chim Kin Sang <mecks@ust.hk> wrote:
>>Kevin A. Collins wrote:
>>
>>> Hi there,
>>>
>>> I was just wondering if there is a standard way to get the path of the
>>> current working directory. I've looked through a lot of the Perl
>>> documentation, but haven't found an easy solution. I'm using Perl for
>>> Win32 right now and there is a Win32::GetCwd() function, but I just
>>> thought there might be a more portable solution.
>>>
>
>Hi Kevin,
>
>a book of mine says 'Cwd' is a standard module for that, which (by its name)
>looks quite portable. I'm afraid I cannot try this right now.
>Anyway, if my book is right, I am very interested in _why_ it is necessary to
>provide a platform specific function if there is a portable one already.
>Any comments?
#!/usr/local/bin/perl -w
use Cwd;
print cwd;
works for me on Win32, Linux and Solaris.
------------------------------
Date: Fri, 14 May 1999 01:17:43 GMT
From: tex2121@my-dejanews.com
Subject: I need some help
Message-Id: <7hftjl$7ba$1@nnrp1.deja.com>
I am trying to write a Perl program that displays the n most freqent m
word sequences in an arbitrary number of input files. n , m and the
input file names should be specified on the command line. The program
should display the word sequences as well as the count of the number of
times each occurs in the input files. The format of the command line
arguments should be as follows:
Program n m [list of input files]
Also disreguard punctuation, case sensitivity numbers.
I am stuck on how to start this problem. I have not done much
programing in perl, other than some tests of stuff that I am reading
from a book I have. Any ideas would be appreciated. Thanks
ty
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Fri, 14 May 1999 02:17:25 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: I need some help
Message-Id: <ebohlmanFBpAD1.8Du@netcom.com>
tex2121@my-dejanews.com wrote:
: I am trying to write a Perl program that displays the n most freqent m
: word sequences in an arbitrary number of input files. n , m and the
: input file names should be specified on the command line. The program
: should display the word sequences as well as the count of the number of
: times each occurs in the input files. The format of the command line
: arguments should be as follows:
: Program n m [list of input files]
: Also disreguard punctuation, case sensitivity numbers.
: I am stuck on how to start this problem. I have not done much
: programing in perl, other than some tests of stuff that I am reading
: from a book I have. Any ideas would be appreciated. Thanks
Well, when you find yourself stuck, the first step is to try to break the
task down into manageable pieces, and then break those pieces down even
further until the code starts to write itself.
In this case, one of those pieces is obviously splitting the input up
into words and normalizing their case. Breaking it down further might
involve reading each file (if you need to maintain separate statistics
for each file) or not (in which case you want to (re)read perlop and look
at the "diamond operator," <>, which will do a lot of your work for you).
For maintaining the sequence counts, you're almost certainly going to
want to use a multi-dimensional hash, so take a look at perllol and
perldsc. You're going to have a slightly sticky time because the number
of dimensions to the hash is variable rather than fixed, so you can't
just use a fixed number of nested loops. A recursive technique might be
the best one.
------------------------------
Date: Thu, 13 May 1999 23:30:56 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: japh tags
Message-Id: <QgJ_2.24458$ny.1620063@typhoon-sf.snfc21.pbi.net>
In article <7hdbr3$b2u$1@nnrp1.deja.com>,
<todd_b_smith@my-dejanews.com> wrote:
>Let's get a thread going with people's tag lines that print "Just
>Another Perl Hacker." I've seen lots, but now I want to see them all!
$_='bfd59934ae3d4bde348887a3ae4587a311aeec44f26087a372';
foreach(map{hex}m/(..)/g){my $n=257;
while($_--){$n=($n*257)%251};print chr($n)}
--
my $name=reverse('Benjamin "Snowhare" Franz');my $a=0;
$_='024e046b794c446f25423a6375477d6c14450a39447a07637e';
s/(..)/push(@ARGV,hex($1))/eg;while($_=chop $name){
$_=ord^shift;$_+=$a;$_%=108;print chr(($a=$_)+10)}
------------------------------
Date: Thu, 13 May 1999 19:11:54 -0500
From: rlb@intrinsix.ca (Lee)
Subject: Re: man pages and FAQs: why posted?
Message-Id: <B360D47A9668ADDBC8@0.0.0.0>
In article <7hfgr4$cqo$2@info2.uah.edu>,
gbacon@itsc.uah.edu (Greg Bacon) wrote:
>In article <B360B0679668A5621A@0.0.0.0>,
> rlb@intrinsix.ca (Lee) writes:
>: I'm wondering why all of the man pages and FAQs are being posted here.
>: Wouldn't it make more sense to write a short and simple "FAQ 0.0: Where to
>: start" that would point newbies to these resources, and post it every day
>: or two?
>
>I guess you haven't been reading this newsgroup for very long. Maybe
>you haven't noticed the overabundance of questions that could be
>answered after only a short read of Perl's documentation. I believe
>the hope behind the FAQ and perlfunc posts is that people might read
>them when they're in such small, easily digestible portions.
I have been reading this ng for quite a while, and also surmised those same
reasons. But I don't think it will be effective, and I think it is an
enormous waste of bandwidth. Hence sentence two of my post. The *most* that
is needed is a table of contents and URL for the FAQS, and brief "Perldoc:
How to find what you need to know about perl" writeup.
>Interesting questions are so rare here these days. :-( I'm tired of
>all the gimme-gimme and `hold my hand, I don't wanna read the docs'
>posts.
In a perfect world...
>Everyone stop posting them. :-)
They're not quite as tedious as the long-winded "witty" non-answering
responses that some like to write.
Lee
------------------------------
Date: Fri, 14 May 1999 02:09:48 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: man pages and FAQs: why posted?
Message-Id: <ebohlmanFBpA0D.7B1@netcom.com>
Lee <rlb@intrinsix.ca> wrote:
: I'm wondering why all of the man pages and FAQs are being posted here.
: Wouldn't it make more sense to write a short and simple "FAQ 0.0: Where to
: start" that would point newbies to these resources, and post it every day
: or two?
: Or are they being posted for some other reason?
Well they do need to be periodically reviewed and commented upon; much of
the strength of Perl's documentation comes from the fact that it's
peer-reviewed. Several of the recent FAQ/perlfunc postings have sparked
useful discussion about different Ways To Do It (WTDI), including some
based on new features of the language. Perl's documentation can't be static.
------------------------------
Date: Fri, 14 May 1999 02:13:49 GMT
From: "Sheila Eugenio" <seugenio@man.amis.com>
Subject: Match string at the beginning of each line
Message-Id: <01be9da4$adbb8e60$2bbe10ac@amipnet>
How can I an IP pattern matched in a log file, such that if it each line
has the ff:
172.16.190.97, -, 5/1/99, 0:37:28
172.16.190.97, -, 5/1/99, 0:41:45
172.16.38.100, -, 5/1/99, 2:14:03
172.16.38.100, -, 5/1/99, 2:14:03
172.16.25.26, -, 5/1/99, 4:17:32
172.16.25.26, -, 5/1/99, 4:17:33
what I will have printed are just the IP addresses:
172.16.190.97
172.16.38.100
172.16.25.26
my code:
$dir = 'D:/WINNT/system32/LogFiles';
open (LOG, '>D:/WINNT/system32/LogFiles/sample.log');
open (LOGFILE, "$dir/in9905.log") or die ("Cannot open file\n");
while ($line = <LOGFILE>) {
##I don't know how the pattern matching will go about
}
}
thanks in advance for any help..
------------------------------
Date: Fri, 14 May 1999 05:33:52 GMT
From: tgy@chocobo.org (Fuzzy Warm Moogles)
Subject: Re: Newbie question on CGI developing
Message-Id: <373bb44c.83426571@news.oz.net>
On Fri, 14 May 1999 01:17:20 -0400, rjk@linguist.dartmouth.edu (Ronald J
Kimball) wrote:
>How about replacing that loop with the following?
>
>$pagelines =~ s/<replace="([^"]*)">/$pagestuff{$1}/g;
>
>
>But then you get into problems with non-existing keys...
>
>$pagelines =~ s/<replace="([^"]*)">/
> exists $pagestuff{$1} ? $pagestuff{$1} : ''/eg;
TMTOWTDI:
for ($pagelines) {
local $^W;
s/<replace="([^"]*)">/$pagestuff{$1}/g;
}
--
Fuzzy | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=
------------------------------
Date: 14 May 1999 01:01:19 -0500
From: aray@nmds.com (Arjun Ray)
Subject: Re: Newbie question on CGI developing
Message-Id: <37c4aa19.2345633242@news1.newscene.com>
In <gXC_2.195$9x5.57406@news.shore.net>, Scratchie
<upsetter@ziplink.net> wrote:
| I'm probably not the only Perl user on this group who would
| appreciate a pointer to some information on learning SGML.
[The Good News:] The most comprehensive online resource for years has
been Robin Cover's SGML page:
<URL:http://www.oasis-open.org/cover/siteIndex.html>
[The Bad News:] However, there isn't much in the way of tutorials or
expositions suitable for script writers. Or at least, that I've seen.
But the basics are pretty simple. SGML is a syntactic formalism geared
towards the description of "documents" as a tree-like hierarchy of
named containers, with all actual text content at the leaf level. (The
Composite, Observer and Visitor patterns from the GangOfFour book can
be good templates for a processing framework.) Many of the syntactic
facilities have do with what database wonks might call normalization -
indirection and a corresponding reference mechanism - to avoid
redundancy in data. So, as a rule, a document isn't just tags+text:
there will be a "prolog" also, with all the definitions needed to
expand what usually is a conveniently minimized description of the
structure.
| I'm "guilty" of using home-rolled "tag systems" because they get the
| job done
So are we all.
| and once I devised a reasonably-flexible system, they weren't that
| hard to adapt to a given job.
That's where the longer-term problems started biting me: the constant
need to "adapt". Aka kludge. Copy, edit, save as a new name... I found
that I had scads of code, all sort of similar yet subtly different
from project to project. Early on, there was also the false laziness
problem of lock-in: the data were (relatively) useless without the
one-off script code to process them.
| But I'm always open to learning a better way.
It's not that SGML is necessarily a better way. It's biggest benefits
flow from the fact that its syntax is a standardized one: there's no
mystery about what's legit and what's not. And by the same token,
generating tag-format output should be the sole business of a single
write-once module: there is nothing more ludicrous than *programs*
producing patently invalid documents (bad nesting, unquoted attributes
and so on.) All IMHO, of course.
:ar
------------------------------
Date: Thu, 13 May 1999 19:28:17 GMT
From: elwood@news.agouros.de (Konstantinos Agouros)
Subject: Re: perl install on bsd/os 3.1
Message-Id: <1999May13.192817.1402@news.agouros.de>
Ken Blinco <citeckeb@citec.qld.gov.au> writes:
>Hi,
>I've posted an article recently concerning this - thanks for the responses.
>Seems that I solve one problem and another one turns up.
>Does anyone have any experience in installing a version of perl (5.004 or later)
>on bsd/os v3.1 ? If so were there any tricks needed to get it right? My main
>problem now is getting sockets to work, I need to make use of the Net modules,
>so this is a critical component to the install.
Yes I did that and had no problems. However be careful not to overwrite your
old perl (the one that comes with bsd/os) if you want to use maxim because cgi
.pm gets overwritten and this is not what you want.
Konstantin
--
Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood@agouros.de
Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185
----------------------------------------------------------------------------
"Captain, this ship will not sustain the forming of the cosmos." B'Elana Torres
------------------------------
Date: Fri, 07 May 1999 22:22:23 GMT
From: ryanngi@hotmail.com (Ryan Ngi)
Subject: perlcc <---problem!?
Message-Id: <37336713.12974795@news.inet.co.th>
i've try perlcc....
d:\>perlcc test.pl
.........
output
D:\PERL\BIN\PERL.EXE -ID:\PERL\lib -ID:\PERL\site\lib -I.
-MO=CC,-otest.pl.c tes
t.pl
test.pl syntax OK
Compiling C(test) for test.pl!
Couldn't open !
-----------
why it said "Couldn't open".... and how to fix it??????
------------------------------
Date: 13 May 1999 23:57:06 GMT
From: ansok@alumni.caltech.edu (Gary E. Ansok)
Subject: Re: PERLFUNC: eval - catch exceptions or compile code
Message-Id: <7hfosi$rch@gap.cco.caltech.edu>
In article <m1u2thdmnz.fsf@halfdome.holdit.com>,
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>>>>>> "Bart" == Bart Lateur <bart.lateur@skynet.be> writes:
>Bart> <PEDANTIC>"Executing" a sub definition merely defines it.</PEDANTIC>
>
>Not at all. You'd never need to get to that code at runtime
>to get a definition. Let me be clearer.
>
>eval 'sub foo { "only at compile time" }';
>
>There's no executable code in that eval. None. As a side effect of
>compiling that code, &foo gets defined. But that's done on the
>compile pass, not the execute pass.
So what happens with a line like this?
eval 'sub foo { "foo might be defined" }' if <> == 1;
--
Gary Ansok ansok@alumni.caltech.edu
"Bother," said Pooh. "Eeyore, ready two photon torpedoes and lock
phasers on the Heffalump; Piglet, meet me in transporter room three"
------------------------------
Date: Thu, 13 May 1999 22:22:17 -0400
From: vepxistqaosani <fbart@sprynet.com>
Subject: Perlish linguistics (aka shibbolethim)
Message-Id: <373B88D9.67AE31BA@sprynet.com>
I was wondering why the plural of pragma was not pragmata in the Camel
book. A quick Web search verified that it would be good Greek -- and is
even used in some HTML Perl documentation. Did O'Reilly assume that
Greek plurals just won't work in a world of small Latin and less Greek?
But how many of you perlers out there use "pragmata" (or "lemmata", for
that matta)?
Fred
------------------------------
Date: 13 May 1999 22:54:10 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Please Help: Am I creating the hash wrong, or accessing its elements wrong?
Message-Id: <7hfl6i$5s1$1@fcnews.fc.hp.com>
Laurence Leider (lleider@mmm.com) wrote:
: Judging from the output I get, the same list of references is assigned
: to every element of %newhash.
Nope, just a typo:
: foreach $element (@count) {
: print "$element","\n";
: ($one, $two, $three) = @{$newhash{$branch}};
^^^^^^^^
$element
: print "@$one, @$two, @$three","\n";
: }
Also, I'd use "my" on your loop-local variables. And parens in []
are redundant.
Andrew
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 V8 Issue 5658
**************************************