[10196] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3789 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 22 19:07:30 1998

Date: Tue, 22 Sep 98 16:00:22 -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           Tue, 22 Sep 1998     Volume: 8 Number: 3789

Today's topics:
    Re: any way to encrypt my script? <sauvin@osmic.com>
    Re: any way to encrypt my script? <sauvin@osmic.com>
    Re: changing $ 'variables' in regexprs (John Moreno)
    Re: changing $ 'variables' in regexprs <uri@camel.fastserv.com>
    Re: changing $ 'variables' in regexprs <jdf@pobox.com>
    Re: disable inharitance from parent (Mark-Jason Dominus)
    Re: disable inharitance from parent <zenin@bawdycaste.org>
        Help needed using LWP (Michael Budash)
    Re: Help needed using LWP <eashton@bbnplanet.com>
    Re: Hidden field??? <evonzee@tritechnet.com>
    Re: Installing Perl 5.004 <baliga@synopsys.com>
    Re: Installing Perl 5.004 (Allan M. Due)
    Re: measure memory usage <eashton@bbnplanet.com>
    Re: NT Login Script via PERL? <george.kuetemeyer@mail.tju.edu>
    Re: Perl & Java - differences and uses <jhi@alpha.hut.fi>
    Re: Perl & Java - differences and uses <eashton@bbnplanet.com>
    Re: Perl & Java - differences and uses <eashton@bbnplanet.com>
        Perl and FORTRAN namelists <sakalauk@coam.usm.edu>
    Re: problems using "use", HELP! <jhi@alpha.hut.fi>
    Re: Runtime evaluation of required modules (Larry Wall)
        shared lib compile 5.04_04 on HPUX 10.20 error wardkaatz@my-dejanews.com
    Re: Simple, efficient way of checking whether $VAR is a <doug@weboneinc.com>
    Re: Simple, efficient way of checking whether $VAR is a <uri@camel.fastserv.com>
    Re: Simple, efficient way of checking whether $VAR is a <zenin@bawdycaste.org>
    Re: sorting Unix pathnames of unequal length by filenam <jdf@pobox.com>
    Re: sorting Unix pathnames of unequal length by filenam (David A. Black)
    Re: sorting Unix pathnames of unequal length by filenam <dfan@harmonixmusic.com>
        Updating file date elektrobank@mailexcite.com
    Re: Updating file date (Michael Fuhr)
    Re: where is Date::Parse? (Ilya Zakharevich)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 22 Sep 1998 17:33:13 -0400
From: Ben Sauvin <sauvin@osmic.com>
Subject: Re: any way to encrypt my script?
Message-Id: <36081799.B01E98DD@osmic.com>

    Compilers and interpreters are both  language translators, with the
major general distinction being the time at which the computer will act
upon the translated output. A compiler's output (often called "object")
can itself easily be some intermediate form required by some interpreter
(the CPU itself being only one _form_ of interpreter) or yet another
compiler, but the only "true" compiler merely translates into *some*
form other than what it is given.

    In the "street" sense, Perl is an interpreted language in the sense
that it does not (normally) generate true machine-readable binary the
way an assembler or C compiler (usually) would. It is not necessarily
interpreted the same way QBasic on Windows machines interprets (line by
line, sequentially except on flow redirection, each line crunched anew
before execution); another example of a precompiled interpreted language
for DOS weenies would be EUPHORIA (which advertises "compilation to
machine-readable form", but actually prepends an interpreter to byte
precompile).

    Nobody who has never written or maintained a compiler, interpreter
or other computer language translator should really be commenting in
this thread.



Greg Bacon wrote:

> In article <6u3hn6$gn8$1@nnrp1.dejanews.com>,
>         bitnut1@my-dejanews.com writes:
> : True compilation produces machine readable binary executable.
>
> Please quit spewing this bullshit.
>
> Greg
> --
> I can please only one person per day.
> Today is not your day.
> Tomorrow isn't looking good either.
>     -- Dogbert



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

Date: Tue, 22 Sep 1998 18:36:36 -0400
From: Ben Sauvin <sauvin@osmic.com>
Subject: Re: any way to encrypt my script?
Message-Id: <36082674.D87D448E@osmic.com>

    Apparently, my imperfect expression could leave some considerable orders
of magnitude of void for fleets of lost or misconstrued meanings to trespass
unnoticed. To be clearer, it TAKES someone who has written one or more
language translator to realise the virtual infinity of field between the
conceptually pristine "interpreter" and the idealogically unsullied
"compiler", and how the two are far from mutually exclusive or diametrally
opposed. In other words, if you've never written a language product of any
kind, SHUT UP and learn something.


Ben Sauvin wrote:

>     Compilers and interpreters are both  language translators, with the
> major general distinction being the time at which the computer will act
> upon the translated output. A compiler's output (often called "object")
> can itself easily be some intermediate form required by some interpreter
> (the CPU itself being only one _form_ of interpreter) or yet another
> compiler, but the only "true" compiler merely translates into *some*
> form other than what it is given.
>
>     In the "street" sense, Perl is an interpreted language in the sense
> that it does not (normally) generate true machine-readable binary the
> way an assembler or C compiler (usually) would. It is not necessarily
> interpreted the same way QBasic on Windows machines interprets (line by
> line, sequentially except on flow redirection, each line crunched anew
> before execution); another example of a precompiled interpreted language
> for DOS weenies would be EUPHORIA (which advertises "compilation to
> machine-readable form", but actually prepends an interpreter to byte
> precompile).
>
>     Nobody who has never written or maintained a compiler, interpreter
> or other computer language translator should really be commenting in
> this thread.
>
> Greg Bacon wrote:
>
> > In article <6u3hn6$gn8$1@nnrp1.dejanews.com>,
> >         bitnut1@my-dejanews.com writes:
> > : True compilation produces machine readable binary executable.
> >
> > Please quit spewing this bullshit.
> >
> > Greg
> > --
> > I can please only one person per day.
> > Today is not your day.
> > Tomorrow isn't looking good either.
> >     -- Dogbert



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

Date: Tue, 22 Sep 1998 16:04:10 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: changing $ 'variables' in regexprs
Message-Id: <1dfrl6h.p9xit610mgckN@roxboro0-059.dyn.interpath.net>

David Rouse <4newsargus@mail.entrsft.com> wrote:

> I'm setting up a script to clean up (poorly) automatically generated HTML.
> I'm using this contruct:
> 
> $fileholder =~ s/<p><HR>([^-|\n]+)(-|\n)/<P><HR><B>$1<\/B>$2/g;
> 
> to find all the text starting with <p><HR> and ending with a '-' or a
> newline and put bold tags around the text. All is well, but what I really
> need to be able to do is force $1 into ALL CAPS. Sadly, this is a 'read
> only variable' and a one line command.
> 
> I'm baffled, to the point of not even knowing *how* to look for a
> solution, although I have looked through "Learning Perl" and "Programming
> Perl."

Run this and see if you can't figure it out:

$this = "that";

$this =~ s/(t)/uc $1/e;

print $this;


(again I say - this ought to be mentioned in perlre.pod and not just in
perlop.pod).

-- 
John Moreno


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

Date: 22 Sep 1998 16:21:37 -0400
From: Uri Guttman <uri@camel.fastserv.com>
To: phenix@interpath.com (John Moreno)
Subject: Re: changing $ 'variables' in regexprs
Message-Id: <sarn27rgapa.fsf@camel.fastserv.com>

>>>>> "JM" == John Moreno <phenix@interpath.com> writes:

  JM> David Rouse <4newsargus@mail.entrsft.com> wrote:
  >> I'm setting up a script to clean up (poorly) automatically
  >> generated HTML.  I'm using this contruct:
  >> 
  >> $fileholder =~ s/<p><HR>([^-|\n]+)(-|\n)/<P><HR><B>$1<\/B>$2/g;
  >> 
  >> to find all the text starting with <p><HR> and ending with a '-' or
  >> a newline and put bold tags around the text. All is well, but what
  >> I really need to be able to do is force $1 into ALL CAPS. Sadly,
  >> this is a 'read only variable' and a one line command.
  >> 
  >> I'm baffled, to the point of not even knowing *how* to look for a
  >> solution, although I have looked through "Learning Perl" and
  >> "Programming Perl."

  JM> Run this and see if you can't figure it out:

  JM> $this = "that";

  JM> $this =~ s/(t)/uc $1/e;

  JM> print $this;

it would be better to use \U, then you don't need /e.

and printing $this without a \n would make it invisible after the next
prompt was printed.

  JM> (again I say - this ought to be mentioned in perlre.pod and not
  JM> just in perlop.pod).

it is mentioned in perlre, just in the pattern replacement section. it
says it is doublequotish and \U (and the other flavors of case changing)
works.

uri

-- 
Uri Guttman                             Speed up your web server with Fast CGI!
uri@fastengines.com                                  http://www.fastengines.com


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

Date: 22 Sep 1998 22:23:20 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: 4newsargus@mail.entrsft.com (David Rouse)
Subject: Re: changing $ 'variables' in regexprs
Message-Id: <m3emt3hp6v.fsf@joshua.panix.com>

4newsargus@mail.entrsft.com (David Rouse) writes:

> All is well, but what I really need to be able to do is force $1
> into ALL CAPS.

No problem, but hold on.

> I'm baffled, to the point of not even knowing *how* to look for a
> solution, although I have looked through "Learning Perl" and
> "Programming Perl."

The specific method for searching Perl documentation differs depending 
on your platform. However, in general, you should use something like
"grep" to search through the files in the pod directory that was
created when you or your sysadmin installed perl. I happen to use
Jeffrey Friedl's "search" program, which has many groovy features and
accepts perl regexen. "search" is very helpful on those platforms
which lack grep. Tom Christiansen also has a search utility, written
in Perl. I don't know the name, off hand.

In your case, you might

  $ grep -i 'uppercase' /usr/lib/perl5/5.00502/pod/*

which would lead you to (among others) the perlfunc and perlop
documents, where you could read about the "uc" function and the "\u"
and "\U" escapes.

  $ perldoc perlfunc
  $ perldoc perlop

The \U escape (in a double-quotish context, including the substitution 
part of the s// operator) uppercases all following letters until \E or 
the end of the string.

  print "\Uuppercase \Elowercase\n";

In a regex,

  s/foo (bar) baz/\U$1/;  # turns "foo bar baz" into "BAR"

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: 22 Sep 1998 16:45:20 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: disable inharitance from parent
Message-Id: <6u9290$ip0$1@monet.op.net>

In article <6u53h5$842$1@nnrp1.dejanews.com>,  <dow.jones@home.se> wrote:
>What I'm worried about is that if the expression 'use CGI;' means that my
>program allocates memory even if I don't create a object... In that case, all
>my children will allocate the same amount of memory.. right?

Probably not.  Most modern unixes only copy the memory if one of the
processes modifies it, so the parent and child will share the memory
that is used for the code library.  It will never be copied, and so
you'll never incur a space or a time cost.

If it bothers you, the answer is to have the child do `exec'.



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

Date: 22 Sep 1998 22:34:22 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: disable inharitance from parent
Message-Id: <906503582.269054@thrush.omix.com>

Mark-Jason Dominus <mjd@op.net> wrote:
: In article <6u53h5$842$1@nnrp1.dejanews.com>,  <dow.jones@home.se> wrote:
: >What I'm worried about is that if the expression 'use CGI;' means that my
: >program allocates memory even if I don't create a object... In that case, all
: >my children will allocate the same amount of memory.. right?
:
: Probably not.  Most modern unixes only copy the memory if one of the
: processes modifies it, so the parent and child will share the memory
: that is used for the code library.  It will never be copied, and so
: you'll never incur a space or a time cost.

	Only if perl is compiled with -Dusevfork=true.  While most
	systems are working towards fork() and vfork() being the
	same call, this is not currently the default.  Many systems
	such as Solaris have known problems with vfork() which is
	why the hints file turns vfork off for them by default.

: If it bothers you, the answer is to have the child do `exec'.

	Which can likely incur more system overhead then the memory would,
	as well as being impossible or at best problematic for many uses.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Tue, 22 Sep 1998 15:20:04 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Help needed using LWP
Message-Id: <mbudash-2209981520050001@209.204.139.52>

hi all -

trying to use the lwp module to do a post to a remote server in a cgi
called from a secure (https) web form. works fine if the url specified in
not secure, but doesn't work if it's secure. can somebody tell me what i'm
doing wrong? or is it something about secure-to-secure? TIA

the code: (names changed to protect the innocent)

use LWP::UserAgent;
$ua = new LWP::UserAgent;

$req = new HTTP::Request 'POST', 'https://www.domain.com/user/cfcchttp.cfm';
$req->content_type('application/x-www-form-urlencoded');

$post_content =
"AMOUNT=$final_total&ACCOUNT=$cardnumber&EXPIRES_MO=$form_data{'20-ex_mm'}&EXPIRES_YR=$form_data{'20-ex_yy'}";

$req->content($post_content);

# send request
$res = $ua->request($req);

# check the outcome
if ($res->is_success) {
# it worked!
   $results = $res->content . "\n";
   }
else {
# it didn't work!
   $results = "Error!: $!\n";
   }

-- 
Michael Budash ~ Michael Budash Consulting
707-255-5371 ~ 707-258-7800 x7736
mbudash@sonic.net


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

Date: Tue, 22 Sep 1998 22:30:53 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Help needed using LWP
Message-Id: <360822B4.2CA2F78F@bbnplanet.com>

Michael Budash wrote:

> trying to use the lwp module to do a post to a remote server in a cgi
> called from a secure (https) web form. works fine if the url specified in
> not secure, but doesn't work if it's secure. can somebody tell me what i'm
> doing wrong? or is it something about secure-to-secure? TIA

>From the LWP Readme.

If you want to access sites using the https protocol, then you need to
install the Crypt-SSLeay modules first.  (The Net::SSLeay module is not
supported any more.)


e.

"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon."  R. Carver


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

Date: Tue, 22 Sep 1998 15:35:21 -0500
From: Eric Von Zee <evonzee@tritechnet.com>
Subject: Re: Hidden field???
Message-Id: <36080A08.1F664D72@tritechnet.com>

How true.  Yet again I fall victim to scope creep.

Chalk it up to an inquisitive mind, I guess...

brian d foy wrote:

> In article <3607EB2E.54198E6C@tritechnet.com>, Eric Von Zee <evonzee@tritechnet.com> posted:
>
> >Does HTTP authen work on an NT system?  I thought .htaccess files only applied
> >to Unix systems..
>
> it's a server thing, not an operating system thing.  definately not a
> Perl thing ;)
>

--
Best Regards,
Tritech Marketing Inc.

Eric Von Zee
Webmaster




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

Date: Tue, 22 Sep 1998 14:10:07 -0700
From: Yogish Baliga <baliga@synopsys.com>
To: ripcon@webgen.net
Subject: Re: Installing Perl 5.004
Message-Id: <3608122F.A92D0333@synopsys.com>

Him

    Go to Start-Settings-Control Panel-System.

   In that u will get environment tab...

Good Luck,
Baliga


Kyle Vealey wrote:

> Hi All! I am trying to install Perl 5.004 for win32 systems (yeah a
> newbie!!!). It told me to add c:\perl\bin to the PATH by clicking the
> environment tab. I went to "start" "settings" "control panel"
> and....guess what? NO ENVIRONMENT TAB!!! ARGH!! Am I in the wrong spot
> or something? ANY help would be great.
>
>                                 Thanx, Ripcon





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

Date: 22 Sep 1998 21:27:30 GMT
From: Allan@Due.net (Allan M. Due)
Subject: Re: Installing Perl 5.004
Message-Id: <6u94o2$df$0@206.165.146.66>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <360800B1.7972@webgen.net>, Kyle Vealey (ripcon@webgen.net) 
posted...
|Hi All! I am trying to install Perl 5.004 for win32 systems (yeah a
|newbie!!!). It told me to add c:\perl\bin to the PATH by clicking the
|environment tab. I went to "start" "settings" "control panel"
|and....guess what? NO ENVIRONMENT TAB!!! ARGH!! Am I in the wrong spot
|or something? ANY help would be great.
|
|				Thanx, Ripcon
|

I was just installing 5.004 on a friends system and was struck by that 
somewhat cryptic suggestion.  I claim no particular expertise but I have 
never seen that tab on any system I have encountered.  Perhaps it is an 
NT thing.  Anyway the simple alternative is to add c:\perl\bin to your 
path command in your autoexec.bat file.  Just fire up your favorite 
editor and have at it. 
HTH

AmD

____
Allan@Due.net

The beginning of wisdom is the definitions of terms.
- Socrates


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

Date: Tue, 22 Sep 1998 20:43:27 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: measure memory usage
Message-Id: <36080986.518EF662@bbnplanet.com>

David Cantrell wrote:

> >How do I pause a perl program?
> 
> Depends on the program.  If it is a console application, CTRL-S will
> probably do the trick.

There are many ways to do this, ^S would not be my first choice. It
really depends on the shell that the program is running in as well as
the program itself. Read the man page for your shell and possibly the
man page for your system signals.

e.

"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon."  R. Carver


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

Date: Tue, 22 Sep 1998 16:22:32 -0400
From: George Kuetemeyer <george.kuetemeyer@mail.tju.edu>
Subject: Re: NT Login Script via PERL?
Message-Id: <36080708.521638A1@mail.tju.edu>



RonBo wrote: I've compiled my LOGIN.PL into LOGIN.EXE using PERL2EXE by
Mercury

> Systems (www.demobuilder.com).  During compilation, it binds in all
> *.PM and *.DLL needed, and produces one big fat *.EXE.  The one gotcha
> introduced with PERL2EXE ver 3.01, it requires that PERLCRTL.DLL be in
> your path; for some reason it wont bind this one DLL into the EXE.
> So, I had to put this single DLL, along with the compiled EXE onto the
> NETLOGON share of my Domain Controllers.
>

Perl2Exe-compiled programs embed various .dll files in the .exe file iteself.
The .dll files are extracted to whatever directory you've defined with the
TEMP environment variable when you launch the .exe. I've been using the
'tiny' option instead, which creates all the .dll files up front, leaving a
smaller .exe program. I then place all files in a single directory with
appropriate rights. You may want to experiment with this option.



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

Date: 22 Sep 1998 22:55:46 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Perl & Java - differences and uses
Message-Id: <oee3e9judkt.fsf@alpha.hut.fi>


Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:

> > How do you think the Egyptians build their pyramids 4000 years ago?
> > Every peasant was a top notch pyramid builder?
> 
> Slaves, sadistic slave drivers, a well defined plan, a protocol and the
> belief that the pharoh was divinity incarnate. Possibly more inspiring

Why am I reminded of a certain company in Redmond?

> than any of modern programming. Then again, my boss brought in a bull
> whip the other day.

Whip I can stand, one can always dodge or grow thicker skin.
Yoke would start to sound bad.

P.S. Pity for the good story, though, that the slave thing about the
pyramids seems to be yet another (Hollywood?) myth.  The more recent
research thinks that the monuments of old Egypt were built by the
Egyptian farmers during the winter floods when the fields were under
water.  Under the watchful eyes of the pharaoh, yes, but not as slaves.

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: Tue, 22 Sep 1998 22:43:09 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <36082594.B0B8CA6B@bbnplanet.com>

Jarkko Hietaniemi wrote:

> P.S. Pity for the good story, though, that the slave thing about the
> pyramids seems to be yet another (Hollywood?) myth.  The more recent
> research thinks that the monuments of old Egypt were built by the
> Egyptian farmers during the winter floods when the fields were under
> water.  Under the watchful eyes of the pharaoh, yes, but not as slaves.

Well, hey, without the myth the movie 'the 10 Commandments' would have
lacked a certain excitement. :) And I've read some of the more recent
papers, but I am not sure I buy it. 

Personally, I think aliens built The Pyramids, Luxor, Stonehenge and The
Mayan temples. ;)

e.

"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon."  R. Carver


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

Date: Tue, 22 Sep 1998 22:54:35 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <36082842.E9859A3F@bbnplanet.com>

>explored as nauseum.

'ad nauseum'

To wit....

Multi quidem facilius se abstinent ut non utantur,
quamtemperent ut bene utantur  --=[ St. Agustine ]=--

To many, total abstinence is easier than perfect
moderation....

e.


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

Date: Tue, 22 Sep 1998 15:36:30 -0500
From: Peter Sakalaukus <sakalauk@coam.usm.edu>
Subject: Perl and FORTRAN namelists
Message-Id: <36080A4E.68BE761A@coam.usm.edu>

Strange subject line I know ...

Anyway, I am converting some cshell scripts to Perl. The scripts call
FORTRAN programs using the namelist syntax with a here document:

$path/tofortran/code/nc2asc2 << END
 &inputs
  filencin   = 'test.in'
  fileascout = 'test.out'
 &end
END

Is there anyway of coding this in Perl (so that the FORTRAN
code does not have to be changed)?

Thanks in advance ...Pete


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

Date: 22 Sep 1998 23:03:20 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: problems using "use", HELP!
Message-Id: <oeezpbrsynr.fsf@alpha.hut.fi>


Calle Dybedahl <qdtcall@esb.ericsson.se> writes:
> > It's a server at work. You know how that goes...3 years behind on
> > everything...
> 
> The current version three years ago was 5.002 (or maybe 5.003 was out
> by then, I don't quite remember).

Sep 22 1995 we were living with 5.001n.  Most people lived happily
with 5.001m, however, and good thing they were because 5.001n was very
unstable developer only version, not publicly released, and it was
only a prelude to the 5.002 beta phase which opened Nov 21 with
5.002beta1, culminating in 5.002 at Feb 29 1996.  The 5.003 came out
Jun 25 the same year.

No, I do not have this good memory.  <plug tone="shameless"/> I use my
notes, which now come with the 5.005_02 as the perlhist pod.</plug>

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: 22 Sep 1998 15:54:03 -0700
From: larry@kiev.wall.org (Larry Wall)
Subject: Re: Runtime evaluation of required modules
Message-Id: <6u99qb$h2p@kiev.wall.org>

In article <slrn70c4ti.gbv.sholden@pgrad.cs.usyd.edu.au>,
Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
>On Mon, 21 Sep 1998 09:39:58 +0100, Andy Marden <amarden@ibm.net> wrote:
>>Doesn't this imply that using require followed by import should be OK?
>
>Yes.

Note, however, that an import at runtime generally does you no good,
since the purpose of the typical import is to define symbols at compile
time.

Larry


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

Date: Tue, 22 Sep 1998 22:02:49 GMT
From: wardkaatz@my-dejanews.com
Subject: shared lib compile 5.04_04 on HPUX 10.20 error
Message-Id: <6u96q8$mrb$1@nnrp1.dejanews.com>

I have been struggling with compiling perl5.04_04 on HP-UX 10.20.  My
intention is to be able to use DBI/DBD to gain access to Informix.

I obtained gcc 2.8.1.  However, when compiling for shared libraries I get the
following error.

        gcc -b -L/usr/local/lib -o libperl.sl perl.o malloc.o gv.o toke.o
perly.o op.o regcomp.o dump.o util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o
scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o taint.o deb.o universal.o
globals.o perlio.o
/usr/ccs/bin/ld: Can't find library for -lgcc
gcc: file path prefix `/usr/local/lib/gcc-lib/-L/usr/local/lib/2.8.1/' never
used
*** Error exit code 1

Stop.

I admit I am not a C programmer of any worth, so I am at a loss as to
resolving this.  I have not seen this error in searching dejanews.  From my
search it appears that HPUX is not without it's glitches wrt perl.

Thank you,

Ward Kaatz
ward.kaatz@metrokc.gov

PS: please if not too much hassle, CC: me with any replies.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Tue, 22 Sep 1998 17:12:23 -0400
From: Douglas Clifton <doug@weboneinc.com>
Subject: Re: Simple, efficient way of checking whether $VAR is an element of set @LIST ?
Message-Id: <360812B7.D0B3E7A7@weboneinc.com>

Andy Armstrong wrote:
> 
> In article <xfkn2b4r03c.fsf@big.aa.net>, Charles Roten
> <croten@big.aa.net> writes
> >
> >Yeah, it's probably a _really_ dumb question ...  but while a subroutine
> >for such would be quite simple to write, I hate to reinvent the wheel ..
> >and I'd bet two dollars ot a donut that this is probably already done
> >_properly_, in some standard callable routine.
> >
> >I am really thinking in set-theoretic terms here.  And that's the sort
> >of test I want.
> >
> >What I'm _really_ after will look like this ...
> >
> >@LIST = keys (%hash);
> >if ( $VAR is an element of @LIST ) {
> >   do stuff ;
> >} else {
> >   scream bloody murder .. the other shoe just dropped ;
> >}
> 
> Why not just test the hash directly?
> 
> if ($hash{$var}) {
>     do stuff ;
> }

Because the original poster was looking for a way to check for the existance
of a variable in the set of *keys* for a hash, not the set of values. Try:

if (grep /^$var$/, keys %hash)  {
  do_stuff();
}
else  {
  print "bloody murder, the other shoe just dropped!\n";
}

-- 
Douglas Clifton
Unix/C/Perl/CGI/HTML Programmer
doug@weboneinc.com


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

Date: 22 Sep 1998 17:40:21 -0400
From: Uri Guttman <uri@camel.fastserv.com>
Subject: Re: Simple, efficient way of checking whether $VAR is an element of set @LIST ?
Message-Id: <sark92vg722.fsf@camel.fastserv.com>

>>>>> "DC" == Douglas Clifton <doug@weboneinc.com> writes:

  DC> Andy Armstrong wrote:
  >> 
  >> In article <xfkn2b4r03c.fsf@big.aa.net>, Charles Roten
  >> <croten@big.aa.net> writes
  >> >
  >> >What I'm _really_ after will look like this ...
  >> >
  >> >@LIST = keys (%hash);
  >> >if ( $VAR is an element of @LIST ) {
  >> >   do stuff ;
  >> >} else {
  >> >   scream bloody murder .. the other shoe just dropped ;
  >> >}

  >> 
  >> Why not just test the hash directly?
  >> 
  >> if ($hash{$var}) {
  >> do stuff ;
  >> }

what if the value was false?

  DC> Because the original poster was looking for a way to check for the
  DC> existance of a variable in the set of *keys* for a hash, not the
  DC> set of values. Try:
  DC> if (grep /^$var$/, keys %hash)  {
  DC>   do_stuff();
  DC> }
  DC> else  {
  DC>   print "bloody murder, the other shoe just dropped!\n";
  DC> }


well, you could at least give him an efficient solution like he asked.

just use exists

if ( exists( $hash{ $var } ) ) {

do stuff

}

and the previous poster's reply is valid as it is checking for the key
and not the value. but if the value was false, it would fail. that is
why exists was added.

maybe it's just me, but don't we hate it when poor solutions to FAQ's
are posted. how many out there don't know about exists? raise your
hands.

uri

-- 
Uri Guttman                             Speed up your web server with Fast CGI!
uri@fastengines.com                                  http://www.fastengines.com


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

Date: 22 Sep 1998 22:28:04 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Simple, efficient way of checking whether $VAR is an element of set @LIST ?
Message-Id: <906503204.127487@thrush.omix.com>

Douglas Clifton <doug@weboneinc.com> wrote:
: Because the original poster was looking for a way to check for the existance
: of a variable in the set of *keys* for a hash, not the set of values. Try:
:
: if (grep /^$var$/, keys %hash)  {
:   do_stuff();
: }
: else  {
:   print "bloody murder, the other shoe just dropped!\n";
: }

	This is what exists() is for:

	if (exists $hash{$var}) {
	    do_stuff();
	}
	else {
	    screem("bloody murder");
	}

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 22 Sep 1998 22:04:46 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: lynn_newton@mcg.mot.com (Lynn D. Newton)
Subject: Re: sorting Unix pathnames of unequal length by filename
Message-Id: <m3hfxzhq1t.fsf@joshua.panix.com>

lynn_newton@mcg.mot.com (Lynn D. Newton) writes:

> Has anyone written any code to sort a list of Unix pathnames by the
> final name in the path, regardless of the number of segments in the
> path, and using the rest of the path, from the beginning, as a
> secondary sort key?

Seek ye the Schwartzian Transform:

   my @sorted = 
     map { $_->[1] }
     sort { $a->[0] cmp $b->[0] || $a->[1] cmp $b->[1] }
     map { my ($name) = m(([^/]+)$); [$name, $_] }  @files;

If that code makes no sense to you, then check out

    http://www.perl.com/CPAN-local/doc/FMTEYEWTK/sort.html

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Tue, 22 Sep 1998 16:01:46 EDT
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: sorting Unix pathnames of unequal length by filename
Message-Id: <6u8vna$k60$1@earth.superlink.net>

Hello -

Zenin <zenin@bawdycaste.org> writes:

>[posted & mailed]

>Lynn D. Newton <lynn_newton@mcg.mot.com> wrote:
>: Has anyone written any code to sort a list of Unix
>: pathnames by the final name in the path, regardless of
>: the number of segments in the path, and using the rest
>: of the path, from the beginning, as a secondary sort
>: key? This could be useful in finding duplicate
>: filenames in different trees. For instance:
>	>snip<

>	This isn't the fastest code, but it will work:

>	use File::Basename;

>	my @strings = qw(
>	    /b/c/d/e/f/g/abc.c
>	    /a/b/c/abc.c
>	    /c/aab.c
>	);

>	@strings = sort {
>	    basename ($a) cmp basename ($b)
>	    or dirname ($a) cmp dirname ($b)
>	} @strings;

>	print join "\n", @strings, '';


Oh, let's go for it  :-)

@strings = map  { $_->[2] }
           sort { $a->[0] cmp $b->[0] or $a->[1] cmp $b->[1] }
           map  { [ basename($_), dirname($_), $_ ] }
                 @strings;


David Black
dblack@saturn.superlink.net


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

Date: 22 Sep 1998 16:22:43 -0400
From: Dan Schmidt <dfan@harmonixmusic.com>
To: lynn_newton@mcg.mot.com
Subject: Re: sorting Unix pathnames of unequal length by filename
Message-Id: <wklnnbyk18.fsf@turangalila.harmonixmusic.com>

[Cc'ed to the original author, per request]

lynn_newton@mcg.mot.com (Lynn D. Newton) writes:

| Has anyone written any code to sort a list of Unix
| pathnames by the final name in the path, regardless of
| the number of segments in the path, and using the rest
| of the path, from the beginning, as a secondary sort
| key? This could be useful in finding duplicate
| filenames in different trees. For instance:
| 
| /b/c/d/e/f/g/abc.c
| /a/b/c/abc.c
| /c/aab.c
| 
| would be sorted as
| 
| /c/aab.c
| /a/b/c/abc.c
| /b/c/d/e/f/g/abc.c
| 
| so that the two paths ending in abc.c would appear
| together in the output.
| 
| email response would be appreciated. Thank you.

You'll want to write a comparison function that uses the criteria you
describe.  An example program follows.  To speed it up you would want
to use the famous Schwartzian Transform or similar maneuver.

@names = qw(
            /b/c/d/e/f/g/abc.c
            /a/b/c/abc.c
            /c/aab.c
           );

sub my_compare {
  ($a_path, $a_file) = $a =~ m!(.*)/(.*)!; # first .* is greedy
  ($b_path, $b_file) = $b =~ m!(.*)/(.*)!;
  return ($a_file cmp $b_file ||      # compare the filenames
          $a_path cmp $b_path);       # or the paths, if the filenames
}                                     # are the same

@sorted_names = sort my_compare @names;

print (join ("\n", @sorted_names));

-- 
                 Dan Schmidt -> dfan@harmonixmusic.com, dfan@alum.mit.edu
Honest Bob & the                http://www2.thecia.net/users/dfan/
Factory-to-Dealer Incentives -> http://www2.thecia.net/users/dfan/hbob/
          Gamelan Galak Tika -> http://web.mit.edu/galak-tika/www/


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

Date: 22 Sep 1998 20:44:15 GMT
From: elektrobank@mailexcite.com
Subject: Updating file date
Message-Id: <elektrobank-2209981648580001@a-204-06.sp.neu.edu>

How can I update the modification date of a file on my server using perl.
I want to update it to the current day and time. Right now I have my
script delete the file and re-create it.


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

Date: Tue, 22 Sep 1998 21:47:20 GMT
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Updating file date
Message-Id: <6u95ss$174@flatland.dimensional.com>

elektrobank@mailexcite.com writes:

> How can I update the modification date of a file on my server using perl.
> I want to update it to the current day and time. Right now I have my
> script delete the file and re-create it.

Check out the perlfaq5 or perlfunc manual pages on your system or at:

    http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq5.html
    http://www.perl.com/CPAN/doc/manual/html/pod/perlfunc.html

Search for "timestamp", "modification time", or "modify time" and you
should find the answer.

-- 
Michael Fuhr
http://www.fuhr.net/~mfuhr/


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

Date: 22 Sep 1998 21:44:30 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: where is Date::Parse?
Message-Id: <6u95nu$na8$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Abigail
<abigail@fnx.com>],
who wrote in article <6u8mme$5n8$2@client3.news.psi.net>:
> Why? CPAN.pm doesn't go out to a CPAN site and check the version
> number of a module. It uses the 02packages.details.txt file.
> So can I. I don't need a module to interpret the line
> Apache                             1.22  DOUGM/mod_perl-1.15.tar.gz
> for me.

Neither do you need a lynx for HTTP or FTP connection, telnet will
do.  So what?

Ilya

P.S.  WRT your problem with bold/underline of CPAN.pm: this is left as
      an excercise to the reader.


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 3789
**************************************

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