[8990] in Perl-Users-Digest
Perl-Users Digest, Issue: 2608 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 15 11:07:58 1998
Date: Fri, 15 May 98 08:00:30 -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, 15 May 1998 Volume: 8 Number: 2608
Today's topics:
Re: ANNOUNCE: Bit::Vector 5.3 <Stephan.Wilms@CWA.de>
ANNOUNCE: Simple text to html converter (t2html Perl 5. (Jari Aalto+mail.perl)
Re: Catch Exception (Kevin Reid)
Re: Compiling Perl (Kevin Reid)
Dates for cookies <svetter@ameritech.net>
Re: Does Perl have a IDE?I don't like command line. (Jari Aalto+mail.perl)
Re: Does Perl have a IDE?I don't like command line. (Tina Marie Holmboe)
Re: Does Perl have a IDE?I don't like command line. (Greg Bacon)
Re: Does Perl have a IDE?I don't like command line. (Greg Bacon)
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. <tchrist@mox.perl.com>
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. <tchrist@mox.perl.com>
Re: Does Perl have a IDE?I don't like command line. <tchrist@mox.perl.com>
file size with perl and win NT <piet@activ-consult.de>
Re: From Linux/perl to MS SQL <david@npis.com.tw>
How to generate random passwords? <teliskyj@kci.wayne.edu>
htgrep scripts - can't find copy to download mikep@5circles.com
installing CGI.PM carrr@mris.com
Re: localized ctime? <mroos@ut.ee>
Memory problem. <e78199@ceng.metu.edu.tr>
Re: Perl on NT -- need some assistance mgr@24-7www.com
Re: Ref to an LVALUE??? I expected a simple SCALAR ref! eryq@zeegee.com
Substitution Problems :( <aidan@crux.blackstar.co.uk>
Re: Substitution Problems :( (John Porter)
system vs exec vs piped open... <boschini@cilea.it>
Re: Timeout a program in Perl <lr@hpl.hp.com>
Re: Uploading pictures into a Internet Web Server <dturley@ravine.binary.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 15 May 1998 15:24:17 +0200
From: Stephan Wilms <Stephan.Wilms@CWA.de>
Subject: Re: ANNOUNCE: Bit::Vector 5.3
Message-Id: <355C4201.1D2C@CWA.de>
John Kugelman wrote:
>
> Stephan Wilms wrote:
> >
> > Stephan
>
> Hm, your usual sig seems to have disappeared. ;-)
He he, it still amuses me when this happens again :-)
Sometimes I simply dont append the SIG to make a grumpy reply (where
one is *absolutely* due) and there's always someone who notices :-)
Stephan
(initiator of the campaign against grumpiness in c.l.c)
------------------------------
Date: 15 May 1998 17:02:01 +0300
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: ANNOUNCE: Simple text to html converter (t2html Perl 5.003)
Message-Id: <tblns3k4yu.fsf@blue.sea.net>
I just finished converting my old perl 4 script to perl 5
level that I have been using to construct my WWW pages from plain
text files. The script is based on the indentatyion level of
the document. If someone finds it usefull, here is the homepage:
ftp://cs.uta.fi/pub/ssjaaa/t2html.html
And here is overview of the Techical Format it parses to HTML:
(there are many more fine points, but this is the general idea)
jari
Heading 1
Heading 2
Text starts at column 8
Quoted text starrts at column 10
Quoted text starrts at column 10
Quoted text starrts at column 10
Examples start at column 12
Examples start at column 12
Examples start at column 12
Heading 2
o This is first bullet
o another bulles
. This is numbered list
. this is second numbered list
Heading 3
End
------------------------------
Date: Fri, 15 May 1998 10:00:10 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Catch Exception
Message-Id: <1d90mty.1y0c2js1is740N@slip166-72-108-17.ny.us.ibm.net>
Alex Peng <peng7072@cs.nyu.edu> wrote:
> I am looking the same method as java
> try {
>
>
> } catch (.....) {}
>From "Programming Perl", page 120, <<"END_QUOTE"
sub try (&$) {
my ($try, $catch) = @_;
eval {&$try};
if ($@) {
local $_ = $@;
&$catch;
}
}
sub catch (&) {@_}
try {
die "phooey";
} catch {
/phooey/ and print "unphooey\n";
};
END_QUOTE
(Note that the ; on the end is required.)
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Fri, 15 May 1998 10:00:13 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Compiling Perl
Message-Id: <1d90n1f.1fh9fgu1chsqawN@slip166-72-108-17.ny.us.ibm.net>
LauRenCe WonG <xiaoyu@singnet.com.sg> wrote:
> Hello!
>
> any good compilers to recommend for perl? i heard there are only a few
> compilers in the market and most are still in process of modifications and
> a lot of patches. i need a compiler to compile my scripts becoz i need to
> pass the scripts to a friend who doesnt have a perl interpreter.
>
> Any suggestions are welcome, please kindly tell me of any sites which you
> know i can download the compiler. thanks!
Well, if you're using MacPerl, you can save your script as a "runtime
version", which is the Perl interpreter with your script imbedded in it.
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Fri, 15 May 1998 09:19:41 -0400
From: Scott Vetter <svetter@ameritech.net>
Subject: Dates for cookies
Message-Id: <355C40ED.4C89@ameritech.net>
Is there some Perl code somwhere that could change the date for a
browser's cookie to something other than the current date? I've looked
at Matt's Perl archive and there's nothing there. How do you get the
date in the proper format anyway?
------------------------------
Date: 15 May 1998 16:04:31 +0300
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <tbogwzk7mo.fsf@blue.sea.net>
|Wed 98-05-13 jdporter@min.net (John Porter) comp.lang.perl.misc
| On 13 May 1998 13:03:15 -0700,
| ,
| rra@stanford.edu (Russ Allbery) wrote:
| >
| > Pascal is simple. Yes, there are things you can't do in Pascal that you
| > want to do in a real programming language. The fact that you can't do
| > them in Pascal means that there's less of Pascal to learn. It's a
| > *teaching* language.
| >...
| > Pascal teaches basic block structure and decomposition....
|
| Pascal teaches some good things.
I second to that. I'm glad that my first language was Pascal which forced
to declare functions before they were used. This way you always knew that
that the called function was on top of current functions. This lead to
stucturize all my programming language codes to format:
macros # lisp or C/C++
lowlevel fucntion # Perhaps inline directives
intermediate functions
cruncher functions
The main()
And I still find that the most logical place for main is at the end of code.
At the top, there usually is lot of "headers, copyright, usage notes"
and global variable declarations.
you just hit Ctrl-End to see the main. Ain't that cute :-)
jari
------------------------------
Date: 15 May 1998 13:13:17 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jhf1d$hu8$5@news1.sol.no>
In article <6jbf1c$au2$1@mathserv.mps.ohio-state.edu>,
ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> Yet another proof of my point. One cannot use Perl docs on *nix
> without fluency with (4 in your examples) other tools.
I'm abit lost in this thread, but... have you ever had a look at the
tkman program ? If so, is that something you find more helpful ?
(If not, do ignore the above :)
--
Tina Marie Holmboe
Application Developer (Geeks'R'Us) [tina@tech.scandinaviaonline.se]
Scandinavia Online AB Development Dept. (+46) 08 587 81000 (switchboard)
(+46) 08 587 81189 (direct)
------------------------------
Date: 15 May 1998 13:25:58 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jhfp6$i0k$1@info.uah.edu>
In article <6jfnit$l01@fridge.shore.net>,
Art Cohen <upsetter@shore.net> writes:
: Greg Bacon <gbacon@cs.uah.edu> wrote:
: : The concept of an IDE is nice if you're into buttons and mouse pointing
: : and lots of windows. Two xterms are nice if you're not. I never said
: : that each and every user of a non-Unix platform sucks either. '
:
: Just the vast majority? Or was "the unappreciative, unthinking, and,
: hence, unworthy clueless droves of lose32 users" intended as a compliment?
Uhh.. that statement is definitely not all-inclusive nor was it intended
to be. However, in all the places to which I might roam around the net,
lack of clue and win32 go hand-in-hand. I dare you to sit on #perl for
half an hour. You'll see.
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: 15 May 1998 13:44:47 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jhgsf$i0k$2@info.uah.edu>
In article <6jg664$ma$1@ultranet.com>,
fsg@ultranet.com writes:
: In our imperfect reality, IDEs really are tools
: that perform a certain function; and many people's needs really are
: completely filled by them.
Believe it or not, I once used an IDE. It was Borland C++ version 3.5
on a DOS machine. I used it because I could have multiple files open at
once and flip around between them. I could compile my code without
leaving the editor. The IDE was necessary because of the chains in
which the operating system held me. Claiming the need for an IDE is
admitting to using a very challenged system.
: Surprising as it may be to you, a whole lot
: of people are happy writing forms programs in Access.
But I suspect many of these people aren't programmers. They're
assembling black boxes to make one slow, monolothic black box. This is
no more programming that swapping parts in a car is automobile design.
: No, my position is that IDEs are fine.
They're fine for the people who need the crutch. Programmers should
learn to program without the crutch or choose less challenged systems.
: The concept of an IDE is nice for reasons other than buttons and mouse
: pointing and lots of windows; but you know this. By the way, how do you
: start those xterms without buttons, windows, or mouse pointers?
xterm &
: I didn't need to infer; you said it explicitly. Go back and read your
: posts. They were not just excessively insulting, but obviously and openly
: so.
I never said that a Win32 user is necessarily clueless. In fact, I've
openly stated that there are Win32 users of clue.
: Nobody screaming and whining piteously at the horrors of win32 people
: asking questions in comp.lang.perl.misc has yet managed to explain how
: win32 people are, for instance, like a horrific malignant cancer.
By their actions, they detract from the usefulness of a great resource.
Why do you suppose Larry has left comp.lang.perl.misc? If you kill
clpm, you kill one of Perl's biggest selling points and much of its
usefulness.
: No,
: I don't like win32 either; and a lot of win32 zealots I've met are twits,
: so we're in some senses on the same side. But unless you can explain how
: win32 people asking questions in comp.lang.perl.misc will cause the downfall
: of Perl, I'm afraid you're just being unpleasantly religious.
I don't object to anyone asking questions solely based on their choice
(or curse) of operating system. However, I and most (if not all) the
regulars resent the attitude that we're here to quote from the FAQ each
time someone is too lazy to figure something out on his own. This goes
for any platform. It's just that the majority of takers seem to be
coming from Win32.
: I've thought
: about it a lot (having briefly been annoyed by the deluge myself), and still
: think it's great that so many people are trying, however benightedly, to
: learn Perl. What's your thought?
Don't get me wrong. I'd like for every clueful person in the world to
learn and find use of Perl. If nothing else, it will help to perpetuate
a really great language. I don't see what more we can do to hasten the
daybreak on the intellectual darkness, however. With the standard Perl
distribution comes reams of excellent documentation. Included in that
documentation is the perlbook manpage which lists excellent Perl books
and even how to purchase them. What would you have us do?
: 1. Use Perl. Tom has demonstrated a kill file that works for him;
: I'm sure a kill file plus Perl would work for you, too.
Ignoring the problem won't make it go away. So long as
comp.lang.perl.misc is our sole Usenet resource (I'm aware of the
existence of the other clp.* groups, but those are dedicated to very
specific aspects of Perl) those who care should pitch in to make it as
useful as possible. I suspect when clp.moderated comes along, this
group will become a barren wasteland. I know I'll unsubscribe.
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: 15 May 1998 09:58:50 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jhhmq$ef$1@ultranet.com>
Tom writes:
>In comp.lang.perl.misc, fsg@ultranet.com writes:
>:Whenever I write code on a Windows platform
>All becomes clear: Felix has been lured by the Bill Side
>of the Force. Time to call mind-control police.
I'm from the "use whatever tool is appropriate" school of software
design and architecture. If you're suggesting that it's impossible
to write a program for win32 that was the Right Thing To Do At The
Time, then you're overindulging in religion a wee.
Felix
------------------------------
Date: 15 May 1998 10:09:24 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jhiak$gd$1@ultranet.com>
Tom Christiansen <tchrist@mox.perl.com> writes:
>In comp.lang.perl.misc, fsg@ultranet.com writes:
>:But unless you can explain how
>:win32 people asking questions in comp.lang.perl.misc will cause the downfall
>:of Perl, I'm afraid you're just being unpleasantly religious.
>It's trivial: They flood the group with useless questions that they are
>too lazy to lift a finger for themselves.
This annoys and aggravates and is Wrong, but will not cause the downfall
of Perl, because these people can be efficiently and programmatically
ignored.
> They don't look up the docs
>even though these are included on their very systems.
This is another annoying and aggravating problem, probably stemming from
the fact that their system has taught them that docs are never available.
Solvable via education; also ignorable.
> The problem is that
>these people do not come from a can-do, do-it-yourself, tinker-and-play,
>reseach-is-educational background.
Establishing those as mandatory prerequisites for Perl use would be Bad.
The fact that someone is a casual or temporary or flat out stupid Perl
programmer should not permanently invalidate them from membership, or
earn the kinds of vicious blasts of scorn they often get in this newsgroup.
And further, if you don't like dealing with these sorts of people -- as
it's clear you don't -- it's trivial for you to ignore them. Perl will
not fall because of this, either.
> They aren't used to online docs that
>they didn't have to pay the Great Taxman Who in Redmond Abideth for.
And at one point in time, you were not used to running your own
computer system. This is as irrelevant as that. If you suspect that
they will Never Learn, then no amount of assailing them will increase
your karma or their clue; so ignore them. They won't hurt Perl.
>They think that USENET somehow owes them something, that it's around to
>read them bedtime stories from the manpages.
This is a USENET problem, not a Perl problem, and it won't cause the
downfall of Perl.
> They are used to asking a
>wizard (that's hacker wizards, not MSFMH-corrupted jargon) to do their
>reseach for them, and for free, no less.
This is a problem, and an annoying one. However, it too will not make
Perl any worse.
>And the wizards are tired of it. Damned tired.
Then the wizards need to get creative. How about this: put a paragraph
at the bottom of the FAQ explaining that people are taking advantage of
the good will of Perl experts and that in order to ask a question, the
following special magic token must be inserted somewhere in the body
of the message: 'ihavereadthefaq'. Further, if someone is asking about
a particular module, they must include the magic tokens from the bottom
of the module pod file ('ihavereadthecgipod'). Failure to do this
will result in being ignored.
Then set a global killfile, a global select file, and hey presto.
Need me to write that paragraph for you?
>--tom "blessed are those that read" christiansen
Felix
------------------------------
Date: 15 May 1998 13:58:50 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jhhmq$bd2$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
koos@stag (Koos Pol) writes:
:You are projecting your anger with the win32 weenies on the possible
:benifits for an IDE and online help for the casual programmer (such as
:me).
Perhaps. It's an easy jump. The desire for some kind of
all-in-one doctool stemmed from those who didn't realize that
they already had docs on their system, or who had congenital
fears of command lines.
--tom, still wondering how to pass arguments to a mouse click
--
X-Windows: A terminal disease.
--Jamie Zawinski
------------------------------
Date: 15 May 1998 10:13:40 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jhiik$hj$1@ultranet.com>
Tom writes:
>Sounds like you mean people who don't enjoy puzzle solving
>and tinkering. You really think they will be programming
>computers? I don't. They won't have the gift. They'll
>just be posers.
If in the act of attracting 1,000 posers, 1 cool hacker is made,
let's attract 1,000,000.
Felix
------------------------------
Date: 15 May 1998 10:24:44 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jhj7c$ih$1@ultranet.com>
Eric Bohlman <ebohlman@netcom.com> writes:
>fsg@ultranet.com wrote:
>: gbacon@cs.uah.edu (Greg Bacon) writes:
>: >If Perl is so great for nonprogrammers, why are so many nonprogrammers
>: >inundating our newsgroup with FAQs and other questions that are answered
>: >trivially with perhaps ten seconds of investigation on one's own?
>: Because they want to use Perl, but don't know the standard forms
>: of investigation.
>How well does that hypothesis explain the observable evidence? It
>predicts that someone who asks a FAQ would usually be pleased when given
>a pointer to a reference that would help him/her know the standard forms
>of investigation. But what we see instead is people bitching about how
>unhelpful and unfriendly the group is because they got instructions on
>how to find out the answers to their questions rather than getting the
>answers directly. It looks to me like many, if not most, of the FAQers
>are looking for pre-written code, not knowledge of how to write code.
The loud ones you see are the ones that didn't get it. The majority of
people I've talked to, gotten e-mail from, taught Perl, or who have
cold-call _paged_ me from Vancouver with a Perl question (you know who
you are), have started out by asking all the right stupid questions
and have been happily surprised at the quality and quantity of the Perl
documentation. I'll even include myself in this bin -- when I was first
learning Perl, I asked desperately stupid questions. I even asked them
in a totally inappropriate mailing list (three guesses. :)), even though
I had been a Unix hacker on the net for 10 years previous, because I didn't
know better. But eventually, at least in my own mind, I got clue, as did
most of the programmer wannabes I've helped bring into the Perl community.
It really is surprising that the Perl documentation is good -- most of
the documentation to everything else in the world completely sucks, so
it's easy for even a paid professional hacker like me to forget it's there.
Maybe part of the problem is that we take it for granted and don't understand
why other people don't grasp it immediately.
The big problem I see from the "enlightened" end of the pool is that
a lot of us otherwise really bright and funny guys who I'd love to have
a beer with again are Taking It Personally that people are asking stupid
questions and are crossing the boundaries of civilized conduct on the
Internet. It's like screaming at a pig that has taken a dump in your yard:
ultimately, you're not going to educate the pig. Instead, build a fence
around your yard. Make a killfile, use Perl, include magic cookies in
the FAQ that grant the holder permission to ask one question, or abandon
the newsgroup. But don't tie your emotional involvement with the language
to your hate for stupid people, or it's going to be a long, hard life.
Felix
------------------------------
Date: 15 May 1998 14:40:00 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jhk40$e1t$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, fsg@ultranet.com writes:
:It's like screaming at a pig that has taken a dump in your yard:
:ultimately, you're not going to educate the pig. Instead, build a fence
:around your yard. Make a killfile,
And shoot the pig?
--tom
--
MAGIC* xmg_magic; /* linked list of magicalness */
--Larry Wall, from sv.h in the v5.0 perl distribution
------------------------------
Date: 15 May 1998 14:36:33 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jhjth$e1t$1@csnews.cs.colorado.edu>
In comp.lang.perl.misc, fsg@ultranet.com writes:
:This is a USENET problem, not a Perl problem, and it won't cause the
:downfall of Perl.
That wasn't the point. The point was that this kind of thing has made
this newsgroup virtually useless, practically destroying through a
forever-September combination of ignorance and selfishness a resource
that had been historically valuable to the Perl community. Now combine
this with the effective disregard -- and sometimes even scorn -- for
the man-decades of work we've all spent documenting Perl. Why should
we care to be part of that world? Why should Perl?
--tom
--
"A pithy saying is worth its weight in gold." --Larry Wall
------------------------------
Date: Fri, 15 May 1998 15:55:52 +0200
From: piet <piet@activ-consult.de>
Subject: file size with perl and win NT
Message-Id: <355C4968.6A0DB340@activ-consult.de>
hello.
i am trying to get the size of several files in perl under windows NT.
i tried
$size = -s $filename;
and
@info = stat ($filename);
$size = $info[7];
my problem is, that both ways seem to work for some files but not for
others...
can anybody help me?
thanks in advance,
Gerhard Weber
p.s. another problem is that for one file the size differs from the
actual size.
------------------------------
Date: Wed, 13 May 1998 06:45:19 +0800
From: "David Upham" <david@npis.com.tw>
Subject: Re: From Linux/perl to MS SQL
Message-Id: <6jal2k$ehk@news.seed.net.tw>
Sybase's Open Client for Linux and Sybperl will also work and they are free.
Good Luck
--
David Upham
Nan Pao Information Systems, Inc.
Tel: 886-2-2816-5511 ext. 35
Fax: 886-2-2813-2111
E-Mail: david@npis.com.tw
Francesc Guasch wrote in message <3551D21E.CA48F60B@etsetb.upc.es>...
>Artur R. Czechowski wrote:
>>
>> Hello
>> I have a NT box with MS SQL server. There are some databases which I
cannot
>> move to other platform. I have a 2nd box with Linux and perl 5.004. I
need
>> to have to access from perl scripts to data collected on MS-SQL. What I
need
>> to do it? Please, give me descriptions as for idiot - step by step.
>> HELP!
>>
>see http://www.hermetica.com
>
>> PS. Commercial sollution also will be satisfied for me.
>
>You'll need odbc drivers for linux , you'll have to pay for these.
>
>> PS2. Sorry about my terrible english.
>>
>mine is worse
>--
> ^-^.-----. mailto:frankie@citel.upc.es
> o o ) http://citel.upc.es/~frankie
> Y (_ (___(ssss
------------------------------
Date: Fri, 15 May 1998 10:39:19 -0400
From: Jennifer Telisky <teliskyj@kci.wayne.edu>
Subject: How to generate random passwords?
Message-Id: <355C5397.F27805A1@kci.wayne.edu>
I have this script that will create user accounts, however I need to
assign a password at the same time. Any help on generating a random
password and updating the passwd file will be appreciated.
#!/usr/bin/perl
open(ACCOUNTS, "accounts") or die "Can't open accounts: $!\n";
while ($line = <ACCOUNTS>)
{
chop($line);
($ln, $fn, $gp, $user, $dir) = split /:/, $line;
$login = getpwnam($user);
if ($login eq "")
{
system("/usr/sbin/useradd -c \"$fn $ln\" -d
/home/$dir/$user -m
$user");
### Create user password here ####
}
else
{
open(BADUSERS, ">>badusers") or die "Can't open badusers
$!\n";
select BADUSERS;
print "$line \n";
close(BADUSERS);
}
}
------------------------------
Date: Fri, 15 May 1998 13:34:53 GMT
From: mikep@5circles.com
Subject: htgrep scripts - can't find copy to download
Message-Id: <6jhg9u$ud5$1@nnrp1.dejanews.com>
I've been trying to download the htgrep scripts from the SCG site, but the
link from the htgrep docs doesn't work for me:
http://www.iam.unibe.ch/~scg/Src/Doc/Htgrep.tar.gz
I can't find the file elsewhere on the net,but I'm sure there must be a
mirror.
Can someone please point me to other sources for the scripts?
Thanks
Mike
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 15 May 1998 14:39:33 GMT
From: carrr@mris.com
Subject: installing CGI.PM
Message-Id: <6jhk35$3ke$1@nnrp1.dejanews.com>
I installed activestates Win32 perl on my Win95 machine but it seems to be
missing stuff. I downloaded CGI.pm but when I run the makefile.pl it says I
am missing some files. It can't find \core\perl.h. I don't have that
directory or file. Help.
Rick
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 15 May 1998 13:04:22 GMT
From: Meelis Roos <mroos@ut.ee>
Subject: Re: localized ctime?
Message-Id: <6jhegm$soc$1@kadri.ut.ee>
> Instead, try
> use locale;
> use POSIX 'strftime';
Thanks, that was it.
--
Meelis Roos e-mail: mroos@ut.ee
www: http://www.cs.ut.ee/~mroos/
------------------------------
Date: Fri, 15 May 1998 16:38:10 +0300
From: Walid ALSAQAF <e78199@ceng.metu.edu.tr>
Subject: Memory problem.
Message-Id: <355C4542.8055EFF8@ceng.metu.edu.tr>
Regards,
I am working on a project that indexes html files existing on certain
sites on the internet. I wrote the perl script that does this, but when
I run the script under the nohup command and leave it for hourse hoping
that it would complete its job while it is in the background, I find out
that it doesn't. The script uses a recursive procedure to get all the
text contents and indexes them on the hard disk. I thought that the
program had a problem in its code. But there wasn't. Finally, I decided
to check the memory every 1 hour or so after the program had started and
write it into a log file. I discovered that the program aborts when the
memory used reaches %50. In the log file something like this appears:
PID %CPU %MEM SZ RSS TT STAT START TIME COMMAND
2572 38.2 52.5 1040 1564 p1 S 17:31 5:26 /usr/local/bin/perl .//g
Then it aborts. What can I do about it? I tried to optimize the code,
but it resulted in an extra 10 minutes of processing before aborting.
Any ideas (other than to add memory of course:))?
Thanks for your help in advance,,
--
/*********************************************/
Walid ALSAQAF
METU
Computer Engineering Department
mailto:e78199@ceng.metu.edu.tr
http://www.ceng.metu.edu.tr/~e78199/Walid
ICQ # : (9762042)
/*********************************************/
------------------------------
Date: Fri, 15 May 1998 09:36:31 -0700
From: mgr@24-7www.com
Subject: Re: Perl on NT -- need some assistance
Message-Id: <355C6F0F.4398@24-7www.com>
Marc A. Sonnenberg wrote:
>
> I'm running Perl 3.16 on NT 4.0. It worked fine until I upgraded to
> IIS 4.0 and now the scripts come back with the following message:
>
> CGI Error
>
> The specified CGI application misbehaved by not returning a complete
> set of HTTP headers. The headers it did return are:
>
> Can't open perl script
> "???????????????????ll?????????f????????????????????1????????????????????????a???????????":
> Invalid argument
>
> What's with all the question marks? I can't tell if it's not finding
> the script, find the script and not running properly, or not starting
> perl.
>
> Any help would be appreciated.
I won't pretend to be able to solve this, based on the above. But the
only time I had difficulty with Perl was during and upgrade of something
else.
For instance going from Netscape Commerce Server to IIS 2.0. The
security of NT combined with the other now native product IIS prevented
the parsing of Perl in RAM. One had to write the file to the HD, parse
it there and then delete it.
If I were you I would:
--Triple check permissions, especially execution by anonymous user.
--Consider upgrading to Perl 5 on a test box first.
--Learn how to use the internal Perl debuging switches/tools.
Hope that was more than you already tried.
------------------------------
Date: Fri, 15 May 1998 13:50:45 GMT
From: eryq@zeegee.com
To: Gisle Aas <aas@sn.no>
Subject: Re: Ref to an LVALUE??? I expected a simple SCALAR ref!
Message-Id: <6jhh7l$vr4$1@nnrp1.dejanews.com>
In article <m31zu0kcq7.fsf@furu.g.aas.no>,
Gisle Aas <aas@sn.no> wrote:
> I discovered the same problem myself today. It can be reproduced with
> the following code running under perl5.004_04.
>
> sub foo { $_[0] = 1; }
> foo($foo->[0]);
>
> use Storable qw(store);
> store($foo, "foo");
>
> This problem have been eliminated in perl5.004_05-tobe. Probably by
> this patch:
Thanks... it's good to know I wasn't going crazy. :-)
Eryq.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 15 May 1998 13:08:08 GMT
From: Aidan Rogers <aidan@crux.blackstar.co.uk>
Subject: Substitution Problems :(
Message-Id: <895241294.543069@sparc.tibus.net>
I'm having a slight problem with a substitution. Basically, I am writing a little
subroutine that will put a backslash before any special characters in a variable.
However, when I came to do the substitution for the ' character, it wouldn't work.
here is the syntax of the command I was using...
s/\'/\\\'/g;
all this seems to do is put 2 backslashes in front of the '. Does anyone know a
way to substitute in just _one_ backslash?
Thanks in advance,
Aidan
(slowly learning quickly :)
------------------------------
Date: Fri, 15 May 1998 13:33:20 GMT
From: jdporter@min.net (John Porter)
Subject: Re: Substitution Problems :(
Message-Id: <MPG.fc60fb9122dcfc9896cc@news.min.net>
On Fri, 15 May 1998 13:08:08 GMT,
in article <895241294.543069@sparc.tibus.net>,
aidan@crux.blackstar.co.uk (Aidan Rogers) wrote:
> I'm having a slight problem with a substitution. Basically, I am writing a little
> subroutine that will put a backslash before any special characters in a variable.
> However, when I came to do the substitution for the ' character, it wouldn't work.
I really think maybe you ought to be using the quotemeta operator.
It's built in, and does what you want (probably).
John Porter
------------------------------
Date: Fri, 15 May 1998 15:31:54 +0200
From: Matteo Boschini <boschini@cilea.it>
Subject: system vs exec vs piped open...
Message-Id: <355C43CA.1F37@cilea.it>
Hi all,
may be this is stupid, but I browsed perlfaq/dosc/etc/*@CPAN and could
not find anything.
I have a pretty complicated Perl cgi which at the end starts a C
programusing some perl variables in argv[].
Without running teh C code, I get the output html page in xx secs.
If I run the C program, I get the output html file in xxxxxxxx sec,
exactly when C programs is done executing.
I did this by means of a system("./myproc &");
Shouldn't this return to my perl as soon as the myprog & command is
done, that is, immediately ?
I also tried an exec, with the same result.
But when I tried an
open(FH,"myprog &|");
close(FH);
I get the retun page in xx secs and the c programs gets nevertheless
executed
So, why didn't system("./myproc &"); return immediately to my perl ?
Why does the piped open do ?
Thanx in advance,
Matteo Boschini
(boschini@cilea.it)
------------------------------
Date: Fri, 15 May 1998 07:11:58 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Timeout a program in Perl
Message-Id: <6jhig5$jv3@hplntx.hpl.hp.com>
KLL wrote in message <6jg4pu$c7v@bgtnsc03.worldnet.att.net>...
>I want to start a program and kill it if it runs more than a certain
>time on NT. Since I cannot do fork on NT, is there another way
>implement this? Thank you.
>
>Kan, new in Perl
I would add 'alarm' (impemented using 'fork'?) and 'flock' to the list
of portability impediments. I hope someone who has addressed these
issues will answer this important question.
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: 15 May 1998 14:43:36 GMT
From: David Turley <dturley@ravine.binary.net>
Subject: Re: Uploading pictures into a Internet Web Server
Message-Id: <6jhkao$ea0$1@oksennus.binary.net>
liru <liru@ptg.es> wrote:
> I need to upload images from a pc to an internet server. The user will
> go into a web page and in it he will find a form where he must insert
> the name of the picture and the path in his pc.
> After that when he picks a bottom the image must be uploaded into a web
> server.
> Where can I find a perl script that can do this work? Thanks.
there's an example of file upload included with cgi.pm
--
_____________________________________________________________________
David Turley
dturley@pobox.com
http://www.pobox.com/~dturley
"You don't want to be the only person sitting on a crocodile's back."
-- heard on a PBS nature show
______________________________________________________________________
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2608
**************************************