[12207] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5807 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 27 19:07:22 1999

Date: Thu, 27 May 99 16:00:20 -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           Thu, 27 May 1999     Volume: 8 Number: 5807

Today's topics:
    Re: $var =~ s/string/pattern/i does not work... (Larry Rosler)
    Re: .htaccess file gryan@lasvegas.com
    Re: 2 questions about installing modules and talking to <jdporter@min.net>
    Re: 2 questions about installing modules and talking to (Dan Fleisher)
    Re: ANNOUNCE: perl5.005_57 released! (Ilya Zakharevich)
    Re: ASPSESSIONID, LWP, Cookies and redirects. <kmcfadden@claravista.com>
    Re: Debug works-standard DOESN'T <cassell@mail.cor.epa.gov>
        ESPN login script <cahille@math.byu.edu>
    Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe (Larry Rosler)
    Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe (Ilya Zakharevich)
    Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe <tchrist@mox.perl.com>
    Re: Hash question (Tad McClellan)
    Re: Help needed! <cassell@mail.cor.epa.gov>
        Help wanted (for hire) for small form to e-mail project <mark@bucephalus.net>
    Re: How to exec a program( system() ) in a limited time (Bob Trieger)
    Re: How to exec a program( system() ) in a limited time <tchrist@mox.perl.com>
    Re: Ineed major help creating a CGI script with PERL gryan@lasvegas.com
    Re: Ineed major help creating a CGI script with PERL <ludlow@us.ibm.com>
    Re: NT Search script <latsharj@my-deja.com>
    Re: NT Search script <cassell@mail.cor.epa.gov>
        Problem with a perl cgi script ccboone@my-deja.com
    Re: Really dumb problem <jdporter@min.net>
    Re: regexp (?{...}) bug ? (Ilya Zakharevich)
    Re: req: directional help <cassell@mail.cor.epa.gov>
        sending mail from perl script amirasulin@my-deja.com
    Re: sending mail from perl script <jdporter@min.net>
    Re: sending mail from perl script (Lee)
    Re: unexponentialize field from text file (Larry Rosler)
    Re: unexponentialize field from text file (Ilya Zakharevich)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 27 May 1999 13:53:37 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: $var =~ s/string/pattern/i does not work...
Message-Id: <MPG.11b750adec6a8042989b12@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7ik2a5$26c$1@nnrp1.deja.com> on Thu, 27 May 1999 18:18:48 
GMT, lpacania@my-deja.com <lpacania@my-deja.com> says...
> Larry I used your code and Greg's code with success! Thanks,

You're welcome.

Before going any further, please let me educate you on a few netiquette 
proprieties.

1.  You sent me a copy of this by email, which I appreciate.  You
didn't indicate it to be a copy, which I don't appreciate.  I was
in the process of responding as though it were a private letter.
See above for one way to let the receiver know.  A proper newsreader
makes this very easy to set up automatically.  This peice of crap
doesn't, I guess:

X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)

2.  You copied that to which you are responding *after* your response.  
I guess your braindead software makes that easy.  Most normal humans 
(except those playing Jeopardy) prefer questions to come before answers.

3.  You lazily quoted the entire post, instead of the relevant sections.  
This wastes time and bandwidth, and makes it hard to focus on the 
specific issues you are raising.

Now, down to business.

> I am worried though about the ARRAY declared in your code.  I have
> something like 3,000 rules.  Is there a better way to do this?

 ...

> > my @rules = (
> >     q{s/(a)uto(?!motive)/$1utomotive/gi},
> >     q{s/(d)lr/$1ealers/gi},
> > );
> > @rules = map { eval "sub { $_ }" or die "'$_': $@\n" } @rules;

    open RULES, $rules_file or die "Can't open '$rules_file'. $!\n";
    @rules = map { eval "sub { $_ }" or die "$_$@\n" } <RULES>;
    close RULES;

$rules_file contains:

s/(a)uto(?!motive)/$1utomotive/gi
s/(d)lr/$1ealers/gi
 ...

If *every* rule has features in common, you can simplify the file:

(a)uto(?!motive)	$1utomotive
(d)lr	$1ealers
 ...

    @rules = map {
                 my ($left, $right) = split /[\t\n]/;
                 eval "sub { s/$left/$right/gi }"
                    or die "s/$left/$right/gi: $@\n";
                 } <RULES>;


Or even more elaborate games, to do that auto-capitalizing trick, for 
example:

auto(?!motive)	automotive
dlr	dealers
 ...

   @rules = map {
                 my ($left, $right) = split;
                 $left  =~ s/(.)(.*)/($1)$2/;
                 $right =~ s/.(.*)/\$1$1/;
                 eval "sub { s/$left/$right/gi }"
                     or die "s/$left/$right/gi: $@\n";
                } <RULES>;


Essentially, you trade complexity in the mapping function against 
simplicity in the rules file.  The balance is up to you.

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


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

Date: Thu, 27 May 1999 20:46:11 GMT
From: gryan@lasvegas.com
Subject: Re: .htaccess file
Message-Id: <7ikauj$8ut$1@nnrp1.deja.com>

Ouch.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 27 May 1999 21:38:52 GMT
From: John Porter <jdporter@min.net>
Subject: Re: 2 questions about installing modules and talking to MS SQL Server
Message-Id: <7ike1c$b79$1@nnrp1.deja.com>

In article <374d76fd.268194843@netnews.upenn.edu>,
  danielfl@seas.upenn.edu (Dan Fleisher) wrote:
> This first question is dumb and has probably been asked before but I
> spent a couple hours looking through all the modules documentation and
> I couldn't find an answer anywhere.

Then you obviously didn't read perlfaq8.  See the section titled
"How do I install a CPAN module?" and following.

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 27 May 1999 22:05:50 GMT
From: danielfl@seas.upenn.edu (Dan Fleisher)
Subject: Re: 2 questions about installing modules and talking to MS SQL Server
Message-Id: <374dc135.287194714@netnews.upenn.edu>

On Thu, 27 May 1999 21:38:52 GMT, John Porter <jdporter@min.net>
wrote:


>Then you obviously didn't read perlfaq8.  See the section titled
>"How do I install a CPAN module?" and following.
>

Yeah, I saw that, must have missed it the first time I looked over the
FAQ.  Anyways, I built FreeTDS and installed it with no problems but
it doesn't work, I think because of the alignment problems running on
an alpha and also it expects the size of a long to be 4 bytes not 8
bytes.  Has anyone gotten it to work on a DG/UX 4.0 machine?  As far
as I can tell there are no MS SQL ODBC or Sybase drivers for DG/UX 4.0
so FreeTDS seems like the only way to go.

- Dan



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

Date: 27 May 1999 21:57:36 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: ANNOUNCE: perl5.005_57 released!
Message-Id: <7ikf4g$dma$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Steffen Beyer 
<sb@engelschall.com>],
who wrote in article <7ijbnl$6d8$1@solti3.sdm.de>:
> >     Incompatible Changes
> >       Perl Source Incompatibilities
> 
> > 	None known at this time.
> 
> What a white lie! :-)
> 
> One example: the reference count of self-referential ties is not incremented
> anymore since 5.005_03 (it did so with 5.005_02), the same applies to the
> 5.005_5* series.

Feel free to fix this by using the new weakref stuff.  Patches are
most welcome!

Ilya


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

Date: Thu, 27 May 1999 21:01:44 GMT
From: Kevin <kmcfadden@claravista.com>
Subject: Re: ASPSESSIONID, LWP, Cookies and redirects.
Message-Id: <7ikbrm$9i0$1@nnrp1.deja.com>



> Also, the page after the login ends up redirecting, and for this
> I get a 302 Object Moved error.  This seems to be a problem
> regardless...

Just found a dejanews entry that mentioned how to handle redirects, but
the documentation does seem to state that it will automagically handle
them...  Still need to figure out this ASPSESSIONID stuff...

# Code to handle redirects.
#
if ($response->code == 302)
  {
    $next_url = $response->header("Location");

    while ($next_url)
      {
        # Yes, $ROOT_URL should just be grabbed from the header...
        #
        $request = new HTTP::Request('GET', "${ROOT_URL}/$next_url");

        $response = $ua->simple_request($request);

        if ($response->code == 302)
          {
            $next_url = $response->header("Location");
          }
        else
          {
            $next_url = "";
          }
      }
  }



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 27 May 1999 15:21:01 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Debug works-standard DOESN'T
Message-Id: <374DC54D.DD93C0A2@mail.cor.epa.gov>

kgentes@gentek.net wrote:
> 
> Hey!  I figured it out!
> 
> Activestate Perl wants me to reference
> OLE as "use OLE", where the standard
> distribution wants me to to this "use Win32::OLE".
> Still use the
> 
>   "use Win32::OLE::Const 'Microsoft Excel';"
> 
> but make all other references to "Win32::OLE"
> (in this program) instead use "OLE" only.
> AGAIN this is only for ActiveState Perl.
> 
> That change fixes the problem.
> 
> Weird...

I'll say.  ActiveState in its own docs tells you that
while *old* versions used 'use OLE', new versions
want 'use Win32::OLE'.  Is it possible that you're
not using as new a version of ActiveState Perl as
you think?  What do you get when you type 'perl -v'
at a command prompt?

Alternatively, it could be that an old version has
left something lying around which is mucking things up.
The listserv win32-perl-users (which you can subscribe to
at the www.activestate.com website) might be able to
help you there.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 27 May 1999 16:20:47 -0600
From: Earl Cahill <cahille@math.byu.edu>
Subject: ESPN login script
Message-Id: <374DC53F.6AC3F9CF@math.byu.edu>

I want to be able to simulate a login (in Perl) to ESPN, specifically
the page at

http://games.espn.go.com/cgi/bbc/request.dll?FRONTPAGE

I don't know if the password and username are passed through a url, or
really how to do it at all.  Any help would be appreciated.

Thanks
Earl



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

Date: Thu, 27 May 1999 14:23:11 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <MPG.11b7579d50f37b1f989b14@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7ik98j$a2g$1@mathserv.mps.ohio-state.edu> on 27 May 1999 
20:17:23 GMT, Ilya Zakharevich <ilya@math.ohio-state.edu> says...
 ...
> Of course it is (for a couple of days already: was!) a bug.

Does that mean that the similar bug (failure to evaluate elements of a 
list completely):

  my ($x, $y) = ($i, $i++);

is fixed too?  Great!

>                                                             But what
> I meant is that the amount of bugs/misfeatures in Perl makes it
> *undocumentable* in any practical sense.

The language specification documents what the language is defined to be.  
If an implementation doesn't do that, that implementation documents it 
as a bug.  Of course, it may take hundreds of hours of deliberation to 
decide such issues.  That's what standards committees do.

Perl could really benefit from a careful language specification.  That 
includes built-in functions and standard modules, too.

 ...

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


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

Date: 27 May 1999 21:55:46 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <7ikf12$dl1$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Larry Rosler
<lr@hpl.hp.com>],
who wrote in article <MPG.11b7579d50f37b1f989b14@nntp.hpl.hp.com>:
> > Of course it is (for a couple of days already: was!) a bug.
> 
> Does that mean that the similar bug (failure to evaluate elements of a 
> list completely):
> 
>   my ($x, $y) = ($i, $i++);
> 
> is fixed too?  Great!

Sorry, I see no slightest similarity.

> Perl could really benefit from a careful language specification.  That 
> includes built-in functions and standard modules, too.

I see no point in formalizing the current mish-mash.  What I see a
point in is 

      a) design pragmas which simplify API a lot (no dwim);
      b) specify the subset of the language carved out by the above pragmas.

Ilya


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

Date: 27 May 1999 16:18:28 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <374dc4b4@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
:I see no point in formalizing the current mish-mash.  What I see a
:point in is 
:
:      a) design pragmas which simplify API a lot (no dwim);

That is not what Perl is.  Please write yourself your own language.
For the umpteenth time, I post something that you continue to fail
to process.

    What seems to have been lost over the years [...] is the common
    understanding of what the design center of the language is.
    While it is clear that the original design center as enunciated by
    [its creator] is no longer sufficient to guide the development of
    the language, there has been no discussion of a replacement for that
    design center.  Indeed, it is not at all clear that the current
    community of users is even in agreement about what the language
    ought to be capable of doing and, perhaps more important, what it
    should not attempt to do.

    The lack of a clearly articulated, generally accepted design center
    for the language has resulted in a lack of a set of principles that
    can be used to judge the direction of language change.  The danger
    is that the language will attempt to become something that does
    everything, with the result that it will do nothing well.

    In his book _Wonderful_Life_, Stephen Gould argues that one should
    not confuse biological evolution with progress.  The forces that
    shape the survival of one species over another, Gould points out,
    are far more random than what is required to allow one to claim
    that species for recently evolved are in any way more advanced or
    superior to those from which they evolved.

    Without a clear design center than can be used to determine a notion
    of progress in the evolution of a language, the changes that have
    been made [...] take on many of the aspects of biological evolution.
    The language has been used able to adapt itself to the changing
    environment of the increasing number of users.  But with no goal
    for the language, the evolution of the language can only be seen as
    change, not progress towards that goal.

What this means in relation to you, Ilya, is that you demonstrably lack
either an understanding or a respect for Perl's design center.  I don't
know which it is.  It only matters to the extend that ignorance I can
cure, but willful disrespect I cannot.

Perl is supposed to be DWIM.  You cannot remove that and still have Perl.
Face it Ilya, you hate Perl.  You will never succeed in castrating Perl.
You will not be happy until you do.  Therefore, you will never be happy.
Please go write your language.  PLEASE.

--tom
-- 
    Some are born to perl, some achieve perl, and some have perl
    thrust upon them.  


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

Date: Thu, 27 May 1999 12:13:15 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Hash question
Message-Id: <ruqji7.oio.ln@magna.metronet.com>

LorainCounty.com Webmaster (webmaster@loraincounty.com) wrote:

:     I have the following hash table.  The left side is the title of the
: section and the right side is the directory each section is in.

: Here is my question:  Is there a way I can find out the which title
: matches the directory.

: I know I could alter my hash table but in another place I now "What's
: New" and need to find new.

   So keep 2 "parallel yet reversed" hashes.


: Sorry if this is a little confusing I am new to hashes and haven't found
: the answer in the FAQ's.


   Oh really?

   Perl FAQ, part 4:

      "How do I look up a hash element by value?"


   I fail to see how a word search for "hash" would fail to turn
   that up.

   I don't believe you.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 27 May 1999 14:13:34 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: hannibal josh <hannibal59@hotmail.com>
Subject: Re: Help needed!
Message-Id: <374DB57E.32A484AE@mail.cor.epa.gov>

hannibal josh wrote:
> 
> I learned one thing today...i have to read more,
> learn perl better,because one answer leads to more
> questions,now i tried script with
> use strict;
> use diagnostics;
> and it found error allmost every line,

Yes, that is not all that uncommon for a beginner who first uses
these features.  Especially if you use code based on bad books,
which abuse some of the features -w and 'strict' warn you
about.

Being able to use variables without declaring them or
initializing their values is really convenient in some tiny 
programs which are not going to be used for anything much.
But as soon as you write that quick one-liner and misspell
the variable name, you'll wonder what went wrong...  And 
when you finally figure it out you'll wish you had used that
-w flag.  If I had a dollar for every time I've mis-typed
$file...

> so now i checking it line by line,and trying to understand
> problem...but i have a time and i will..so some day maybe
> i can help somebody here,in this wonderfull perl-community!
> There is great peoples out there,
> Thank you!

You're welcome

> **** Posted from RemarQ - http://www.remarq.com - Arguments 
Start Here (altered-slogan-not-tm) ****
 
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 27 May 1999 17:41:54 -0400
From: "Mark" <mark@bucephalus.net>
Subject: Help wanted (for hire) for small form to e-mail project
Message-Id: <374dbb06@news1.us.ibm.net>

HELP WANTED for small form to e-mail project

All .htm and .txt files referenced herein, which are the basis of the work
needed, reside at www.marienfeld.com

After successfully completing owner_info.htm, the visitor should be placed
in property_info.htm which can be completed one or more times before
selecting Finished!, which will then place visitor in thanks.htm. Both
owner_info.htm &  property_info.htm should have custom error handling files
(i.e., if required field not filled go to custom .htm file to show user)

The results of these forms should be formatted as follows:

A. one human-readable text-formatted e-mail (example file longdata.txt) to
address of my choice with attachment (sqldata.txt, no example at this time)
of properly formatted text file for import into SQL DB, e.g.

B. short text message (example file shortdata.txt) to be e-mailed to my
pager.

Included in the job price should be all rights to use of copyrighted code
(if any).

Lastly, any design suggestions are welcome. I am a one man office and
sometimes try to wear too many hats. I do want to keep the site frameless
and clean (unlike my current site, http://www.marienfeld.com/  )


regards, MCE





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

Date: Thu, 27 May 1999 22:53:03 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: How to exec a program( system() ) in a limited time?
Message-Id: <7ikgqa$iac$1@holly.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
"Eric Yu" <ericyu@infor.eu.org> wrote:
>I want to use system() call to exec a program, but I want it stop(be killed)
>after 1 hour, how can I do it? The second problem is that I made a menu for
>user and wait for their <STDIN>. How can I automatically exit the program if
>they didn't type anything after 10 minutes?

Just fork a child to run the system command and if it ain't done in a 
certain amount of time, ya kill it.



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

Date: 27 May 1999 16:50:49 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to exec a program( system() ) in a limited time?
Message-Id: <374dcc49@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "Eric Yu" <ericyu@infor.eu.org> writes:
:I want to use system() call to exec a program, but I want it stop(be killed)
:after 1 hour, how can I do it? The second problem is that I made a menu for
:user and wait for their <STDIN>. How can I automatically exit the program if
:they didn't type anything after 10 minutes?

This is answered in the standard documentation that comes with Perl and
resides on your system.  Have a nice grep.

--tom
-- 
"For where God buildt a church there the devil would build a chapel...
	The devil is ever God's ape."
				- Martin Luther


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

Date: Thu, 27 May 1999 20:48:30 GMT
From: gryan@lasvegas.com
Subject: Re: Ineed major help creating a CGI script with PERL
Message-Id: <7ikb2t$90g$1@nnrp1.deja.com>

Try starting here:
http://worldwidemart.com/scripts/


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 27 May 1999 16:58:20 -0500
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Ineed major help creating a CGI script with PERL
Message-Id: <374DBFFC.F9B400AE@us.ibm.com>

dream69 wrote:
 
> How do I make a script in the first place? Please help me. I have the Corel
> Script editor version 7.467 but I have no Idea on how to make a script to be
> able to create amailing robot for my Web page orderform. Please be gentle
> and tell me step by step. I need some guidance in this field. I also need a
> little dialogue box so that every member has a username and password to
> enter to my site. My Html form looks like this:

I realize that when you're starting out, it can be pretty overwhelming. 
Slow down, and take it in steps.  As of yet, you really don't have any
Perl questions, so this group probably isn't the best place to be asking
for help.

If purchasing a book isn't a problem, you might want to check out "How
to Set Up and Maintain a Website" by Lincoln Stein (ISBN: 0201634627). 
He also wrote CGI.pm which is the module that you should eventually use
for your interactive website.

If you really need the amount of hand holding that you're asking for,
perhaps it's time to hire someone to either (a) write it for you, or (b)
teach you to do it.  Other than that, there's plenty of free
documentation on Perl, HTML, CGI, etc. on the web.  Go to your search
engine of choice and start reading.

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: Thu, 27 May 1999 21:10:11 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: NT Search script
Message-Id: <7ikcbh$9v6$1@nnrp1.deja.com>

In article <374D8E0E.272788BB@uswest.com>,
  Christopher Wittry <cwittry@uswest.com> wrote:
> Hello All!  I am in need of a script that can traverse through Windows
> NT's directory structure (starting at a base directory of c:\) and do
a
> search of ALL of the subdirectories for a user defined file name or
file

Look at File::Find.
--
Regards,
Dick


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 27 May 1999 15:29:50 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: NT Search script
Message-Id: <374DC75E.1C17A6F9@mail.cor.epa.gov>

Christopher Wittry wrote:
> 
> Hello All!  I am in need of a script that can traverse through Windows
> NT's directory structure (starting at a base directory of c:\) and do a
> search of ALL of the subdirectories for a user defined file name or file
> type.  Any help in locating such a script would be greatly appreciated.
> If need be, I will write such a script, but I could definately use some
> help with it.  Thanks!

It's already written for you.  It's the File::Find module,
which you should already have on your system (or else you should
consider upgrading your version of Perl).  Its docs come with
it, and have examples that will get you going.
 
> [big wads of yucky stuff omitted - are you obligated by
   US West to post these things in a text medium like
   Usenet, as well as in your e-mail?]

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 27 May 1999 21:34:45 GMT
From: ccboone@my-deja.com
Subject: Problem with a perl cgi script
Message-Id: <7ikdpl$b4j$1@nnrp1.deja.com>

I have a perl cgi script that contacts another host via network and
gets information.  But when I upgraded to Solaris 7 it stopped
working.  I am pretty sure that it is a change in the networking
structure of Solaris 7, but it it is in the pack function that I see a
difference.

I decided to just print out what was being returned by gethostbyname
(host)

Here is what I got for the address " Keep in mind I just used print"

machine that works returned: if

machine that does not work returned: f

this happens on 2.6 also but not on 2.5.1

I would appreciate any suggestions.


Thanks

Charles Boone
Indiana State University


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 27 May 1999 21:59:31 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Really dumb problem
Message-Id: <7ikf81$c3f$1@nnrp1.deja.com>

In article <_Uh33.152$m4.1060@nntp1>,
  Jared Hecker <jhecker@iago.nac.net> wrote:
> I think I'm just a little tired today.

That must explain the off-topic posting.


> Is there any reason I can't run
> perl scripts in background in a Korn shell on a Sparc?

No.


> perlscrip1 &
> wait
> perlscript2 &
> wait
> perlscript3
>
> When I run the shell script it appears to ignore the 'wait' commands
and
> races through to the last perl script.

I dunno, man, it works for me.
Are you sure your script is ksh, not sh?
If so, try setting -m (aka -o monitor), e.g.
#!/usr/bin/ksh -m
But I'm not sure this will help, since I didn't need it on my system.


> I need to run the scripts serially;

Then why not run them in the foreground?
They'll get higher priority by default too.


> I suppose I could issue a system call from one
> script to the next or demodularize and make them all subroutines
called
> from a master

Sounds like a good idea to me.


> a la C

What?  You mean "a la Perl".


> but I don't understand why this shouldn't work!

You might try asking in a korn shell group.

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 27 May 1999 21:33:52 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: regexp (?{...}) bug ?
Message-Id: <7ikdo0$cnm$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Marian Kelc 
<marian.kelc@ruhr-uni-bochum.de>],
who wrote in article <374D0057.FE36E6FD@ruhr-uni-bochum.de>:
> Hi folks,
> this is my question:
> assume $a= "23 3434 45 32 2132 2332 4";
> when I now do the following:
> 
> 1 while $a=~/(\d+)(?{print "$1 "})/g;
> 
> it prints out only
> 
>  3434 45 32 2132 2332 4
> 
> without the leading 23. So, backreferences of this kind ($1,$2...) dont
> work with (?{...})
> correctly? Who can help me? (I'm using perl 5.005_2)

As of 5.005_57 the implementation of (?{}) is pretty complete (except
for lexicals in run-time RExen :-().  Before 5.005_54 (or so) what
(?{}) saw of $digit was the result of the *previous* match.

Ilya


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

Date: Thu, 27 May 1999 14:04:54 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: req: directional help
Message-Id: <374DB376.756A5E3@mail.cor.epa.gov>

Bastiaan S van den Berg wrote:
> 
> yeah!!!!!!!
> 
> it now works fine!!! but when you posted it , i was sure it was offline..
> 
> tnx anyways!
> buZz
> 
> >I just checked, and it's up.  Maybe it's my karma.  :-)
> >
> >You did try this URL with no typos, right?
> >
> >http://www.perlmonth.com/articles//rtfm.html
> >
> >That's a double-slash after 'articles'.

You're welcome.  Even if you have a tendency not to attribute
quotes, as is standard in Usenet.

Actually, this is a test designed to see if you are really
serious about learning Perl.  The webpage parses out your
HTTP_REFERER and stores information about you in a database,
and then makes sure that you have tried at least two previous
times before letting you in.  If you are that determined,
then you have one of the requirements to become a decent
programmer.  If you read the entire article without getting
sidetracked by the nude pictures of Pamela Anderson, then
you have a second requirement.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 27 May 1999 21:10:08 GMT
From: amirasulin@my-deja.com
Subject: sending mail from perl script
Message-Id: <7ikcbd$9v5$1@nnrp1.deja.com>

Hi,

I'm new to perl and having troubles with the
following script:

#!/usr/bin/perl

open(SENDMAIL,"|/usr/lib/sendmail -oi -t -odq") or
die "Can't fork for sendmail: $!\n";
	print SENDMAIL <<"EOF";
	From: Amir Asulin <asulin\@mail.com>
	To: Johnny Walker <jwalk\@mail.com>
	Subject: Load Test

	test
EOF
close (SENDMAIL) or warn "sendmail didn't close
nicely";

the from and to mail addresses are valid

I get the following error:
No recipient addresses found in header

Does anyone see the problem ?

Tia,
Amir Asulin


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Thu, 27 May 1999 21:25:30 GMT
From: John Porter <jdporter@min.net>
Subject: Re: sending mail from perl script
Message-Id: <7ikd87$ao7$1@nnrp1.deja.com>

In article <7ikcbd$9v5$1@nnrp1.deja.com>,
  amirasulin@my-deja.com wrote:
>
> I'm new to perl and having troubles with the
> following script:
> open(SENDMAIL,"|/usr/lib/sendmail -oi -t -odq") or
> I get the following error:
> No recipient addresses found in header
> Does anyone see the problem ?

That's not a Perl question.

However, my Perl answer is: use Net::SMTP to send mail.

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 27 May 1999 17:57:19 -0500
From: rlb@intrinsix.ca (Lee)
Subject: Re: sending mail from perl script
Message-Id: <B37337FF96687536E@204.112.166.88>

In article <7ikcbd$9v5$1@nnrp1.deja.com>,
amirasulin@my-deja.com wrote:

>Hi,
>
>I'm new to perl and having troubles with the
>following script:
>
>#!/usr/bin/perl
>
>open(SENDMAIL,"|/usr/lib/sendmail -oi -t -odq") or
>die "Can't fork for sendmail: $!\n";
>	print SENDMAIL <<"EOF";
>	From: Amir Asulin <asulin\@mail.com>
>	To: Johnny Walker <jwalk\@mail.com>
>	Subject: Load Test
>
>	test
>EOF
>close (SENDMAIL) or warn "sendmail didn't close
>nicely";
>
>the from and to mail addresses are valid
>
>I get the following error:
>No recipient addresses found in header
>
>Does anyone see the problem ?

The string you send to sendmail begins each line with blanks or tabs, so
sendmail doesn't know how to interpret the headers.

Lee




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

Date: Thu, 27 May 1999 14:14:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: unexponentialize field from text file
Message-Id: <MPG.11b7559c2f7c3efa989b13@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7ik9gh$a7h$1@mathserv.mps.ohio-state.edu> on 27 May 1999 
20:21:37 GMT, Ilya Zakharevich <ilya@math.ohio-state.edu> says...
> [A complimentary Cc of this posting was sent to Larry Rosler
> <lr@hpl.hp.com>],
 ...
> > Well, not really.  Where is 'here'?
> 
> EMX perl.
> 
> > 
> > I checked this code on perl 5.002, 5.003, 5.004_03 and 5.005_03
> 
> It has nothing to do with the Perl version.  Num->str conversion is
> done by C RTL, so Perl will do the same C does.  AFAIK, vendors are
> free to use 'e'-format for values below 0.1 (I got one message to the
> contrary, so maybe the previous statement is not *that* correct ;-).

Vendors are free to do as they wish, but not if their software is touted 
as standards-compliant.

g,G ...  The style used depends on the value converted; style e (or E)
    will be used only if the exponent resulting from such a conversion
    is less than -4 or greater than or equal to the precision.  ...

That kind of explicit predictability is what standards are for.  Too bad 
Perl doesn't have one.  <Ducking, but this is relevant to your post 
today in another thread (Re: FAQ 4.16...).>

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


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

Date: 27 May 1999 21:52:28 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: unexponentialize field from text file
Message-Id: <7ikeqs$dha$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Larry Rosler
<lr@hpl.hp.com>],
who wrote in article <MPG.11b7559c2f7c3efa989b13@nntp.hpl.hp.com>:
> > It has nothing to do with the Perl version.  Num->str conversion is
> > done by C RTL, so Perl will do the same C does.  AFAIK, vendors are
> > free to use 'e'-format for values below 0.1 (I got one message to the
> > contrary, so maybe the previous statement is not *that* correct ;-).
> 
> Vendors are free to do as they wish, but not if their software is touted 
> as standards-compliant.
> 
> g,G ...  The style used depends on the value converted; style e (or E)
>     will be used only if the exponent resulting from such a conversion
>     is less than -4 or greater than or equal to the precision.  ...

Who told you that Perl uses sprintf()?  It may, and it may not:

  perl -V:d_Gconvert
  d_Gconvert='gconvert((x),(n),(t),(b))';

Ilya


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

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

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