[9990] in Perl-Users-Digest
Perl-Users Digest, Issue: 3583 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 29 16:03:36 1998
Date: Sat, 29 Aug 98 13:00:21 -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 Sat, 29 Aug 1998 Volume: 8 Number: 3583
Today's topics:
Re: \\ ...what's the point? (Bart Lateur)
Re: core dump from perl. Don't know why... dwiesel@my-dejanews.com
Re: core dump from perl. Don't know why... dwiesel@my-dejanews.com
Re: Doing `open (FH,"<&STDIN")' with FileHandles? <jdf@pobox.com>
Hats off to Tom Phoenix (Norman UNsoliciteds)
Re: how can I print 10 digit nos. using 0s as place hol (Bart Lateur)
Re: how can I print 10 digit nos. using 0s as place hol (Bob Trieger)
Re: How do I compare the contents of two files... <jdf@pobox.com>
How to extract first letter in string? <thomas@provideo.dk>
Re: How to extract first letter in string? <daniel@NOSPAMstridhammar.pp.se>
Re: How to extract first letter in string? (Alastair)
Re: How to extract first letter in string? (Ronald J Kimball)
Re: Imagine... a non-greedy world! <minich@globalnet.co.uk>
Re: NT Perl 5.0 and IIS 4.0 Logon Permissions (Jonathan Stowe)
Re: Oh ladies and lords of Perl, do not roast or toast (Bart Lateur)
Re: Perl compiler (Bart Lateur)
Re: Perl Docs.. forget the original post (Author) (Norman UNsoliciteds)
Re: Perl Docs.. forget the original post (Author) <rra@stanford.edu>
Re: Perl documentation lvirden@cas.org
Re: Perl documentation (Bart Lateur)
Re: Perl documentation (Bart Lateur)
Re: Perl documentation (Bart Lateur)
Re: Perl documentation (David Hawker)
Re: Perl documentation (David Hawker)
Re: Perl documentation (David Hawker)
Re: Perl documentation (David Hawker)
Re: Q: getting core dump from perl, maby problem with f dwiesel@my-dejanews.com
Q: remain order, hash dwiesel@my-dejanews.com
Re: Q: remain order, hash <ajohnson@gpu.srv.ualberta.ca>
Using <!--something--> <vip@takas.lt>
Using <!--something--> <vip@takas.lt>
Re: Using <!--something--> (Larry Rosler)
Re: variable interpolation in regular expressions <jdf@pobox.com>
Re: What is it? (Bart Lateur)
Re: what's wrong with this statement? More explanation. <@thefree.net>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 29 Aug 1998 11:58:54 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: \\ ...what's the point?
Message-Id: <35f7eb68.13824238@news.tornado.be>
Larry Rosler wrote:
>I believe the original submitter meant why wasn't it defined like this:
>
> print 'I can''t hear you', "\n";
> print 'This line ends with a backslash \', "\n";
Or maybe he meant that
print 'I am somewhat \obtuse';
should take 'o' literally, so it would print
I am somewhat obtuse
I too think that backslashes are not treatted entirely consequently in
this case. ALWAYS eating the first backslash, that would be consequent.
Bart.
------------------------------
Date: Sat, 29 Aug 1998 09:35:56 GMT
From: dwiesel@my-dejanews.com
Subject: Re: core dump from perl. Don't know why...
Message-Id: <6s8i1s$v7n$1@nnrp1.dejanews.com>
This is the output when i write "file core":
zeus:~/cgi-bin$ file core
core: ELF 32-bit LSB core file i386 (386 and up) Version 1
zeus:~/cgi-bin$
// Daniel
> dow> Hi, I've got a program that is run from
> dow> Internet. Sometimes it generates a large (4 Mb) 'core'
> dow> file. I have tried with the -w flag but I don't get any
> dow> errors at all.
>
> dow> Is it possible to look at the core-file to see what the
> dow> problem was?
>
> Sure it's actually a core from perl? Use the command "file
> core" to find out how the core was generated. If yes then
> you'll have to post lots more info regarding the
> circumstances that cause this problem.
>
> If not, then there's something else going on.
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Sat, 29 Aug 1998 09:42:56 GMT
From: dwiesel@my-dejanews.com
Subject: Re: core dump from perl. Don't know why...
Message-Id: <6s8iev$veb$1@nnrp1.dejanews.com>
> Yes. In general, you need to use a debugger (such as gdb) to look at core
> files. Having said that, your perl script shouldn't coredump, so
perhaps you
> should run your script through the perl debugger ("perl -d") and find out
> what's really going wrong.
I've issued the command "gdb -c core" which gives the following result:
zeus:~/cgi-bin$ gdb -c core
Core was generated by `perl nph-main'.
Program terminated with signal 11, Segmentation fault.
#0 0x1af238 in ?? ()
(gdb)
what does a segmentation fault means and how can i find more information about
what exactly happened now?
// Daniel
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 29 Aug 1998 10:44:09 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: David Coppit <dwc3q@mamba.cs.virginia.edu>
Subject: Re: Doing `open (FH,"<&STDIN")' with FileHandles?
Message-Id: <m3iujbhmpy.fsf@joshua.panix.com>
David Coppit <dwc3q@mamba.cs.virginia.edu> writes:
> I wanted to use STDIN so that my script could act as a filter, so I
> thought, why not use "<&STDIN" as the file name? Well, it didn't
> work. I have to admit I'm not familiar with the use of OO
> FileHandles, or passing the standard streams around either.
Have you read this question in perlfaq5: "How can I make a filehandle
local to a subroutine? How do I pass filehandles between subroutines?
How do I make an array of filehandles?"
It may give you an idea about what to do in your situation, though you
may have to rethink the design of that subroutine.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Sat, 29 Aug 1998 19:24:58 +0900
From: No.unsoiliciteds@dead.end (Norman UNsoliciteds)
Subject: Hats off to Tom Phoenix
Message-Id: <No.unsoiliciteds-2908981925020001@cs11k27.ppp.infoweb.or.jp>
I just read through six consecutive replies to newbie questions all from
Tom Phoenix, I thoroughly admire him for his fairness while explaining
politely where the info could be found (even if it was a FAQ) plus even
giving some small hints as to the solution of the cause/solution of the
prob he also managed to express the idea that perhaps the posters
should've looked in the obvious places first without resorting to sarcasm,
irony, down right bloody mindedness or worse.
To be fair I have seen others do the same, but they ony seem to be able to
hold out for a couple of posts before letting rip.
A couple of karma points to ya!
--
The Dinosaurs were so stupid, they couldn't
even devise the means of thier own extinction,
they had to wait for Nature to do it for them.
------------------------------
Date: Sat, 29 Aug 1998 11:58:53 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: how can I print 10 digit nos. using 0s as place holders
Message-Id: <35f5e8ae.13126196@news.tornado.be>
Bob Trieger wrote:
>If your 10 digit number is `always' going to be comprised of 6 and 4 digit
>variables, try this:
> printf (FILE "%06d%04d\n", $digits, $i);
Problem: if $i has more than 4 digits, printf will include them all.
printf "%06d%O4d", 123456, 98765;
prints:
12345698765
i.e. 11 digits.
Bart.
------------------------------
Date: Sat, 29 Aug 1998 15:45:06 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: how can I print 10 digit nos. using 0s as place holders
Message-Id: <6s97sd$6t$1@ligarius.ultra.net>
[ posted to usenet and courtesy e-mail sent to (Bart Lateur) ]
bart.mediamind@tornado.be (Bart Lateur) wrote:
-> Bob Trieger wrote:
->
-> >If your 10 digit number is `always' going to be comprised of 6 and 4 digit
-> >variables, try this:
->
-> > printf (FILE "%06d%04d\n", $digits, $i);
->
-> Problem: if $i has more than 4 digits, printf will include them all.
No problem. You left out the for statement that contained the print
statement:
for $i (1..1000) { }
$i would never be more than 4 digits!
Bob Trieger
sowmaster@juicepigs.com
------------------------------
Date: 29 Aug 1998 10:40:05 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: Andrew Whitcroft <andyw@interserv.com>
Subject: Re: How do I compare the contents of two files...
Message-Id: <m3lno7hmwq.fsf@joshua.panix.com>
Andrew Whitcroft <andyw@interserv.com> writes:
> So, I have a script to accumulate the output from a "df -lk"
> command, sort it, and display a formatted results.
> Now I want to take it one step further, I want to compare the last
> time file to the current results, and have the script show me the
> differances that meet the following parameters...
> I am still kind of new to Perl programming, and what better way to
> learn than having a project to work on. But, this little problem has
> me stumped
It's impossible to tell which part of the problem has you stumped.
The algorithm? Opening files? Comparing two numbers? :) Here's one
possible recipe for your program:
1) read and parse the output of df
2) If the data file from the last run exists
2a) read and parse those results
2b) compare the numbers to those gleaned in step 1
2c) print appropriate messages
3) save the results of step 1 into the data file
As for the file format, you might want to consider using a simple flat
file, like
/dev/hdb2:56
/dev/hdc3:76
where each line contains the device and the percentage filled,
separated by a colon. Add other fields to taste.
A natural data structure to represent this information would be a
hash, keyed on the device, e.g.,
$pct_filled{'/dev/hda1'} = 34;
I hope that this gives you some ideas.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Sat, 29 Aug 1998 04:11:56 -0700
From: Thomas Albech <thomas@provideo.dk>
Subject: How to extract first letter in string?
Message-Id: <35E7E1FC.A19BF620@provideo.dk>
Hi there,
Are there anyone, who can tell me how to extract the first letter in a
string..
Thanks,
Thomas
--
Product Specialist, Alias|Wavefront Assist Denmark
PowerAnimator Level 2 -- Maya Caracter Animation
--------------------------------------------------
Crystal Graphics Tel. +45 54 70 71 10
Guldborgvej 3 Mob. +45 20 40 12 03
DK-4990 Sakskxbing Fax. +45 54 70 03 10
Denmark email: thomas@provideo.dk
------------------------------
Date: Sat, 29 Aug 1998 12:34:05 +0200
From: Daniel Stridhammar <daniel@NOSPAMstridhammar.pp.se>
Subject: Re: How to extract first letter in string?
Message-Id: <35E7D91D.A1CE61ED@NOSPAMstridhammar.pp.se>
> Are there anyone, who can tell me how to extract the first letter in a
> string..
Use:
$firstLetter = substr($string, 1, 1);
/Daniel
------------------------------
Date: Sat, 29 Aug 1998 12:28:07 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: How to extract first letter in string?
Message-Id: <slrn6ug0ku.54.alastair@calliope.demon.co.uk>
Daniel Stridhammar <daniel@NOSPAMstridhammar.pp.se> wrote:
>> Are there anyone, who can tell me how to extract the first letter in a
>> string..
>
>Use:
>
>$firstLetter = substr($string, 1, 1);
Shouldn't that be 'substr($string, 0, 1)'?
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Sat, 29 Aug 1998 11:55:41 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: How to extract first letter in string?
Message-Id: <1deit9t.c9fnmfy8s04uN@bay1-283.quincy.ziplink.net>
Daniel Stridhammar <daniel@NOSPAMstridhammar.pp.se> wrote:
> > Are there anyone, who can tell me how to extract the first letter in a
> > string..
>
> Use:
>
> $firstLetter = substr($string, 1, 1);
Of course, if you want the zeroth letter, you should do:
$zerothLetter = substr($string, 0, 1);
:-)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sat, 29 Aug 1998 17:04:53 +0100
From: "Martin" <minich@globalnet.co.uk>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <6s98qk$duv$1@heliodor.xara.net>
>My favorite beef with Perl (besides it being the ugliest
>language man has ever devised) is its implementation of
>Regular Expresssions (regexp).
Ugly? I presume you mean lots of escaping in regexps. You need
to use a different delimiter if you find lots of these. Instead of:
/http:\/\/(.*?)\/(.*?)\//
then
m!http://(.*?)/(.*?)/!
looks much better.
>Day after day, I find myself fighting the regexp greediness
>tooth and nail to arrive at the desired result.
>
>Why in the world should /si*k/ match "something that bozos
>put on their ugly, bloated faces when they get drunk"
>rather than just simply "sink" is beyond me.
It won't. /si*k/ will match
siiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiik and
sk but not sink. If you want it to match sink, then you need
/si(.*?)k/
You should have a look at multpliers {n} means match n
of the pervious character and ? means match 0 to 1, you
can't be less greedy than that.
>Now, can anyone imagine a world with Perl in harmony
>with nature? Would it take away the magic, would it make
>it too plain?
It is, if you'd read more of Perlre before blaming the language,
you'd have found that out.
>Or am I simply overlooking some hidden, but obvious to
>the enlightened, logical reason for greediness?
Well, it's easier to be greedy as default because, if you want to
get rid of a path from the start of every string, it's easier to:
$foo =~ s!^/(.*)/\w*!!sg;
than to have to mess around with multipliers etc.
Martin
------------------------------
Date: Sat, 29 Aug 1998 11:04:10 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: NT Perl 5.0 and IIS 4.0 Logon Permissions
Message-Id: <35e7cf38.1580247@news.btinternet.com>
On Tue, 25 Aug 1998 22:28:37 GMT, cbinder@lexmark.com wrote :
>I'm trying to use opendir(DIR) (where DIR is some on other machine) and get
>the same results. The same script works perfectly when run from a Windows 95
>machine. Like you said, it also works on the NT machine from a command
>prompt. It only fails from a browser.
>
>I'm 99% sure it's an IIS problem, and I think it has something to do with
>impersonation. IIS launches a perl process to run a script. When this
>process is launched from a browser, it is in the context of an impersonated
>user (as opposed to whatever account is currently logged on). I believe this
>user account is IUSR_MACHINENAME. I've tried all kinds of permissions for
>this account with no success.
>
>The question is what are the rights of this impersonated user, and how does
>one configure those rights?
>
The IUSR_<whatever> user usually has no rights to do virtually
anything except access the local filesystem. You can change those
rights (how is not a question for this group) or you can use the
facilities provided by Win32::NetResource and Win32::AdminMisc to
connect to your other server as any user you want.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 29 Aug 1998 11:58:52 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Oh ladies and lords of Perl, do not roast or toast me or fry me in a wok*
Message-Id: <35f4e3ca.11874016@news.tornado.be>
Jose Cuervo wrote:
>When one reads from the command
>line using the <> filehandle, will one get the actual value of ARGV[0]?
>e.g. will this bit of code
>
>$a=<>
>
> set $a to the contents of ARGV[0].....
No: it will read the first line from the file that was in $ARGV[0]
before. Next time you call it, it will read the next line of the same
file. Etc. until the end of the file; then it'll start on the next file.
Hint: you should experiment a little with displaying @ARGV at varous
times. Display $ARGV as well.
If you want to extract command line options, look at the docs for shift.
And do that before any attempts at reading from <>.
Bart.
------------------------------
Date: Sat, 29 Aug 1998 11:58:48 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Perl compiler
Message-Id: <35f2dfba.10833736@news.tornado.be>
Lily Y. Fu wrote:
>I didn't want them to read the text, simply
>because I have password embedded in the program
>in clear text.
>
>I would appreciate you guys help me out
>on "protecting the password" issue...
Do it as Unix does (I think): encrypt your password once (see crypt in
perlfunc.pod), and store that in the script. Encrypt the user supplied
password, and encrypt that too. Both results should be the same.
Problem is: users can snip the password protection scheme from your
script completely. Hmm...
Bart.
------------------------------
Date: Sat, 29 Aug 1998 20:58:30 +0900
From: No.unsoiliciteds@dead.end (Norman UNsoliciteds)
Subject: Re: Perl Docs.. forget the original post (Author)
Message-Id: <No.unsoiliciteds-2908982058310001@cs11k13.ppp.infoweb.or.jp>
In article <u4suycoqg.fsf@vansel.alcatel.com>, Brad Murray
<murrayb@vansel.alcatel.com> wrote:
> Better docs are always nice, although I find those that come with the
> standard distribution of Perl to be sufficient. Where I want more, I
> pay for it.
Now where was it I read something about perl and paying...........
>
> Submit your patches to the folks that build the docs. If they are
> incorporated, they will follow standard distributions. No one can
> control non-standard distributions, so don't encourage those by
> using them.
Sfunny somebody posts this everytime the docs are mentioned in this
context - why is it so much energy goes into making free software packages
but the documents are relatively fossilised?
> You want more than you get for free. To get more you will have to put
> something in or pay. What's the trouble?
Perll..... money....... hmmm.... AH! now I remember, there was this big
long thread recently arguing about the moral rights and wrongs of making
money from the perl distribution.
But this really sounds like an excellent work around to any moral
considerations! All those nice complicated software packages are free -
you have to _pay_ for the docs. Wasn't it Gillette who pioneered this kind
of thing - if they give you the razor you _have_ to buy the blades. Good
sound marketing strategy.
--
The Dinosaurs were so stupid, they couldn't
even devise the means of thier own extinction,
they had to wait for Nature to do it for them.
------------------------------
Date: 29 Aug 1998 05:15:45 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl Docs.. forget the original post (Author)
Message-Id: <m3btp4kmq6.fsf@windlord.Stanford.EDU>
Norman UNsoliciteds <No.unsoiliciteds@dead.end> writes:
> Sfunny somebody posts this everytime the docs are mentioned in this
> context - why is it so much energy goes into making free software
> packages but the documents are relatively fossilised?
Because there are more good free software programmers than there are good
free documentation writers.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 29 Aug 1998 09:48:12 GMT
From: lvirden@cas.org
Subject: Re: Perl documentation
Message-Id: <6s8ios$80v$1@srv38s4u.cas.org>
I am averaging 3-4 spams a day and I post quite a bit. I don't delete
my spam identified mail automatically - my spam filters on sites tend to
pick up legit email and mailing list traffic along with the garbage.
I need to clean out that list and start over I guess...
--
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
------------------------------
Date: Sat, 29 Aug 1998 11:58:47 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Perl documentation
Message-Id: <35f1d906.9117989@news.tornado.be>
Abigail wrote:
>Uhm, what system comes without documentation for its system calls?
>Not a system one has to pay for I hope?
You can't expect people to have the docs for a C compiler, if they
install a precompiled binary distributiuon of Perl.
I, too, have to occasionally flip through a reference on the "C"
programming language, to get to know something about Perl. That is
awkward, to say the least.
A full documentation on what, for example stat() is supposed to do,
would be nice, too. In particular, what fields it returns in list
context! It is often emulated in Perl executables on systems that don't
provided natively.
Bart.
------------------------------
Date: Sat, 29 Aug 1998 11:58:45 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Perl documentation
Message-Id: <35f0d8b3.9035162@news.tornado.be>
Craig Berry wrote:
>So you don't know the difference between statements and functions?
Ouch. Perl doesn't MAKE much distinction between expressions and
statements, or between functions and procedures. For example:
1;
I think a simple TOC, with ALL Perl keywords/operators, and the POD
file(s) where they are documented, would help less experienced greppers.
Bart.
------------------------------
Date: Sat, 29 Aug 1998 11:58:43 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Perl documentation
Message-Id: <35eed509.8097592@news.tornado.be>
Daniel Adams wrote:
>I'm
>filtering using procmail, but I'm only filtering based on domain and subject
>line - in other words I haven't set it up to take a look at all that other
>fun stuff in mail headers - is it even possible?
At least take a look at the To: and Cc: headers. In 95% of all spam,
your address won't be there.
That goes for mailing lists also. But at least, you know what mailing
lists you're subscribed to, and know how to recognize them, right?
The reason is that SMTP doesn't NEED it. Plain mailer programs use them
to construct the destinations list, before sending the mail, but for the
rest, they are purely informative.
Bart.
------------------------------
Date: Sat, 29 Aug 1998 14:43:32 GMT
From: dhawker@removethis.bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35e80f50.460307@news.cableol.net>
On 23 Aug 1998 23:00:15 GMT, abigail@fnx.com (Abigail) felt the need to
post:
>David Hawker (dhawker@bigfoot.com) wrote on MDCCCXVIII September MCMXCIII
>in <URL: news:35e14696.15795918@news.cableol.net>:
>++ On 22 Aug 1998 16:46:18 GMT, Tom Christiansen <tchrist@mox.perl.com> felt
>++ the need to post:
>++
>++ > [courtesy cc of this posting denied to cited author as a
>++ > penalty for address mutilation]
>++
>++ If I want to mutilate my address to foil spammers, that's what I'll do. A
>++ lot of people do it. Surely it's not too much bother to remove the obvious
>++ text or to see what went wrong in the undeliverable mail message? A lot
>++ less bother than hunting down the documentation that isn't included in the
>++ perl manual.
>
>
>If you're that afraid of spam, don't post to Usenet.
The benefits are too great.
>Better weld your mailbox shut too.
Oh?
--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org
------------------------------
Date: Sat, 29 Aug 1998 14:43:36 GMT
From: dhawker@removethis.bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35e91014.655950@news.cableol.net>
On 27 Aug 1998 05:51:08 GMT, gebis@fee.ecn.purdue.edu (Michael J Gebis)
felt the need to post:
>dhawker@removethis.bigfoot.com (David Hawker) writes:
>
>}A better and faster way is to use Windows 95's built-in Find tool which
>}searches files for a text string. You must have something like this on
>}UNIX?
>
>Indeed, UNIX got such a tool about 20 years before windows did.
I thought it must have done.
--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org
------------------------------
Date: Sat, 29 Aug 1998 14:43:40 GMT
From: dhawker@removethis.bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35ea102a.678322@news.cableol.net>
On 27 Aug 1998 05:30:28 GMT, Tom Christiansen <tchrist@mox.perl.com> felt
the need to post:
>In comp.lang.perl.misc, <A HREF="mailto:david.hawker@cableol.co.uk">
>writes:
>
>:>Everyone should be familiar with the pointers in the top-level
>:>manpage. I've starred the ones most important to beginners.
>:
>:I'm familiar with it but I'm not going to mush my brain by reading through
>:20 huge texts looking for something whose whereabouts I'm unsure of.
>
>Grep.
>
>grep grep grep grep grep grep. grep grep grep grep grep grep.
>
>Grep.
I take it grepping is some means of searching through files for text
strings?
--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org
------------------------------
Date: Sat, 29 Aug 1998 14:44:33 GMT
From: dhawker@removethis.bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35f113c6.1601896@news.cableol.net>
On 27 Aug 1998 12:23:58 -0400, Ala Qumsieh <aqumsieh@tigre.matrox.com> felt
the need to post:
>
>dhawker@removethis.bigfoot.com (David Hawker) writes:
>
>>
>> On 25 Aug 1998 13:53:12 GMT, Tom Christiansen <tchrist@mox.perl.com> felt
>> the need to post:
>>
>> >Everyone should be familiar with the pointers in the top-level
>> >manpage. I've starred the ones most important to beginners.
>>
>> I'm familiar with it but I'm not going to mush my brain by reading through
>> 20 huge texts looking for something whose whereabouts I'm unsure of.
>>
>
>Searching through 20 huge texts looking for something takes me less
>than 1 minute. I won't tell you my secret! I swore not to reveal the
>magic of grep! (oops!)
So I was right.
>> >If you first consult this list when you want to find something
>> >whose whereabouts you're unfamiliar with, I'll bet you'll go far.
>>
>> A better and faster way is to use Windows 95's built-in Find tool which
>> searches files for a text string. You must have something like this on
>> UNIX? Granted, perl itself could do it.
>
>WOW! This Windows95 function is awesome! I bet using Windows95 and
>this Find tool saves you a lot of hassle, and time, and crashes, and
>money ..
It often comes in useful. But I was referring to doing that instead of
referring to Tom's main index - you needn't even look at the index if
you're going to search through everything.
>Boy, how did the geniuses in Microsoft think of that? Maybe I should
>convince my boss to throw away the Ultra-1 sunsparc station on my
>desk, and buy a winblows-based PC that can search text!
I don't think Windows 3.1 had a built-in search facility. Neither did
MS-DOS. That's how deprived we are (or were).
--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org
------------------------------
Date: Sat, 29 Aug 1998 09:39:37 GMT
From: dwiesel@my-dejanews.com
Subject: Re: Q: getting core dump from perl, maby problem with fork() ?
Message-Id: <6s8i8o$vbg$1@nnrp1.dejanews.com>
>
> My guess is that you're forking too many large processes and running out
> of memory, but it's just a guess. Hope this helps!
Ok. Maby that is the case. But I wonder if my processes are so large... The
only thing each process is doing is fetching the content of a webpage. So
while waiting for the response from webservers they are idle... Do you still
think that the processes are large?
// Daniel
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Sat, 29 Aug 1998 09:30:47 GMT
From: dwiesel@my-dejanews.com
Subject: Q: remain order, hash
Message-Id: <6s8ho7$uq6$1@nnrp1.dejanews.com>
Hi,
I have a file with the following content
---------AFile.txt----------
29:andrea
25:bob
35:david
----------------------------
I wonder how I can remain the order of the persons in the file when I put them
in a hash. I wan't to be able to go thru the hash and for each person print
his/her name and age in the same order that were in the file.
// Daniel
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Sat, 29 Aug 1998 05:54:41 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Q: remain order, hash
Message-Id: <35E7DDF1.584C3892@gpu.srv.ualberta.ca>
dwiesel@my-dejanews.com wrote:
>
> Hi,
>
> I have a file with the following content
>
> ---------AFile.txt----------
> 29:andrea
> 25:bob
> 35:david
> ----------------------------
>
> I wonder how I can remain the order of the persons in the file when I put them
> in a hash. I wan't to be able to go thru the hash and for each person print
> his/her name and age in the same order that were in the file.
push your keys onto an array as you define them, later
iterate through those rather than using keys() on the
hash ... or, from perlfaq5:
=head2 How can I always keep my hash sorted?
You can look into using the DB_File module and tie() using the
$DB_BTREE hash bindings as documented in L<DB_File/"In Memory Databases">.
The Tie::IxHash module from CPAN might also be instructive.
hope that helps
regards
andrew
------------------------------
Date: Sat, 29 Aug 1998 12:50:40 GMT
From: "vip" <vip@takas.lt>
Subject: Using <!--something-->
Message-Id: <AOSF1.112$gs5.983419@c01read02.service.talkway.com>
Hello!!!
I'm working on a guestbook script. And I have one problem:
I need the latest posts appear at the top of the page, not at the
bottom. So
I need your help now!
Here is the example of what I want:
source of file guestbook.html has 100 lines. Line 15 is:
<!--something-->
The perl script must open the html file, search for line
<!--something-->
and replace it with this:
-------------begins here---------------
<!--something-->\n
<center><h1>Hello!</h1></center><br>\n
<h3>My name is Joe. I come from USA.</h3><br>\n
<hr>\n
-------------ends up here--------------
So that next time new post would appear instead of the new added
<!--something-->... I hope you understand what I mean by this? Or do you
have any other ideas on how to make latest posts appear below the header
image and text, not at the bottom of page?
Thanks a lot!
Vytis.
Surf Usenet at home, on the road, and by email -- always at Talkway.
http://www.talkway.com
------------------------------
Date: Sat, 29 Aug 1998 13:13:03 GMT
From: "vip" <vip@takas.lt>
Subject: Using <!--something-->
Message-Id: <z7TF1.114$gs5.992671@c01read02.service.talkway.com>
Hello!!!
I'm working on a guestbook script. And I have one problem:
I need the latest posts appear at the top of the page, not at the
bottom. So
I need your help now!
Here is the example of what I want:
source of file guestbook.html has 100 lines. Line 15 is:
<!--something-->
The perl script must open the html file, search for line
<!--something-->
and replace it with this:
-------------begins here---------------
<!--something-->\n
<center><h1>Hello!</h1></center><br>\n
<h3>My name is Joe. I come from USA.</h3><br>\n
<hr>\n
-------------ends up here--------------
So that next time new post would appear instead of the new added
<!--something-->... I hope you understand what I mean by this? Or do you
have any other ideas on how to make latest posts appear below the header
image and text, not at the bottom of page?
Thanks a lot!
Vytis.
Surf Usenet at home, on the road, and by email -- always at Talkway.
http://www.talkway.com
------------------------------
Date: Sat, 29 Aug 1998 07:37:45 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Using <!--something-->
Message-Id: <MPG.1051b20fdc5c8c62989812@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <oPSF1.113$gs5.983792@c01read02.service.talkway.com> on Sat,
29 Aug 1998 12:51:32 GMT, vip <vip@takas.lt> says...
...
> I hope you understand what I mean by this? Or do you
> have any other ideas on how to make latest posts appear below the header
> image and text, not at the bottom of page?
This question is asked here frequently, so a good place to find the
answer might be among the Frequently Asked Questions. Try perlfaq5:
"How do I change one line in a file/delete a line in a file/insert a line
in the middle of a file/append to the beginning of a file?"
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 29 Aug 1998 09:59:22 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: "Wim Bartsoen" <r20030@glo.be>
Subject: Re: variable interpolation in regular expressions
Message-Id: <m3ogt3hosl.fsf@joshua.panix.com>
"Wim Bartsoen" <r20030@glo.be> writes:
> Does anyone know how to properly do the following:
>
> s/<!-- INPUT ([\w\-]+) -->/$query->param($1)/;
Please see the perlre document, paying special attention to the /e
modifier, which causes the regex engine to evaluate the replacement
part of a substitution.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Sat, 29 Aug 1998 11:58:50 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: What is it?
Message-Id: <35f3e336.11726103@news.tornado.be>
Erik Knepfler wrote:
>Of course, require doesn't work for me with the latest Perl anyway since
>it's too dumb to know what the current directory is...
Doesn't this work?
unshift @INC, ".";
(or is it "./"?)
Bart.
------------------------------
Date: Sat, 29 Aug 1998 09:27:44 +0100
From: <@thefree.net>
Subject: Re: what's wrong with this statement? More explanation. Sorry, I know it's dull but I need help.
Message-Id: <35e7c719.0@news.thefree.net>
Hi,
I know my last explanation was really naff, so may I explain more.
I have written a quiz in Perl. The script works well untill I start using
complicated HTML. Now it gives an "internal server error". I don't think
that I have access to my error logs.
One of my ideas was that I was not using \ infront of all of the charicters
that need it. Unfortnatly, I don't know what charicters need it, there is no
table in any of my books.
If this sounds like it may course it, does anyone know the URL of a good
table of charicters or a Perl valification service?
The script gets through my ISPs PerlCheck app, so I don't know what's wrong.
Thanks again, and sorry :-)
Daniel
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3583
**************************************