[8751] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2367 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 21 02:07:41 1998

Date: Mon, 20 Apr 98 23:01:16 -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           Mon, 20 Apr 1998     Volume: 8 Number: 2367

Today's topics:
        ---- Need Help Making Search.cgi Increment a Page Count <lksjdkfljsd@noway.net>
    Re: ANNOUNCE: Win32API::SerialPort Documentation <rothd@xrxoxtxhx.xnxextX>
    Re: ANNOUNCE: Win32API::SerialPort Documentation (Bbirthisel)
    Re: ANNOUNCE: Win32API::SerialPort Documentation <gmarzot@baynetworks.com>
    Re: Are there things NOT answered yet ? <rjk@coos.dartmouth.edu>
    Re: Array / List question <rjk@coos.dartmouth.edu>
    Re: array elements -- how to exclude when reading in? (Jason Gloudon)
    Re: CGI help for a newbie, easy question (Abigail)
    Re: creating config file to pull into a script. <bmb@ginger.libs.uga.edu>
        DateTime manipulation nmoni@hotmail.com
    Re: getpwnam question <kquinn@sk.sympatico.ca>
    Re: getpwnam question <j.marshall@dial.pipex.com>
    Re: help on some cgi stuff (Abigail)
    Re: Help, I'm going Perl-bald! <dfetter@shell4.ba.best.com>
    Re: HELP: Trying to create a search application (John Heidemann)
    Re: How do I get the name of each file in a dir? <sneaker@earthling.net>
    Re: How to create a new file? (Craig Simpson)
    Re: How to get clock ticks or calculate elapsed time le <j_harrison1@ti.com>
    Re: htaccess & htpasswd help!!! (Craig Simpson)
    Re: HTML Tables -> Preformatted Text ? <bmb@ginger.libs.uga.edu>
    Re: Newbie question... (Hunter Johnson)
    Re: newbie trying to close off a pipe (Craig Simpson)
    Re: newbie trying to close off a pipe <rjk@coos.dartmouth.edu>
    Re: Password changing under Solaris <brianm@kodak.com>
    Re: perl and spaces in strings <rjk@coos.dartmouth.edu>
    Re: perl and spaces in strings (Joe Hass)
    Re: perl and spaces in strings (John Moreno)
    Re: PERL en francais SVP <tony@cyberscape.net>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 19 Apr 1998 16:04:34 -0400
From: Joe Kamenar <lksjdkfljsd@noway.net>
Subject: ---- Need Help Making Search.cgi Increment a Page Counter
Message-Id: <353A58D2.328A@noway.net>

I have a search.cgi script that calls a file called search_define.pl. In
this file, I have som html for a page counter. The problem is that each
time the .pl file is called without hitting "reload", the page counter
does not increment.

How do I make the page counter increment each time the search.cgi script
is run?

It seems that as long as you hit "BACK" with the browser, you can do
another submit without incrementing the page counter.

Address replies to mailto:kamenar@webmall.net

Thanks


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

Date: 20 Apr 1998 20:14:09 GMT
From: "Dave Roth" <rothd@xrxoxtxhx.xnxextX>
Subject: Re: ANNOUNCE: Win32API::SerialPort Documentation
Message-Id: <01bd6c99$5925fda0$0101a8c0@main2>



Bbirthisel <bbirthisel@aol.com> wrote in article
<1998042015492600.LAA21082@ladder01.news.aol.com>...
> Hi All:
> 
> This is a preliminary announcement for a module that will
soon be available
> for public testing. Documentation in html and pod formats
is available now
> at: "http://members.aol.com/Bbirthisel".
> 
> I would appreciate feedback from those interested in this
module (which is
> NT/Win95 specific). The module is targeted at perl 5.005.
A reduced performance
> version for tesing on AS and GS ports will be available
shortly.
> 
> Brief Summary: Use Win32 API calls to handle serial
communications.
>                         Implement non-blocking I/O.
>                         Provide methods for setting
serial port parameters.

Very cool! You may want to consider renaming it to
Win32::Serial or something like that--using the current
convention of the Win32 namespace.
I would love to see it.
dave
-- 
============================================================
====
Dave Roth                               ...glittering
prizes and
Roth Consulting                     endless compromises,
shatter
rxoxtxdxxrxoxtxhx.xnXeXt               the illusion of
integrity

 My email address is disguised to fool automailers. Remove
the
                      X's to send me email.
************************************************************
****
Use of  this message or  email address  for commercial 
purposes
(including "junk" mailings) is strictly prohibited and
protected
under  current  international  copyright laws  and United
States
Code, Title 47, Chapter 5, Subchapter II.



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

Date: 20 Apr 1998 21:45:16 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: ANNOUNCE: Win32API::SerialPort Documentation
Message-Id: <1998042021451600.RAA24552@ladder03.news.aol.com>

Hi Dave:

>> Brief Summary: Use Win32 API calls to handle serial Communications.
>>                         Implement non-blocking I/O.
>>                         Provide methods for setting serial port parameters.
>
>Very cool! You may want to consider renaming it to
>Win32::Serial or something like that--using the current
>convention of the Win32 namespace.

Actually, Win32API is also a current namespace. I have been working with
Tye McQueen since his Win32API::File uses some of the same underlying
API calls (and MANY of the same constant definitions). The designation
"Serial" vs "SerialPort" is certainly open for discussion. I sent a request to
PAUSE a while ago, but the name has not been "blessed" yet. I'm not fussy
about the top namespace, either - the documentation carries an "ANYTHING
may change" disclaimer:-)

-bill


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

Date: 20 Apr 1998 18:13:54 -0400
From: Joe Marzot <gmarzot@baynetworks.com>
Subject: Re: ANNOUNCE: Win32API::SerialPort Documentation
Message-Id: <pdemyskuot.fsf@baynetworks.com>

"Dave Roth" <rothd@xrxoxtxhx.xnxextX> writes:

> 
> 
> 
> Bbirthisel <bbirthisel@aol.com> wrote in article
> <1998042015492600.LAA21082@ladder01.news.aol.com>...
> > Hi All:
> > 
> > This is a preliminary announcement for a module that will
> soon be available
> > for public testing. Documentation in html and pod formats
> is available now
> > at: "http://members.aol.com/Bbirthisel".
> > 
> > I would appreciate feedback from those interested in this
> module (which is
> > NT/Win95 specific). The module is targeted at perl 5.005.
> A reduced performance
> > version for tesing on AS and GS ports will be available
> shortly.

really glad to hear this - good going.

> > 
> > Brief Summary: Use Win32 API calls to handle serial
> communications.
> >                         Implement non-blocking I/O.
> >                         Provide methods for setting
> serial port parameters.
> 
> Very cool! You may want to consider renaming it to
> Win32::Serial or something like that--using the current
> convention of the Win32 namespace.
> I would love to see it.

Or how about something more generic like

IO::Serial

alowing a win32 implementation as well as unix. It would still be nice
to think that perl might become more of a cross platform language.

my 2cents, GSM


> dave
> -- 
> ============================================================
> ====
> Dave Roth                               ...glittering
> prizes and
> Roth Consulting                     endless compromises,
> shatter
> rxoxtxdxxrxoxtxhx.xnXeXt               the illusion of
> integrity
> 
>  My email address is disguised to fool automailers. Remove
> the
>                       X's to send me email.
> ************************************************************
> ****
> Use of  this message or  email address  for commercial 
> purposes
> (including "junk" mailings) is strictly prohibited and
> protected
> under  current  international  copyright laws  and United
> States
> Code, Title 47, Chapter 5, Subchapter II.
> 

-- 
 G.S. Marzot                        email: gmarzot@baynetworks.com
 Bay Networks Inc.                  voice: (978)670-8888 x63990
 600 Tech Park  M/S BL60-101        pager: (800)409-6080 (4096080@skytel.com)
 Billerica, MA  01821                 fax: (978)670-8145


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

Date: Mon, 20 Apr 1998 15:47:57 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: birgitt@order.booktraders.com
Subject: Re: Are there things NOT answered yet ?
Message-Id: <353BA672.997BE9E7@coos.dartmouth.edu>

[posted and mailed]

Birgitt Funk wrote:
> 
> Ronald J Kimball wrote:
> 
> > I don't think anyone has bothered to count all the possible
> > questions, alone determine which ones have been answered
> > only in clpm.
> 
> Yes, but may be you have a good overall feeling if that
> percentage of questions is in the overall range of 5 - 10
> percent or in the 40 - 50 percent.
> 
> That's all I was after.

Hmm...  I think it would be a fairly small percentage which are answered
*only* in clpm.  All the generally relevant questions should be answered in
the docs and the books, and all the frequently asked questions end up in the FAQ.

Many of the really interesting questions that are answered only in clpm are
ones that explain the other answers in more detail.  Perhaps someone wasn't
sure how a book's answer applied in a specific situation, or whose program is
almost like the FAQ example but needs to incorporate something else.

I still can't come up with a range type answer, though.

> I feel really sorry to have caused such a useless thread.
> I thought my question was pretty simple and straight forward.

I don't think it was a useless thread.  Okay, my answer was flip, but it is
still a worthwhile question, even if there is no "exact" answer.  (I guess it
was just the mood I was in when I replied.)

You said several people have emailed you replies.  Would you be willing to
post a digest of those responses?  I am interested in what other people had to
say on this topic.

-- 
 _ / '  _      /         - 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: Mon, 20 Apr 1998 23:43:12 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Array / List question
Message-Id: <353C15D0.458B2AF1@coos.dartmouth.edu>

Larry Rosler wrote:
> 
> John Porter wrote in message <353B9AF4.146C@min.net>...
> >In other words, @i**2 squares the number of elements in @i;
> >@i[@i]**2 squares the last element in @i.  Are these the same?
> >Are 0 and 16 the same?  Does ( 0 == 16 ) evaluate True?
> 
> I'm baffled by this.  What does @i[@i] have to do with the last element
> in @i?  As I read this, it is an array slice, whose value for the data
> shown above should be ( 2, 3, 4, undef ).  Its length is 4, so squaring
> it gives 16, regardless of the values in the array.  Try it again with
> other values, and you will see.

I take it you didn't try it with *any* values, Larry.  Do you think John just
made up the results in his example?  An array slice (such as @i[@i]) in scalar
context yields the last element in the slice, not the number of elements in
the slice.

For example:

  DB<1> @i = 1..4

  DB<2> X i
@i = (
   0  1
   1  2
   2  3
   3  4
)
  DB<3> x @i[@i]
0  2
1  3
2  4
3  undef
  DB<4> x scalar @i[@i]
0  undef
  DB<5> x scalar @i[reverse @i]
0  2

Try it with any values (such as the ones John used in his example) and you
will see.

-- 
 _ / '  _      /         - 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: Mon, 20 Apr 1998 20:40:12 GMT
From: jgloudon@hyssop.bbn.com.bbn.com (Jason Gloudon)
Subject: Re: array elements -- how to exclude when reading in?
Message-Id: <slrn6jncla.6ft.jgloudon@hyssop.bbn.com>

Jonathan Feinberg <jdf@pobox.com> wrote:
>mshavel@erols.com (Michael Shavel) writes:
>In which case
>
>   while(<>) {
>      next if /\026/;
>      push @records, $_;
>   }

or if he's just interested in filtering before processing one could say

@records = map { /\026/ ? () : $_ } <>;

Of course this has its disadvantages.

Jason Gloudon


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

Date: 20 Apr 1998 14:59:24 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: CGI help for a newbie, easy question
Message-Id: <6hfnsc$dm0$3@client2.news.psi.net>

Andrew Connell (jconnell@lords.com.nospam) wrote on MDCXCIII September
MCMXCIII in <URL: news:6hek8e$8hs@bgtnsc02.worldnet.att.net>:
++ 
++ I am new to cgi scripting, but i am familiar with perl.  However, I have yet
++ to make it work.  I have put a script which I know works in that directory
++ (I know it works because it is straight off a tutorial site).  I have tried
++ the chmod 0755 to the file, but I continue to get the "Internal Server
++ Error: The server encountered an internal error or misconfiguration and was
++ unable to complete your request." error.  Anyone see anything that I am
++ doing wrong or things I should check on?  Please email responses.

Did you read your servers error log? Perl always gives helpful hints
on what is going wrong, and unless you've configured your server to
do otherwise, your server *will* log them.

Read the log.



Abigail
-- 
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
           print+Just (), another (), Perl (), Hacker ();'


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

Date: Mon, 20 Apr 1998 16:38:13 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: creating config file to pull into a script.
Message-Id: <Pine.A41.3.96.980420162554.29882D-100000@ginger.libs.uga.edu>

Would it help to suggest using the typical .ini file format and existing
utilities for reading the values into perl data structures?  I don't
pretend to think this is the answer to your question. It is more just food
for thought, maybe.

[TAPEVOLS]
vol=000001
vol=000002
[...]
vol=000007

[NEXTDATA]
data=blah blah blah
data=blah blah blah


On Mon, 20 Apr 1998 skruzich@stc.net wrote:
> #!/opt/perl5/bin/perl
> #include cfgfile;
> 
> Thanks
> Steve Kruzich
> 
> skruzich@stc.net
> 
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/   Now offering spam-free web-based newsreading
> 
> 
----------------
Brad Baxter, UGA



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

Date: Mon, 20 Apr 1998 16:40:44 -0600
From: nmoni@hotmail.com
Subject: DateTime manipulation
Message-Id: <6hgfct$9j7$1@nnrp1.dejanews.com>

Hi,

I need to manipulate dates and times. So I am on a look out for a reliable
module which helps to increment dates, check if it a leap year etc. Do any of
you know of any such module. I would appreciate ANY pointers I could get.
Thanks and have a great day.

Sincerely,
Anish

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Mon, 20 Apr 1998 14:14:50 -0600
From: Ken Quinn <kquinn@sk.sympatico.ca>
Subject: Re: getpwnam question
Message-Id: <353BACB9.FD236523@sk.sympatico.ca>

The chomp($username); was the problem. I do appreciate the help.
Thanks again.
Ken

Dave Barnett wrote:

> Ken Quinn wrote:
> >
> > Hi, I'm trying to use getpwnam, the following works;
> >
> > $username = "bill" ;
> > @pwdlist = getpwnam($username) ;
> > print @pwdlist ;
> > #so does;
> > $username = "bill" ;
> > $username = $a
> > @pwdlist = getpwnam($a) ;
> > print @pwdlist ;
> Are you sure???  $username = $a needs a ";" after it.
> Secondly, you set $username = $a, but then getpwnam of $a, not
> $username.  Where is $a set????
>
> > #when I pipe a username like;
> > $username  =  <> ;
> > print $username ;
> > #no problem, but when I pipe it to  getpwnam ;
> Where did your cursor end up?  At the end of the user name you typed, or
> at the start of the next line???  VERY important.  All user input from
> <> operator contains "text", and "\n" (a newline character!).  Be aware
> of it.  It is both a friend, and an infuriating oversight.  :-)
>
> Look into chomp.  (perldoc -f chomp)
>
> > $username = <> ;
> > $username =  $a
> > @pwdlist = getpwnam($a);
> > print @pwdlist ;
> >
> > It dosen't work.  I know this may be rather simple but I am having
> > trouble so I would greatly appreciate any help.
> > Thanks  Ken
> >
> >  I'm trying to pipe a username to a filter which uses getpwnam.
> Try the following:
> #!/usr/local/bin/perl -w
> #
> $username = "bill" ;
> @pwdlist = getpwnam($username) ;
> print @pwdlist ;
> #so does;
> $username = "bill" ;
> @pwdlist = getpwnam($username) ;
> print @pwdlist ;
> #when I pipe a username like;
> $username  =  <> ;
> print $username ;   ###  Still has the newline char!
> #no problem, but when I pipe it to  getpwnam ;
> $username = <> ;    ###  Again has the newline char!
> chomp($username);   ###  Remove the newline char!
> @pwdlist = getpwnam($username);  ### Now works fine.
> print @pwdlist ;
> __END__
>
> I think you will find that works much better.
>
> HTH.
>
> Dave
>
> --
> "Security through obscurity is no security at all."
>                 -comp.lang.perl.misc newsgroup posting
>
> ----------------------------------------------------------------------
> Dave Barnett                 U.S.: barnett@houston.Geco-Prakla.slb.com
> DAPD Software Support Eng    U.K.: barnett@gatwick.Geco-Prakla.slb.com
> ----------------------------------------------------------------------





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

Date: Mon, 20 Apr 1998 21:29:00 +0000
From: Jon Marshall <j.marshall@dial.pipex.com>
Subject: Re: getpwnam question
Message-Id: <353BBE1C.DACCE24C@dial.pipex.com>

Ken Quinn wrote:

> Hi, I'm trying to use getpwnam, the following works;
>
> $username = "bill" ;
> @pwdlist = getpwnam($username) ;
> print @pwdlist ;
> #so does;
> $username = "bill" ;
> $username = $a
> @pwdlist = getpwnam($a) ;
> print @pwdlist ;
> #when I pipe a username like;
> $username  =  <> ;
> print $username ;
> #no problem, but when I pipe it to  getpwnam ;
> $username = <> ;
> $username =  $a
> @pwdlist = getpwnam($a);
> print @pwdlist ;
>
> It dosen't work.  I know this may be rather simple but I am having
> trouble so I would greatly appreciate any help.
> Thanks  Ken
>
>  I'm trying to pipe a username to a filter which uses getpwnam.

      think your problem is that you are forgetting to do a chop on the
username. ie if username is
      bill getpwnam gets passed  "bill\n". Do a chop on the username and
it should work - did when
       i tried it



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

Date: 20 Apr 1998 20:55:04 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: help on some cgi stuff
Message-Id: <6hgcn8$lh5$2@client2.news.psi.net>

Aaron Drake (aarond@cutco.com) wrote on MDCXCIII September MCMXCIII in
<URL: news:aarond-2004981339070001@207.127.137.12>:
++ I have a cgi script that takes the info from a form (2 fields) and writes
++ that to a text file.  Then the script has to either look at the 1st or 7th
++ spot of the 2nd field and redirect based on what character is there. 
++ There are only 7 possible places they would be redirected to.  I know
++ almost no perl at the moment, but I do have some C/C++ experience.  If
++ someone could tell me how to make it check the specific spots in the 2nd
++ field it would be much appreciated.

Perhaps you should write it in C or C++ then.



Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Additional/s) [0]'


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

Date: 20 Apr 1998 21:38:20 GMT
From: David Fetter <dfetter@shell4.ba.best.com>
Subject: Re: Help, I'm going Perl-bald!
Message-Id: <6hgf8c$m5d$1@nntp1.ba.best.com>

msbzdragn@hotmail.com wrote:
> Heeeeeelllllppp!!!!!

> I'm going bald prematurely, and all because I've just become a newbie... ;)  I
> just started playing around with Perl and CGI for a project I am trying to do
> at work, and I'm completely baffled...

> I've got a web server (Sambar, http://www.sambar.com) running on
> Windows NT Server 4.0,
  ^^^^^^^^^^^^^^^^^^^^^
Aha!  That's your problem.  While Perl can run on Windows boxen thanks
to the Herculean efforts of many fine developers, said boxen are still
intrinsically buggy and unstable.  To make full use of your box, get
Linux, install Apache and Perl, and watch it do magic.

The easiest distribution I've found so far is Red Hat 5.0, which
installs both Apache and Perl by default.

HTH,
Dave.
-- 
            David Fetter         888 O'Farrell Street Apt E1205
   shackle@ren.glaci.com          San Francisco, CA 94109-7089 USA
  http://www.best.com/~dfetter     +1 415 567 2690 (voice)
print unpack ("u*",q+92G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R"@``+)

Now they show you how detergents take out bloodstains, a pretty
violent image there. I think if you've got a T-shirt with a bloodstain
all over it, maybe laundry isn't your biggest problem.  Maybe you
should get rid of the body before you do the wash.  
                                       Jerry Seinfeld


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

Date: 20 Apr 1998 13:11:00 -0700
From: johnh@dash.isi.edu (John Heidemann)
Subject: Re: HELP: Trying to create a search application
Message-Id: <johnh.893102603@dash.isi.edu>

"Alan McCoy" <a.r.mccoy@larc.nasa.gov> writes:
>We have several researchers here who currently have to search through
>several different formats of information, such as html documents,
>subscription-based databases, and Usenet groups.  I was told that using a
>few specific CGI/Perl libraries, I can write a collection of scripts that
>would perform parallel searches across web sites, structured databases, and
>newsgroups, using a single query form interface.
>
>...
>Is it possible to use Perl or CGI to accomplish these tasks? Here are the
>requirements in a nutshell:
>
>1. Present the user with a single query form.
>2. Perform parallel web searches across multiple engines. (e.g., Yahoo,
>Altavista, Lycos, Infoseek, etc.)
>3. Log into multiple subscription-based technical journal databases and
>perform search using query data from the form in step 1.
>4. Perform search through newsgroups using query data from the form in step
>1.
>5. Collect results from sources mentioned in steps 2 through 4.
>6. Remove duplicate results and collate into a condensed list or results
>which are presented to the user.
>
>Please let me know if this is possible.  Any help with this would be greatly
>appreciated.

Anything's possible, it's just a matter of programming.

WWW::Search (see CPAN, or
<http://www.isi.edu/lsam/tools/WWW_SEARCH/index.html>) implements a
single API (mostly) to multiple search engines, addressing your point
(2).  WWW::Search has been used to do what you're describing in
special cases (Paul Linder applied it to searching several UN
databases and merging the results.)

WWW::Search does not (unfortunately) attempt to merge the query
interfaces to the different search engines.  There is some support for
the simple, least-common denominator cases of ``search for all these
words ANDed together, or ORed together''.  A solution to the general
problem of merging all features of all query languages is non-trival.
(I guess we need Search-Engine-SQL.)

If there's someone who wants to take a shot at solving the general
problem or at improving least-common denominator support in
WWW::Search, I'd be happy to talk to them.  (Preferably on the
info-www-search mailing list.)

   -John Heidemann
    USC/ISI



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

Date: Mon, 20 Apr 1998 21:00:26 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: How do I get the name of each file in a dir?
Message-Id: <353BB5CD.403F0A32@earthling.net>

Fain wrote:

> # Tried and True...
> print `ls`;
> # works
>
> Why use a whole function for something that you can do as simply as
> that?
>
> - NAthan

 Primarily, as someone told me a while back, that would ONLY work on
POSIX-compliant systems; or those which some good hearted Perl Developer
duplicated the 'ls' functionality.  The reason opendir, readdir, and the
like are there is PORTABILITY.  Write ONCE run EVERYWHERE :-)

This has been a public service announcement for Code Portability.

:-)
__________________________
Bill Jones...............|
Sneaker's Nest...........|
Chasecreek Systemhouse...|




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

Date: Mon, 20 Apr 1998 21:19:06 GMT
From: craigs@3rdstone.net (Craig Simpson)
Subject: Re: How to create a new file?
Message-Id: <353bbb91.16509749@209.76.252.8>

On 20 Apr 1998 19:12:22 GMT, "Matthew Bell" <mbell@thedomaingroup.com>
wrote:

>I'm a Perl newbie, writing my first script on Perl for NT.  How do I create
>a new file?  Here's a snippet of my code:
>
>open(CURRFILE,$ARGV[0]) or die "\nUnable to open $ARGV[0] -- $!\n";
># opens existing file
>
># code section here that correctly defines $NewFN
>
>open(NEWFILE,$NewFN) or die "\nUnable to create $NewFN -- $!\n";
># I was expecting this would create a new file in the current directory,
>but I get a "no such file or directory" error.  I can't find any reference
>to a "file create" or a relevant "new(filename)" function.  Can someone
>help?  Thanks.
>-- 
>Matthew Bell
>MBell@TheUNSPAMDomainGroup.com
>(remove the obvious to reach me directly)]

open(FILE, ">$ARGV[0]")






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

Date: Mon, 20 Apr 1998 16:20:51 -0500
From: Jim Harrison <j_harrison1@ti.com>
Subject: Re: How to get clock ticks or calculate elapsed time less than a second
Message-Id: <353BBC32.11A54915@ti.com>



Jim Harrison wrote:

>     Is there a perl function that will return the clock ticks like the C
> function times?
>
> The perl times only returns the 4 cpu values, but neglects the ticks.
>
> Maybe there is another fuction that will let me calculate time in units
> lower than a second.

 Since posting this question I have discovered: POSIX::times() which returns
the elapsed time in ticks, as well.  I am replying to myself in case someone
else reads my question and reads the replies.



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

Date: Mon, 20 Apr 1998 20:11:07 GMT
From: craigs@3rdstone.net (Craig Simpson)
Subject: Re: htaccess & htpasswd help!!!
Message-Id: <353bab49.12341135@209.76.252.8>

On Thu, 16 Apr 1998 20:16:51 -0400, keith <keith@cca.munet.edu> wrote:

>I'm trying to use htpasswd in perl5.  I have a form that submits a user
>name, I then want to take that name and use the htpasswd
>command to add them to a user list with a password.  Has anyone ever
>tried this?  Please post or send me email asap!
>
>Thanks in advance,
>Keith
>

I have found dbmmanage is a lot better then htpasswd.

system("/usr/sbin/dbmmanage /www/secure/yourdomain/member_dbm/members
adduser $STRING{'username'} $STRING{'password'} |mail craigs\@aka");
# or just pip eto true to get rid of STDOUT



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

Date: Mon, 20 Apr 1998 17:30:01 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: HTML Tables -> Preformatted Text ?
Message-Id: <Pine.A41.3.96.980420172625.29882H-100000@ginger.libs.uga.edu>

The authors of Lynx and Charlotte would be happy to know this, too, I bet!
What happens to a table with 80 columns in it, for example.  Sorry that I
don't know the answer to your request, but I'll be listening in.

----------------
Brad Baxter, UGA

On Mon, 20 Apr 1998, Kevin Smith wrote:

> Does anyone know of a script that will convert an HTML table to 
> preformatted text?  Essentially, I need a way to generate tables 
> that will be viewed on mainframes.  It must be robust enough to 
> handle line wrapping of multiple columns to 80 characters.  It is 
> possible to open the HTML file in Netscape and save as text, but 
> there may be quite a few tables involved.
> 
> Kevin Smith
> kesmit@sas.com
> 
> 



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

Date: 20 Apr 1998 21:05:48 GMT
From: jhunterj@lexis-nexis.com (Hunter Johnson)
Subject: Re: Newbie question...
Message-Id: <6hgdbc$aej@mailgate.lexis-nexis.com>

In article <353B5677.3700BAFF@hotmail.com>,
Tim Logan  <umichfan@hotmail.com> wrote:

> I am new to Perl and am working on a script to process forms on my
> company's intranet.  I would like it to get the poster's IP address
> then use part of that to identify which facility the user is in.

> I have used $ipaddress = $ENV{'REMOTE_ADDR'} to get the IP address,
> but how do I use just x number of characters in if/elsif/else?  I
> have only been learning Perl for about 1 week and have been reading
> "Programming Perl" by O'Reilly.  I'm not asking for someone to write
> the code for me...just tell me which command(s) I should read about
> to learn how to do this.

You could do it with split(), unpack(), or the match operator (=~).
Probably easiest to go with split.

HTH,
Hunter
--
J. Hunter Johnson        | "A little consistent wholesome modeling and
jhunterj@lexis-nexis.com |   costly servanthood are worth millions of
(937) 865-6800 x5385     |    true words harshly spoken."
Lexis-Nexis, Dayton, OH  |                               -- Ron Sider


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

Date: Mon, 20 Apr 1998 20:04:34 GMT
From: craigs@3rdstone.net (Craig Simpson)
Subject: Re: newbie trying to close off a pipe
Message-Id: <353baa3c.12072459@209.76.252.8>

On Mon, 20 Apr 1998 17:26:09 +0100, David Epstein
<dbae@maths.warwick.ac.uk> wrote:

>Here is a fragment of code I'm trying to get to work
>
>open(SENDMAIL,"|/usr/lib/sendmail -t") or die etc;
>print SENDMAIL $various;
>close SENDMAIL;# BUT it refuses to close.
>
>What happens is that the close statement hangs. I assume (but don't
>know) that this is because sendmail is busy on more important business,
>and so the child created by the pipe is not returning.
>
>If I delete SENDMAIL from the close statement, then the mail gets sent
>as desired, but also all my other filehandles are closed at the same
>time.
>
>So my question is, how do I cut the child loose and say "You're on your
>own now, kid"? If I was working interactively under tcsh, I would
>suspend the
>process and background it, and hope that would work.
>
>There may be a sendmail flag which will do the job, but I'm trying to
>learn perl, not sendmail, so I would welcome a general solution, which
>would work
>with commands other than sendmail.
>
>David Epstein (welcomes answers direct to his email address because
>there
>is so much traffic on clpm that he would be likely to miss the answers).

>open(SENDMAIL,"|/usr/lib/sendmail -t") or die etc;
>print SENDMAIL $various;
>close SENDMAIL;# BUT it refuses to close.
close(SENDMAIL);


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

Date: Mon, 20 Apr 1998 16:38:02 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: newbie trying to close off a pipe
Message-Id: <353BB232.B9E111B6@coos.dartmouth.edu>

Craig Simpson wrote:
> 
> On Mon, 20 Apr 1998 17:26:09 +0100, David Epstein
> <dbae@maths.warwick.ac.uk> wrote:
> >
> > [...30 lines snipped...]
> >close SENDMAIL;# BUT it refuses to close.
> close(SENDMAIL);

Not only did you quote 30 lines of text to provide your one-line answer, but
your suggestion is completely useless.

close SENDMAIL; and close(SENDMAIL); are exactly equivalent.  Parentheses are
optional on list operators.

This might be useful, however:
close SENDMAIL or die "Unable to close pipe to sendmail: $!\n";

-- 
 _ / '  _      /         - 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: Mon, 20 Apr 1998 17:41:19 -0400
From: Brian Mathis <brianm@kodak.com>
Subject: Re: Password changing under Solaris
Message-Id: <353BC0FF.589CB8B2@kodak.com>

Bill 'Sneex' Jones wrote:
> Hmmm, I have made a WebPass system (of two programs,Perl & Expect based) which do
> what you are looking for
> under Solaris (I use them everyday on an E3000 and Ultra-1)
> 
> As far as Expect.pm goes, I am in-process of writing
> the WebPass system to only use Expect.pm for Perl instead
> of Expect/TCL...
> 
> Expect.pm and the resulting WebPass system will
> require IO::Tty, IO::STTY, Expect.pm, and Perl 5.004_4
> 
> Your question is one many others have asked, and you
> COULD perform the magic with crypt using a gyration like -
> $Salt = "$Schars[int(rand($Ssize))]$Schars[int(rand($Ssize))]";


Hmm, well, I've found a much easier way to do this (to allow users to
change their own login passwords from the web).  All you need to use is
Net::Telnet.  You get all the information from the form, such as the
username and password, then you telnet to "localhost" (or any host for
that matter), and invoke passwd.  Then you can sort of Expect things
without having to install all the extra modules that go along with
Expect.pm.

Brian Mathis


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

Date: Mon, 20 Apr 1998 16:39:22 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: perl and spaces in strings
Message-Id: <353BB282.14873156@coos.dartmouth.edu>

shmoo wrote:
> 
> Does Perl have a way of separating a string by spaces?

Yes.  The split operator.

-- 
 _ / '  _      /         - 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: 20 Apr 1998 20:55:24 GMT
From: jhass@mrc.unm.edu (Joe Hass)
Subject: Re: perl and spaces in strings
Message-Id: <6hgcns$f62$1@lynx.unm.edu>

In article <6hg6df$hca$1@lark.jmu.edu>, orebauad@jmu.edu (shmoo) writes:
|> Does Perl have a way of separating a string by spaces?

Oh dear.  Look at the `split' function.
perldoc split

Joe in-a-good-mood-for-a-Monday Hass
-- 
---------------------------------------------------------------------------
== K. Joseph Hass                ==  Microelectronics Research Center    ==
== http://www.mrc.unm.edu/~jhass ==  801 University Blvd SE, Suite 206   ==
== (505) 272-7055                ==  Albuquerque, NM 87106-4340   USA    ==


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

Date: Mon, 20 Apr 1998 21:22:45 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: perl and spaces in strings
Message-Id: <1d7snkv.p0o5b9y2ndarN@roxboro0-025.dyn.interpath.net>

Ronald J Kimball <rjk@coos.dartmouth.edu> wrote:

> shmoo wrote:
> > 
> > Does Perl have a way of separating a string by spaces?
> 
> Yes.  The split operator.

Of course that's not what shmoo is really needing (how anybody can get
started with perl and not have regular expressions in mind for problems
like this escapes me completely.

$test ="Sat Jan 31 13:26:51 1998 asxx.xxxxxx.jmu.edu kcwillia Async1";
$test ="$test async start task_id=378 service=PPP";

$answer = $1 if ($test =~ /\d\d\d\d [^ ]+ ([^ ]+)/);

print "The username is: $answer\n";

-- 
John Moreno


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

Date: Mon, 20 Apr 1998 21:00:37 +0100
From: "Tony Kenny" <tony@cyberscape.net>
Subject: Re: PERL en francais SVP
Message-Id: <6hg9hr$obl$1@svr-c-01.core.theplanet.net>

Information de perl?

 Utilisez http://altavista.digital.com  pour traduire l' information.

Perl en francais c'est Lerp n'est ce pas?


~TK

eaudet@solution123.com wrote in message <6hfh6a$tks$1@nnrp1.dejanews.com>...
>Bonjour,
>
>Vous voulez de l'information sur le language perl ... mais en francais?
>
>J'ai cree une liste de diffusion seulement pour cela :)
>http://www.solution123.com/perlqc/
>
>Eric Audet
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/   Now offering spam-free web-based newsreading




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

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

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