[11029] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4627 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 12 11:38:07 1999

Date: Tue, 12 Jan 99 03:00:18 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 12 Jan 1999     Volume: 8 Number: 4627

Today's topics:
    Re: BUG: getpwnam()? - Perl shipped with RedHat5.2 <eugene@snailgem.org>
    Re: BUG: getpwnam()? - Perl shipped with RedHat5.2 <eugene@snailgem.org>
    Re: BUG: getpwnam()? - Perl shipped with RedHat5.2 <eugene@snailgem.org>
        C++ frontend for simulation programs <muennich@uni-tuebingen.de>
        Converting from a Real 64 number in hex <markn_nospam_@mincom.com>
    Re: Converting from a Real 64 number in hex (Sam Holden)
    Re: Converting from a Real 64 number in hex (Fluffy)
        High resolution timing ! <stefan.nonneman@cec.be>
    Re: How can I compare two arrays? (Ilya Zakharevich)
        How to stop perldoc scroll on find? <design@raincloud-studios.com>
    Re: looking for perl programmer (Ethan H. Poole)
        Low level perl <gviczai@dam.dunaferr.hu>
    Re: Making perl do tasks at specific times.. <partha@mihy.mot.com>
        Newbie desperation (Thomas Klinger)
    Re: Perl CD Bookshelf plans <chatmaster@c-zone.net>
    Re: perl cgi (win95) doesn't work with CGI.pm (Edwin Litterst)
    Re: Perl Criticism (David Formosa (aka ? the Platypus))
    Re: Perl Criticism (Bart Lateur)
    Re: PERL information... <design@raincloud-studios.com>
    Re: Problem compiling perl script <eugene@snailgem.org>
    Re: split not working... (Bart Lateur)
    Re: Using a Form in HTML and a Perl Script. <dtbaker-@busprod.com>
    Re: What is $1 ??? (Sam Holden)
    Re: Windows NT - FrontPage server -- CGI - perl script blazek@sisblansko.cz
    Re: Year 2038 problem (Larry Rosler)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 11 Jan 1999 23:27:50 -0500
From: Eugene Sotirescu <eugene@snailgem.org>
Subject: Re: BUG: getpwnam()? - Perl shipped with RedHat5.2
Message-Id: <369ACF46.4670116F@snailgem.org>

You're right, I overlooked it because the account I was testing with
didn't actually have a real name in it.
But I checked with some others that do have real names, and sure enough
it doesn't show.
I tried the same script on a Solaris box and it works fine there.

The only difference I can see between the 2 is that Solaris shadows the
password.
Quite bizarre.

DumbKid wrote:

> Eugene Sotirescu wrote:
> >
> > What do you mean, you have no way? What's the output you get?
> >
> > Your Perl script works fine on my machine (RH 5.2 Intel).
> >
> > You might try a more elaborate version, including the -w flag:
> >
> > #!/usr/bin/perl -w
> >
> >   if (@pwent = getpwnam("snailgem")){
> >     print "pwent is @pwent \n";
> >   }
> >   else { die "no such user\n";}
> >
> > outputs:
> > snailgem EBiI5PjvSvhAM 503 504    /home/snailgem /bin/bash
>
> This is exactly what I mean. Can you find your realname in the
> above output?? :)
>
> >
> > DumbKid wrote:
> >
> > > Hi all,
> > >
> > > I have install RedHat5.2 in both Intel and Alpha machines.
> > > I have no way to get the "realname" of the users in /etc/passwd
> > > file using Perl5.005m4-1
> > >
> > > However, using standard C can get the realname no problem. Is it
> > > just me or there is a bug in perl package w/ redhat5.2
> > >
> > > PERL
> > > ====
> > >
> > >   #!/usr/bin/perl
> > >
> > >   my(@pwent) = getpwnam("username");
> > >   print "@pwent \n";
> > >
> > > Standard C
> > > ==========
> > >
> > >   #include <stdio.h>
> > >   #include <pwh.h>
> > >   #include <sys/types.h>
> > >
> > >   main()
> > >   {
> > >      struct passwd *pwent;
> > >      pwent = getpwnam("username");
> > >      printf("realname = (%s) \n", pwent->pw_gecos);
> > >   }
> > >
> > > Any idea?? Both Intel and Alpha distributions have this problem.
> > >
> > > Regards,
> > > Tom



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

Date: Mon, 11 Jan 1999 23:23:53 -0500
From: Eugene Sotirescu <eugene@snailgem.org>
Subject: Re: BUG: getpwnam()? - Perl shipped with RedHat5.2
Message-Id: <369ACE58.4DA419D7@snailgem.org>

Hmmm. . .
Here's my version:

Characteristics of this binary (from libperl):
  Locally applied patches:
        MAINT_TRIAL_4 - 5.004_05 maintenance trial 4

So I don't think it's Perl.



DumbKid wrote:

> M.J.T. Guy wrote:
> >
> > DumbKid  <dumbkid@ix.netcom.com> wrote:
> > >
> > >I have install RedHat5.2 in both Intel and Alpha machines.
> > >I have no way to get the "realname" of the users in /etc/passwd
> > >file using Perl5.005m4-1
> >
> > For reasons known only to RedHat, they shipped release 5.2 with an
> > unsupported, unreleased development version of Perl.    It has various
> > problems.    I don't know if this is one of them, but before proceeding
> > further, install a released version of Perl from CPAN.
> >
> > Mike Guy
>
> I did tried to install perl5.005-02 compiled from source. However,
> when make test, it only shows 91% is good (is working).
>
> I am using an 164LX Alpha machine with Redhat5.2 freshly installed.
>
> Regards,
> Tom



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

Date: Mon, 11 Jan 1999 23:07:09 -0500
From: Eugene Sotirescu <eugene@snailgem.org>
Subject: Re: BUG: getpwnam()? - Perl shipped with RedHat5.2
Message-Id: <369ACA6D.31BF7B2E@snailgem.org>

Thanks for the concern Uri, I modified the letters of the encryption before
posting.
So, to all would-be crackers out there, don't bother ;-----------------)

Uri Guttman wrote:

> >>>>> "ES" == Eugene Sotirescu <eugene@snailgem.org> writes:
>
>   ES>   if (@pwent = getpwnam("snailgem")){
>   ES>     print "pwent is @pwent \n";
>   ES>   }
>   ES>   else { die "no such user\n";}
>
>   ES> outputs:
>   ES> snailgem ************* 503 504    /home/snailgem /bin/bash
>                ^^^^^^^^^^^^^
>                      ^
> encrypted password deleted
>
> i am sure the poster appreciated your help but you shouldn't have posted
> the encrypted password in your example. now it could be cracked (and des
> is very crackable these days). i recommend you change that password ASAP.
>
> uri
>
> --
> Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
> Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
> uri@sysarch.com  ------------------------------------  http://www.sysarch.com
> The Best Search Engine on the Net -------------  http://www.northernlight.com



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

Date: Tue, 12 Jan 1999 11:31:54 +0100
From: Ralf Muennich <muennich@uni-tuebingen.de>
Subject: C++ frontend for simulation programs
Message-Id: <369B249A.97E0E8C5@uni-tuebingen.de>

I currently write simulation programs in C++. Until now I have no
frontend
to start the simulation programs. For this I intend to apply an internet
based
approach that might be CGI/Perl (with Apache on Linux). The reason is
that I want to start the programs from different computers on one single
computer.
Until now I have no experience with CGI and Perl. So my questions:
1. Is it possible (does it make sense) to write a HTML-based frontend,
that
helps me passing some parameters as commandline options to a C++
program via CGI/Perl.
2. What would be the best solution to show the output from the
simulation
programs in the browser (the simulations take a while).
3. Are there methods to create new directories and testing for files
that
already exist (in CGI/Perl) before starting the simulation programs.
Any suggestions are welcome preferably by e-mail.
Thanks in advance,
Ralf
-------------------------------------
Dr. Ralf Muennich
Wirtschaftswissenschaftliches Seminar
Abteilung Statistik, Oekonometrie
   und Unternehmensforschung
Mohlstrasse 36
D-72074 Tuebingen
TN: +49 7071 29-72570    Fax: -5546
ralf.muennich@uni-tuebingen.de




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

Date: Tue, 12 Jan 1999 15:33:25 +0800
From: "Mark Nold" <markn_nospam_@mincom.com>
Subject: Converting from a Real 64 number in hex
Message-Id: <77eto7$23t$1@pithy.mincom.oz.au>

Hi,

An application im interfacing is giving me a REAL-64 (A 64 Bit Real Number?)
in Hex. (eg: 0000000000b08f40)

How do i convert this to a real number usable in Perl. (The hex function
doesnt return the value im expecting)

mn






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

Date: 12 Jan 1999 08:25:52 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Converting from a Real 64 number in hex
Message-Id: <slrn79m1og.j7o.sholden@pgrad.cs.usyd.edu.au>

On Tue, 12 Jan 1999 15:33:25 +0800, Mark Nold <markn_nospam_@mincom.com> wrote:
>Hi,
>
>An application im interfacing is giving me a REAL-64 (A 64 Bit Real Number?)
>in Hex. (eg: 0000000000b08f40)
>
>How do i convert this to a real number usable in Perl. (The hex function
>doesnt return the value im expecting)

And why don't you expect to get 11571008????

-- 
Sam

Simple rule: include files should never include include files.
	--Rob Pike


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

Date: 12 Jan 1999 08:47:15 GMT
From: meowing@banet.net (Fluffy)
Subject: Re: Converting from a Real 64 number in hex
Message-Id: <77f26b$e9f@meow.invalid>

Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
> On Tue, 12 Jan 1999 15:33:25 +0800, Mark Nold <markn_nospam_@mincom.com> wrote:
> >An application im interfacing is giving me a REAL-64 (A 64 Bit Real Number?)
> >in Hex. (eg: 0000000000b08f40)
> >
> >How do i convert this to a real number usable in Perl. (The hex function
> >doesnt return the value im expecting)
> 
> And why don't you expect to get 11571008????

REAL(64) sure sounds like a Fortran float of some kind (Cray?).  If so,
there's no real way to turn it into something useful without knowing
the native system's internal format and doing a conversion.  Hex() is
just going to treat it as an integer.

Any chance the application can be convinced to return the number as a
decimal string?
-- 
"Meow."  --me


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

Date: Tue, 12 Jan 1999 09:28:51 +0100
From: Stefan Nonneman <stefan.nonneman@cec.be>
To: stefan.nonneman@cec.be
Subject: High resolution timing !
Message-Id: <369B07B6.D29D0EC0@cec.be>

Dear all,

I am looking for a high-resolution timer (1ms or finer) that can be used
in PERL.
Recently I found some sites with enormous ammounts of modules etc for
PERL but I have no idea where
to look.

Some suggestion ???

Thank you very much in advance !!!!

Regards,

Stefan Nonneman




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

Date: 12 Jan 1999 07:27:00 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: How can I compare two arrays?
Message-Id: <77etg4$hsk$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Abigail
<abigail@fnx.com>],
who wrote in article <77e3dv$5b9$1@client3.news.psi.net>:
> %% Hash access is indeed O(1) -- constant independent of the size of the 
> %% hash.  (If the hash is quite full, there may be some linear effects due 
> %% to chaining of entries -- the details depend on how the hash is 
> %% implemented, which for perl I don't know.)
> 
> You cannot garantee O (1). Worst case insertion/query time is Omega (n).
> "Linear effects" due to chaining don't have to do with the hash being
> full, but with many keys hashing to the same bucket. 

 ... which might have happened quite often with the "old" Perl hashing
function, which was very non-"random", or, at least, it was assigning
very non-"random" buckets.  The new function (more precise, the new
way to map the old function to buckets) has much better chance to get
a "flat" distribution of keys over buckets in real application.

The transition happened circa 5.005_53.

Ilya


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

Date: 12 Jan 1999 07:23:45 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: How to stop perldoc scroll on find?
Message-Id: <77eta1$hle@bgtnsc02.worldnet.att.net>

I've noticed when say doing...

perldoc -f stat

Some of the text rolls off the screen. Of course I could just go

perldoc stat

But I rather like the quick summaries given by -f. Is there
another switch to make it pause the output 1 screen at a time?
perldoc perldoc didn't mention anything about it.

CT




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

Date: Tue, 12 Jan 1999 08:41:13 GMT
From: ehpoole@ingress.com (Ethan H. Poole)
Subject: Re: looking for perl programmer
Message-Id: <JUDm2.28$5R4.75@news15.ispnews.com>

In article <369AEFC1.DDF2B65F@daimi.au.dk>, thomas@daimi.au.dk says...
>
>
>"Think Smart, Think BIG! - Big Software) Corp."

Actually, I kinda like this attempt to 'copyright' a business name.. now if 
only it really worked thatway--everyone could save a lot of money on 
trademarks.

-- 
Ethan H. Poole              | Website Design and Hosting,
                            | CGI Programming (Perl & C)..
========Personal=========== | ============================
* ehpoole @ ingress . com * | --Interact2Day, Inc.--
                            | http://www.interact2day.com/



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

Date: Tue, 12 Jan 1999 10:46:54 +0000
From: Viczai Gabor <gviczai@dam.dunaferr.hu>
Subject: Low level perl
Message-Id: <369B281E.AC6A2C1C@dam.dunaferr.hu>

Have a nice perl to everyone,

When I first heard about Perl it was told to be hacker's favourite
language.
Now can anyone tell me how to create an Ethernet packet and send it over
a LAN
or
how can I capture Ethernet packets transmitted on wire and take a look
of it?

The main task is to inspect one's ethernet adress only with knowing his
IP address.

Any clever one can solve this? :)

TIA: Viczai Gabor



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

Date: Tue, 12 Jan 1999 13:38:15 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
To: FirstAGYG <firstagyg@aol.com>
Subject: Re: Making perl do tasks at specific times..
Message-Id: <369B02EF.383F71CE@mihy.mot.com>

Hi,

I am not sure if PERL has any such function/utility to schedule jobs at 'specific
times'. I suggest you think of writing a PERL script and then run it as a 'cron'
job - of course, you need to have admin. privileges. If you don't, try running
the script in an infinite-loop and check for the time (`date` or the time(),
localtime() cmds of PERL)

HTH
-Partha

>  how to schedual perl to do things at specific
> times, without any intervention from me or a user.





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

Date: Tue, 12 Jan 1999 09:37:19 GMT
From: t.klinger@mobilkom.at (Thomas Klinger)
Subject: Newbie desperation
Message-Id: <369b1726.11253861@194.48.138.240>

I'm really desperated!
I already read "Learning Perl" twice but I can't get into this stuff.
As help I also bought "Programming Perl" and "The Perl Cookbook" but
this language is still secret to me.
I tried to program those examples to understand the syntax but maybe
I'm to stupid for PERL.
Maybe I give up.


Kind regards

       Thomas Klinger
       Systemspecialist
=======================================
t.klinger@mobilkom.at
http://www.mobilkom.at
=======================================





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

Date: Mon, 11 Jan 1999 23:32:45 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Perl CD Bookshelf plans
Message-Id: <369AFA9D.FFB7E41C@c-zone.net>



bj wrote:
> 
> Chris Maden <crism@oreilly.com> writes:
> 
> > Question for the Perl community:
> 
> > _Advanced Perl Programming_
> > _Perl Cookbook_
> > _Programming Perl_
> > _Perl in a Nutshell_
> > _Perl 5 Pocket Reference_
> >
> > The question is, would it be useful to also include _Learning Perl_
> > and _Learning Perl on Win32 Systems_?
> 
> Make sure the search engine allows you to limit your searches and it
> would be an reasonable addition.
> 
> Don't really see the advantage of including the pocket reference, but
> if you do, please also include the Perl/Tk one. If you are going to
> include them, they should be, the same as the online versions are.
> 
> Also, you _really_ should include Learning Perl/Tk (which should be at
> the presses if O'Reilly is going to make the already pushed back
> January publication date... you are going to make this one right?)
> 
> Personally I would leave out the pocket references, add in Learning
> Perl/Tk and Mastering Regular Expressions.
> 
> bj


Yes on Learning Perl, but I don't know if you should bother with the
Pocket reference, even though it's useful, it's basically just
explaining what's in the books in a seperate/simpler context/format.
However, it would be a positive addition. I'm no sure what the reaction
will be to the Learning Perl, as opposed to the Learning perl On Win32,
due to the fact that there are so many similarities, it'd be better to
just have the differences explained. But I assume that's how it'd turn
out anyway. 

I think the main thing people are considering, is the price difference
if there's another one or two books included.

Yes, I think the beginners will even be more incline to buying it, then
even the more moderate to advanced programmers.

I agree it would be wise/good to add Mastering Regular Expressions, or
at least a good portion of it.

I say go for it all. :-)
-- 
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application


       Copyright ) 1999 TRG Software and The Link Worm.


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

Date: Tue, 12 Jan 1999 07:46:49 GMT
From: el@fiz-karlsruhe.de (Edwin Litterst)
Subject: Re: perl cgi (win95) doesn't work with CGI.pm
Message-Id: <369afc7b.2846545@news>

>> A small demo perl script works nice if called from the command line
>> but doesn't return anything if CGI.pm is included:
>> 
>> use Cgi;
>> print "Content-Type: text/plain\n\n";
>> print "Hello, World!\n";
>> 
>> The directory which contains the libs is part of the @INC.
>> I read the CGI FAQ as well as the Win32 FAQ but nothing seems to
>> apply.
>
>use Cgi;
>OR
>use CGI;

I tried both - and also other modules (just to see whether loading
them would change anything, but only CGI shows this behavior).

>print "Hello, World!\n"; #nothing wrong here..

:-)

>Why are you wanting to use the CGI.pm, when you already have have the
>Content-type for a simple print test?

Because this is more or less the smalles example to show this strange
behavior.
Of course I want to do more (developing some of my CGI scripts under
win).

>Anyway, you're trying. So next step is to read some documentation, or
>some books, or both. O'reilly has very good Perl books, i.e., Learning
>Perl, Programming Perl, and the Perl Cookbook. And the documentation
>should come with Perl.

I already have several years of experience with perl - but only under
unix. The only thing I'd like to know is how to get the same stuff
running und win95.
BTW, I am using perl as distributed with the normal perl package and
tinyweb as  server.

Eddie


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

Date: 12 Jan 1999 07:49:16 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn79lvjs.mtj.dformosa@godzilla.zeta.org.au>

In article <77ek7j$1b1$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>Reply to David Formosa's 1999/01/09 message:
>
>>> You have ever read the workings of the verious design comminties?
>You have ever read the works of Wirth ect?  A starting place would be
>"Concepts of Programming Languaeges" by Robert W. Sebesta then read
>all the books in its Bibliography. <<
>
>People who have the time to study these 100+ books are
>probably PAID to do research.

I don't, I'm paid to be a computer programer, I read books on CS as a
hobby.  I've read a number of design comminties documents (and been a
member of a copple as well (though not a langugage)).

[...]

>If *you* have read all these, then you are in an ideal
>position to start setting me strait.

Of the bookes in the Bibliography I've only read the book itself and
The Knuff books.

[...]

>That does not keep them from having influence. Also, the goals
>of a programmer may be different than those of a manager.
>Programmers may try to engage in "hit and run" programming--
>writing cryptic code that only they can figure out to
>protect their job. It happens all the time.

I haven't seen that happen in my workforce.  Indeed this problem can
be solved useing good code review methidology.

[...]

>>> the fact that you can't find any of them [books] is not the
>fault of these languge designers. <<
>
>Yes it is. They should publish it on the web for free.

Well larry wall has placed some of his critor on the web,

http://www.wall.org/~larry/natural.html


[...]

>>> It just happend to coinedently happened to share a commen scope of the
>
>package main.  If they where in diffrent scopes then they would nosuch effect
><<
>
>Like I said before, "isolate" is a whole lot simpler than using packages
>(for our given purpose).

Given that I've never had need for such a keyword, and given that the
need to use such a keyword would indercate realy poor design and given
that a number of alternative better scheams exist, do you think adding
it is worth it?

[...]

>>> I do it quite alot in meny of my programs its quite natural to do. <<
>
>When you get used to something, of course it is "natural" for you.

No its not natural because I'm used to it, its natural because it
mirrors the way I think.  I can often guess at a perl construct to do
what I wish to do and have it work because perl has been well designed.

[...]

>>> [I believe DBM is an *add-on* to Perl, not built into the language.]
>You can beleaave what you wish but it doesn't make them truthfull. <<
>
>Is it and add-on, yes or no?

DBM support is as much an add on as the regexp engion, hash table
support, its socket support or its abilit to do mathimatics.

[...]

>>> The perl5 archives would be a good place. <<
>
>Let's see if L.Wall considered the same possible variations
>that I did. Let's see why he rejected them. Where are
>these Perl Archives?

http://www.egroups.com/list/perl5-porters/info.html


-- 
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html



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

Date: Tue, 12 Jan 1999 09:01:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl Criticism
Message-Id: <369b06fa.1800221@news.skynet.be>

topmind@technologist.com wrote:

>That is utterly ridiculous! Why is a working implimentation so
>important? Nobody has questioned the implimentability of
>the features I describe.

Because the proof of the pudding is inthe eating. You may say all you
like that on paper, this is the recipe of the best pudding ever, but as
long as nobody's ever tasted it, simply because it hasn't ever been
baked yet, this claim doesn't mean much.

If you'd actually have a working prototype of the features you'd like to
see implemented, you could test and see if it actually is practical.

That's why I suggested trying out some of the alternative programming
languages. Most of the features you'd like to see implemented, are
already present in some languages, somewhere. You could test for
yourself if your theory holds any water.

There's also counter examples. Programmers have already tried build "the
holy grail" of programming languages, "the answer to every question",
and quite some time ago. See for example PL/I and Ada. The problem with
these languages is that they turned out so incredibly bulky, that people
lost the necessary overview of the language, or even a usable subset.

Come to think of it: Ada might be the closest existing language to what
you seem to want. If there ever was a language that wanted to protect a
programmer against himself, this is one prime example.

	Bart.


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

Date: 12 Jan 1999 06:59:19 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: PERL information...
Message-Id: <77ers7$il3@bgtnsc03.worldnet.att.net>

>: Although a book, the Camel book "Learning Perl" really seems
>   You have your cites wrong...
>   "Learning Perl"    = Llama (tutorial)
>   "Programming Perl" = Camel (reference)


%^$* My apologies. I've done that twice now. Now I gotta go be a
zoologist too. Heck.. both books are great. Can't hurt to have
either. I could have used the Cookbook a lonnnggg time ago.

Just picked up the Resource Kit yesterday. I have a feeling my
posting spree has ended. :)

CT




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

Date: Mon, 11 Jan 1999 23:47:20 -0500
From: Eugene Sotirescu <eugene@snailgem.org>
Subject: Re: Problem compiling perl script
Message-Id: <369AD3D8.4AB1B630@snailgem.org>

Yes, and ask back in this group if you can't find the bug in line 17.

(You might also try to use a full path to the file you're requiring:
require "/your/path/to/cgi-lib.pl";
)

Abigail wrote:

> Michelle Looi (lylooi@ncs.com.sg) wrote on MCMLIX September MCMXCIII in
> <URL:news:3699FC49.5F282ABC@ncs.com.sg>:
> // Hi Everyone,
> //     Currently I have install perl v 5.005_02 in my machine and use it to
> // help me to compile my perl script into a binary format .  I have try to
> // compile a normal perl script without using "require '...'" (eg require
> // 'cgi-lib.pl') it works fine.  However, when I compile a perl script
> // which use the "require 'cgi-lib.pl' it will give me compilation error.
>
> There must be a bug in line 17.
>
> Abigail



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

Date: Tue, 12 Jan 1999 09:01:52 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: split not working...
Message-Id: <369d0cd8.3301871@news.skynet.be>

Keith Woodworth wrote:

>I want to grep for one $user then split the line and printe out $user_name
>and $total.

Ah, you expect ONE line with the user name. Maybe that won't happen.

This snippet might help:

	($_,@rest) = grep  { ... } @ary;
	die "Multiple lines" if @rest;
	die "Not found" unless defined;

And now, you're ready to do the split.
		
	Bart.


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

Date: Mon, 11 Jan 1999 21:38:05 -0600
From: Dan Baker <dtbaker-@busprod.com>
Subject: Re: Using a Form in HTML and a Perl Script.
Message-Id: <369AC39D.1D4DEF5E@busprod.com>

Jamie Bekkers wrote:
> 
> Hello.
> 
> This may be the wrong group but here goes.
---------
it is kinda the wrong group.... if you have perl questions, this is the
place! If you have HTML or cgi questions, you will have better luck in
comp.infosystems.www.authoring.cgi  Try finding groups with
http://www.dejanews.com and get a feel fo rthe group, look for past
answers, etc.


> I can get this to run from the console, but I can not work out the code to
> put this in a web page.  I would like a web page that asks for the logfile
> and then prompts separate boxes for the date and times.
----------
read up on HTML forms which use either GET or POST to pass data to your
perl script. All you really need are some simple text boxes by the sound
of it. Find a form on the web, and look at the source! Don't forget you
have to figure out what to do with the output from that script too....

good luck

Dan


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

Date: 12 Jan 1999 06:55:01 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: What is $1 ???
Message-Id: <slrn79lse5.fmt.sholden@pgrad.cs.usyd.edu.au>

On Mon, 11 Jan 1999 11:12:02 -0000, Richard Partridge
	<r.partridge@dewynters.com> wrote:
>Hi,
>I'm new to perl and am deciphering some code and have come
>across the following snippet of code:
>
>if $things[0] =~/id=([0-9]+)/)
>{
>     $ID=$1;
>
>.
>.
>
>is $1 a special scalar? There's no other reference in the script to this
>variable so I assume that it's just a null? Does it have anything to do with
>Environment variables etc?

You could print the value out and see...
You could assume the author was a moron and randomly chose $1 in this one
location only instead of undef.

I would probably RTFM and find out what $1 means.

It follows a regular expression in your example so why not check
'perldoc perlre' (page 10 for me... will depend upon you terminal size).

You could also read a book about Perl, since that's what many many people
do when they are trying to learn something.

Someone else already answered so you have your answer anyway so I guess
it doesn't hurt to say it again (instead of just telling you where to look)...

Since it get's assigned to $ID I would start by assuming the author isn't a
complete moron and that $1 probably contains an ID. Looking at the regular
expression I see it contains 'id'. Possibly $1 contains the id that was in
the text the regex was looking at. I guess I should check the regex 
documentation with 'perldoc perlre'. Since I'm lazy I'll do a search for
'$1' and lo and behold there it is (so it found $10 but it's what I wanted
anyway). See it's quite easy to find answers for yourself, and in fact 
helps you to remember them, and to find the answer to the next question 
you have.

-- 
Sam

So I did some research. On the Web, of course. Big mistake...
	--Larry Wall


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

Date: Tue, 12 Jan 1999 09:22:13 GMT
From: blazek@sisblansko.cz
Subject: Re: Windows NT - FrontPage server -- CGI - perl script
Message-Id: <77f482$ekf$1@nnrp1.dejanews.com>

In article <76vhv2$qn1@ustsu10.ust.hk>,
  "REN, Rui" <rren@cs.ust.hk> wrote:
>
> Hi,
>
> I am running  Frontpage on my PC.
>
> Perl scripts can be run locally , but when they are accessed via   the web,
> ie. when a perl script is the target of a form in a remote webpage,  the
> client gets a error :
>
> 500 Server Error
> The server encountered an internal error or misconfiguration and was unable
> to complete your request
>
> FrontPage  does  have a   cgi-bin directory so I supppose CGI is already
> installed.  My guess is that FrontPage server is not properly configurered
> to run perl sctipt, ie. it has not idea how to deal with that file.
> What can I do about this ?    One possible thing is to   define a wrapper
> batch file that calls the perl intepreter and the script ,  but how  ?
>
> thanks..
>
> rui
>
>

Dear Rui,
I also use Perl with Personal Web Server from Front Page 98 program and it
works great.
I enclosed  a web page with HELLO.pl script. Notice the path.
Path can not be DOS like c:\webshare\wwwroot\cgi-bin\hello.pl
but html like
http://webserver name/cgi-bin/hello.pl

<html>

<head>
<title>CGI Test Form</title>
</head>

<body>

<form action="/cgi-bin/HELLO.pl" method="POST">
  <p><input type="submit"> </p>
</form>
</body>
</html>

Hope it helps.
Lada

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 12 Jan 1999 00:07:03 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Year 2038 problem
Message-Id: <MPG.1104a27ec8fa4dac989987@nntp.hpl.hp.com>

In article <77ddn7$krn$1@romeo.dax.net>, mike@crusaders.no says...
> On 11. Jan 17:33, John Robson wrote:
> > I heard that Perl and perhaps Linux as well have a 'year 2038'
> > problem. 
> > Has something to do with an internal 32-bit reperesentation.  
> > Just out of curiosity, can someone explain to me where this '2038'
> > number come from?  What does it entail?
> 
> this is when the "number of seconds since jan 1. 1970(i think...)" is
> larger than a signed 32-bit integer and rolls over to 0.

No, it doesn't roll over to 0.  It becomes 0x80000000, which is a valid 
*unsigned* 32-bit integer (2 ** 31).  The rollover to 0 doesn't occur for 
another >68 years after that.

The problem that will occur in 2038 is this:  Even if one assumes an 
unsigned 32-bit representation, the interval between two times can be 
greater than a signed 32-bit integer, so ambiguities will arise as a 
result of simple subtraction of two times.  More complicated logic could 
resolve the ambiguity, but existing code will fail.

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


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

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

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