[10736] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4334 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 1 17:07:30 1998

Date: Tue, 1 Dec 98 14:00:32 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 1 Dec 1998     Volume: 8 Number: 4334

Today's topics:
    Re: Associative Arrays? ptimmins@netserv.unmc.edu
    Re: Batch Mailing (Martien Verbruggen)
        bug? <jas@pdc.kth.se>
    Re: bug? (Martien Verbruggen)
    Re: Can I force Perl to run C Shell (or tcsh) ?CGI? (Tad McClellan)
    Re: Can I force Perl to run C Shell (or tcsh) ?CGI? (Martien Verbruggen)
    Re: Can I force Perl to run C Shell (or tcsh) ?CGI? (Mark-Jason Dominus)
    Re: Can I force Perl to run C Shell (or tcsh) ?CGI? (Andrew M. Langmead)
        Cannot build DB_File (more of a C question) (Vicki Brown)
    Re: cgi script with path_info problem, some help needed (Martien Verbruggen)
        die() message available at END time? chess@watson.ibm.com
    Re: die() message available at END time? (Matthew Bafford)
        environment variables <speier.guy@cnf.com>
    Re: environment variables <jc@eddie.mit.edu>
    Re: environment variables (Martien Verbruggen)
    Re: Filter to sort incoming mail? (Martien Verbruggen)
    Re: Help - cgi button to call browser's email program <dales@enhanced-performance.com>
    Re: How to remove characters from HTTP_REFERER? (Martien Verbruggen)
    Re: ICQ online pager (Martien Verbruggen)
        interface to IBM's MQ Series (Paul A. Palmer)
    Re: localtime () - perl's  bug ? (Larry Rosler)
    Re: localtime () - perl's  bug ? <ljz@asfast.com>
        Logging module with flock() ? (Bryan Miller)
        Memory in Perl <jmp35@cornell.edu>
    Re: memory leak <ebohlman@netcom.com>
    Re: Need 5.003 source code for UNIX <merlyn@stonehenge.com>
    Re: NO DOC NOWHERE!! (Was: emulating sed's "/start/,/st (Matthew Bafford)
    Re: Perl and Y2K (Tad McClellan)
        Perl binary manipulation <kworm@sofnet.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 01 Dec 1998 20:06:13 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: Associative Arrays?
Message-Id: <741i78$b8$1@nnrp1.dejanews.com>

In article <3664154D.490281B9@eccms1.dearborn.ford.com>,
  Ashwini Nagaraj <anagaraj@eccms1.dearborn.ford.com> wrote:

> Hi,
> I am creating a report which is getting data from an Oracle Db.  So, I
> am using DBI.  The situation is, the fields to be seen are Server,
> metric, value.  Metric fld contains Messg Delivered, Messg Received,
> Messg Delivery time, etc in the table.  I have to do a min, max, avg for
> values for all these metrics.  The report format should contain all
> these details in order of servers.
> I have done seperate queries for diff metrics & stored in diff arrays.
> How can I use Associative arrays to solve the problem? If there is a
> different way of solving this, please let me know.

>From the way it sounds, the key field that identifies the row returned
is *not* what you want for a key field in your structure, since you
will have multiple rows of info for each message. So It is the message
id field you will want to use in your data structure (I think ... from
the way it sounds :) to link all of the associated data together. Assuming
you call the sub with each row returned from DBI ... eg:

while ( condition ) {
    ... DBI stuff ...
    @row_ary = $sth->fetchrow_array;
    load_data(@row_ary);
}

sub load_data {
    my ($unused_key, $msg_id, $srvr_id, $metric, $value) = @_;
    $server{$srvr_id}{message}{$msg_id}{$metric} = $value;
}

This would be much easier if we could actually see your real data
structure, but maybe this will be enough to get you started. perldoc
perldsc documentation should help as well.

Hope that helps

Patrick Timmins
$monger{Omaha}[0]

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


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

Date: Tue, 01 Dec 1998 21:11:12 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Batch Mailing
Message-Id: <QXY82.12$Fn3.56@nsw.nnrp.telstra.net>

In article <01be1d19$ab1ac9c0$f0aed083@zuriw14956>,
	"Merrill Lynch" <anybody@ml.com> writes:

> To the network and mail deamons among you.

They don't live on clp.misc. They live in newsgroups that have 'mail'
somewhere in their name. I suggest you go there and ask again.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd.       | cynical. It's perfectly easy to be
NSW, Australia                      | cynical.


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

Date: 01 Dec 1998 20:38:23 +0100
From: Simon Josefsson <jas@pdc.kth.se>
Subject: bug?
Message-Id: <iluhfvfzm8g.fsf@xiphias.pdc.kth.se>

This works on Solaris, but not on IBM AIX 4.2. Is this a known bug?

$ perl -e 'printf "%f", NaN;'
panic: frexp at -e line 1.
$ perl -v

This is perl, version 5.004_04 built for aix
 ...


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

Date: Tue, 01 Dec 1998 21:41:54 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: bug?
Message-Id: <CoZ82.19$Fn3.56@nsw.nnrp.telstra.net>

In article <iluhfvfzm8g.fsf@xiphias.pdc.kth.se>,
	Simon Josefsson <jas@pdc.kth.se> writes:
> This works on Solaris, but not on IBM AIX 4.2. Is this a known bug?
> 
> $ perl -e 'printf "%f", NaN;'
> panic: frexp at -e line 1.
> $ perl -v
> 
> This is perl, version 5.004_04 built for aix
> ...

I suppose that it's a different implementation of sprintf in the
standard libraries of the compiler  or the platform you used. Perl
just calls those.

To test: write a small C program that does the same. Compile on both
platforms and see what that does.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The gene pool could use a little
Commercial Dynamics Pty. Ltd.       | chlorine.
NSW, Australia                      | 


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

Date: Tue, 1 Dec 1998 14:47:42 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Can I force Perl to run C Shell (or tcsh) ?CGI?
Message-Id: <elk147.am6.ln@flash.net>

William Tang (wtang@flash.net) wrote:

: Another question is I found that Perl CGI program will lose some
: environment variables, like $LD_LIBRARY_PATH (on SunOS), I can see it from
: Perl script, but when I put it into CGI program, the $ENV{LD_LIBRARY_PATH}
: is undefined, I must define it manually. Is it true that some of the
: environment variables will be undefined in CGI program?


   Yes, when your CGI is running in a different environment (as
   set up by the http server) you are in, ...well, a different
   environment  ;-)


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


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

Date: Tue, 01 Dec 1998 21:28:17 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Can I force Perl to run C Shell (or tcsh) ?CGI?
Message-Id: <RbZ82.15$Fn3.56@nsw.nnrp.telstra.net>

In article <01be1cba$cf7070e0$5d68b9a3@wtang-sgl.sugar-land.geco-prakla.slb.com>,
	"William Tang" <wtang@flash.net> writes:
> Hello,
> Since the Perl runs on Bourne Shell, I can't run my csh scripts in my Perl
> program, and there will be a lot of work if I must to re-write those
> scripts. The question is can I force Perl run on C Shell (or even tcsh)
> (even change some perl source code and re-compile it)?

Either invoke csh yourself, and pass it the script, or use the shebang
line in your scripts (You know, that first line with the #!).

> Another question is I found that Perl CGI program will lose some
> environment variables, like $LD_LIBRARY_PATH (on SunOS), I can see it from

It does not 'lose' them. If they're there, they're there. If they're
not, they're not.

> Perl script, but when I put it into CGI program, the $ENV{LD_LIBRARY_PATH}
> is undefined, I must define it manually. Is it true that some of the
> environment variables will be undefined in CGI program?

<OFFTOPIC>
CGI has its own restrictions, which I will not discuss. CGI programs
run as whomever your server runs as, in most cases. It also 'inherits'
its environment from there. The server does not care who the author of
the script was, or what they use as their environment.
</OFFTOPIC>

Read up on CGI. Start at www.cgi-resources.com or so. Ask in
comp.infosystems.www.authoring.cgi. Don't come here with CGI
questions, please. We don't like to talk about CGI, but we always seem
to get drawn into discussions about it, like now.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | Curiouser and curiouser, said Alice.
NSW, Australia                      | 


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

Date: 1 Dec 1998 16:46:38 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Can I force Perl to run C Shell (or tcsh) ?CGI?
Message-Id: <741o3u$eic$1@monet.op.net>

In article <01be1cba$cf7070e0$5d68b9a3@wtang-sgl.sugar-land.geco-prakla.slb.com>,
William Tang <wtang@flash.net> wrote:
>Since the Perl runs on Bourne Shell, 

Maybe what you mean here is that Perl's `system' command passes its
argument to the Bourne shell.  But it does this because your C library
builtin `system' function does this.  

To run a C shell script, use

	system("csh -c scriptfilename");

of course.

If that isn't what you mean, you'd better say what you mean.

>The question is can I force Perl 

Force is never the answer.


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

Date: Tue, 1 Dec 1998 21:45:44 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Can I force Perl to run C Shell (or tcsh) ?CGI?
Message-Id: <F3B348.FsM@world.std.com>

"William Tang" <wtang@flash.net> writes:

> I can't run my csh scripts in my Perl
>program, and there will be a lot of work if I must to re-write those
>scripts.

You don't explicitly say, but I assume you mean running them with the
system() function or the `backtick` operator. If so, one solution
would be to run the she explicitly.

   system('csh -c c_shell_script');

>Another question is I found that Perl CGI program will lose some
>environment variables, like $LD_LIBRARY_PATH (on SunOS), I can see it from
>Perl script, but when I put it into CGI program, the $ENV{LD_LIBRARY_PATH}
>is undefined, I must define it manually. Is it true that some of the
>environment variables will be undefined in CGI program?

Perl doesn't explicitly delete environment variables behind the users
back. Its much more likely that the initialization that occurs when
the web server starts (and the modifications *it* makes to the
environment before it exec()s your program) is different than the
initialization of your login environment. Its a frequent mistake among
novices, which is why it is mentioned in the checklist of CGI problems
found at: <URL:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>

To find out for sure it that is the case, and you can't find it in the
servers, documentation, you might want to check with a newsgroup
dealing with HTTP servers or the CGI protocol. Information on servers
cn be found in the comp.infosystems.www.servers.* newsgroup hierarchy,
the CGI protocol in comp.infosystems.www.authoring.cgi newsgroup.
-- 
Andrew Langmead


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

Date: Tue, 01 Dec 1998 12:53:30 -0800
From: vlb@deltagen.com (Vicki Brown)
Subject: Cannot build DB_File (more of a C question)
Message-Id: <vlb-0112981253300001@catnip.deltagen.com>

Anyone really savvy in this kind of C?

When I use gcc, it has not problems with the include file but can't
understand the (apparently necessary) -KPIC flag.  Whebn I use the Solaris
compiler (the purchased one, supposedly ANSI compliant) I get

  "/usr/local/lib/perl5/5.00502/sun4-solaris/CORE/iperlsys.h", line 319:
formal  
  parameter lacks name: param #1
  "/usr/local/lib/perl5/5.00502/sun4-solaris/CORE/iperlsys.h", line 319: formal 
  parameter lacks name: param #2
  "/usr/local/lib/perl5/5.00502/sun4-solaris/CORE/iperlsys.h", line 319: formal 
  parameter lacks name: param #3
  "/usr/local/lib/perl5/5.00502/sun4-solaris/CORE/iperlsys.h", line 319: syntax 
  error before or at: __attribute__
  "/usr/local/lib/perl5/5.00502/sun4-solaris/CORE/iperlsys.h", line 319: 
  warning: syntax error:  empty declaration
  "/usr/include/ctype.h", line 43: cannot recover from previous errors
  cc: acomp failed for DB_File.c
  *** Error code 2

The offending lines (apparently) come from here

   243  #ifndef NEXT30_NO_ATTRIBUTE
   244  #ifndef HASATTRIBUTE       /* disable GNU-cc attribute checking? */
   245  #ifdef  __attribute__      /* Avoid possible redefinition errors */
   246  #undef  __attribute__
   247  #endif
   248  #define __attribute__(attr)
   249  #endif
   250  #endif
   ...
   317  #ifndef PerlIO_sprintf
   318  extern int PerlIO_sprintf  _((char *, int, const char *,...))
   319                             __attribute__((format (printf, 3, 4)));
   320  #endif
   ...


sigh

email responses preferable for faster delivery; Cc the list if you like...


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

Date: Tue, 01 Dec 1998 21:08:07 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: cgi script with path_info problem, some help needed
Message-Id: <XUY82.9$Fn3.56@nsw.nnrp.telstra.net>

In article <3663c144.7354274@news.siol.net>,
	vili.ga.ga@altavista.net (Vili) writes:

> But what I would really like to run is:
> http://server/cgisript/whatever
> I get Error 404 saying: no "/cgisript/whatever" directory.

You will have to configure your web server to do that correctly. It
has absolutely nothing at all to do with perl. The issues would be
exactly the same if your CGI application was written in any other
language. You should ask in one of the comp.infosystems.www.* groups.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd.       | cynical. It's perfectly easy to be
NSW, Australia                      | cynical.


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

Date: Tue, 01 Dec 98 16:03:04 est
From: chess@watson.ibm.com
Subject: die() message available at END time?
Message-Id: <36645988.1c9.chess@watson.ibm.com>

Can an END routine get access to the string that was passed to die()
in any plausible way?  For instance:

    ...
      or die "frob not twizzled."
    ...

  END {
     ...
     Log("Reason for death: $@");
     ...
  }

except that $@ doesn't in fact contain the death-string at that
point.  I know something similar can be done with eval()s and all,
but it'd be fun to be able to do it this way...

Dave Chess
General hacker and recent convert to oo-Perl coding




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

Date: Tue, 1 Dec 1998 16:54:07 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: die() message available at END time?
Message-Id: <MPG.10ce2f87f6c6916f98974a@news.scescape.net>

In article <36645988.1c9.chess@watson.ibm.com>, chess@watson.ibm.com 
says...
=> Can an END routine get access to the string that was passed to die()
=> in any plausible way?  For instance:
=> 
=>     ...
=>       or die "frob not twizzled."
=>     ...
=> 
=>   END {
=>      ...
=>      Log("Reason for death: $@");
=>      ...
=>   }
=> 
=> except that $@ doesn't in fact contain the death-string at that
=> point.  I know something similar can be done with eval()s and all,
=> but it'd be fun to be able to do it this way...

Would

$SIG{__DIE__} = sub { # msg in @_
	# ...
	# ...
};

be of any use?

HTH!

=> Dave Chess

--Matthew


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

Date: Tue, 01 Dec 1998 12:26:08 -0800
From: Guy Speier <speier.guy@cnf.com>
Subject: environment variables
Message-Id: <366450E0.878F5B05@cnf.com>


--------------946A634C185DAFA433969C29
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,

I would like to know how to "dot in" environment variables into perl.
For example,
I have a .profile that I would like to do:

 . /some/other/user/.profile

within my perl script.  However, this spawns another process, and I
cannot get these environment variables within MY perl script.

Could you please e-mail directly to:
speier.guy@cnf.com


I would really appreciate any informative advice.

thanks,

guy

--
Guy Speier
CNF
System Administrator



--------------946A634C185DAFA433969C29
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
Hello,

<P>I would like to know how to "dot in" environment variables into perl.&nbsp;
For example,
<BR>I&nbsp;have a .profile that I would like to do:

<P>. /some/other/user/.profile

<P>within my perl script.&nbsp; However, this spawns another process, and
I
<BR>cannot get these environment variables within MY&nbsp;perl script.

<P>Could you please e-mail directly to:
<BR>speier.guy@cnf.com
<BR>&nbsp;

<P>I&nbsp;would really appreciate any informative advice.
<PRE>thanks,</PRE>

<PRE>guy</PRE>

<PRE>--&nbsp;
Guy Speier
CNF
System Administrator</PRE>
&nbsp;</HTML>

--------------946A634C185DAFA433969C29--



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

Date: Tue, 01 Dec 1998 16:38:08 -0500
From: John Chambers <jc@eddie.mit.edu>
To: Guy Speier <speier.guy@cnf.com>
Subject: Re: environment variables
Message-Id: <366461C0.C5F4F57B@eddie.mit.edu>

Guy Speier wrote:
> 
> Hello,
> 
> I would like to know how to "dot in" environment variables into perl.  For example,
> I have a .profile that I would like to do:
> 
> . /some/other/user/.profile
> 
> within my perl script.  However, this spawns another process, and I
> cannot get these environment variables within MY perl script.

When I've wanted to do this, what I did was write myself a
little shell script that looked like:

#!/bin/sh
# We want .profile-like pathnames as args.
for f
do . $f
done
for x in `set`
do echo $x
done

Actually, I'd add some error checking, to make sure that $f
was actually a file, but you get the idea.  Then you have the
perl program run the script with the file pathname as an arg, 
maybe via `` or open, and read its output into an array. The 
array will look just like the output of the env or printenv 
command, and your perl code can do with it as it wishes.


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

Date: Tue, 01 Dec 1998 21:43:42 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: environment variables
Message-Id: <iqZ82.20$Fn3.56@nsw.nnrp.telstra.net>

In article <366450E0.878F5B05@cnf.com>,
	Guy Speier <speier.guy@cnf.com> writes:
> 
> --------------946A634C185DAFA433969C29
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit

Please don't do this. Usenet is a plain text medium. No place for MIME
crap here.

> I would like to know how to "dot in" environment variables into perl.
> For example,
> I have a .profile that I would like to do:
> 
> . /some/other/user/.profile

You are probably the 20th person asking this exact question in the
last 4 weeks. Please use dejanews to find answers to previous posts on
this.

> Could you please e-mail directly to:
> speier.guy@cnf.com

No.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 75% of the people make up 3/4 of the
Commercial Dynamics Pty. Ltd.       | population.
NSW, Australia                      | 


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

Date: Tue, 01 Dec 1998 21:19:19 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Filter to sort incoming mail?
Message-Id: <r3Z82.14$Fn3.56@nsw.nnrp.telstra.net>

In article <740rma$mms$2@bignews.shef.ac.uk>,
	QM<modnar_q@yahoo.com> writes:
> 
> Hi, I'd like to know if there are filters available which can autosort my
> incoming mail according to source address, into different folders. I'm using
> unix. I guess what I need is a perl script and a "pipe" in my .forward. Any
> ideas or suggestions?

Really, if you are looking for software, you should try the web first.
Yahoo would have been very helpful in this case. Even Altavista and
dejanews returned quite a few interesting things when searching for a
few well chosen keywords.

Another thing: Does the fact that you post this article to a perl
group mean that your mail filter HAS to be written in perl? I mean, if
you didn't care about the language, you probably would have posted
this to one of the newsgroups that has 'mail' in its name, or maybe
you would even have looked through their FAQs?

I don't know of any good stuff written in perl, but procmail does the
job pretty well for me.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 75% of the people make up 3/4 of the
Commercial Dynamics Pty. Ltd.       | population.
NSW, Australia                      | 


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

Date: Tue, 01 Dec 1998 12:51:21 -0800
From: Dale Sutcliffe <dales@enhanced-performance.com>
Subject: Re: Help - cgi button to call browser's email program
Message-Id: <366456C8.1311BD83@enhanced-performance.com>

Yes, that is sort of what I want.
But when the person clicks on the button the script needs to do a few things, like get a cookie and do a few calculations and then display the email
program

How do I do that with an $query->image_button?

Thanks

adrian wrote:

> Have you tried the idea of a script generated button with as anchor "mailto:me@work.com", or won't that work for you?
>
>
> -- remove the language from my domainname to email me --
> adrian@PERLinternetxs.com
>
> Dale Sutcliffe wrote:
>
>> I have a script that contains several different buttons, one button I would like users to be able to click on and their browser's email program
>> appears for them to be able to email anyone a web page.
>> For various reasons, it must be activated from a cgi script created button and must not use formmail.
>> Any ideas?
>>     Thanks.
>





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

Date: Tue, 01 Dec 1998 21:39:40 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How to remove characters from HTTP_REFERER?
Message-Id: <wmZ82.17$Fn3.56@nsw.nnrp.telstra.net>

In article <3664384d.0@news.inch.com>,
	"Khayu Nyein" <khayu@shweinc.com> writes:

> Please show me a routine that will remove
> http://www.shweinc.com/sitewars/ and .shtml, and
> http://shweinc.com/sitewars/ without the www.

If you are interested in doing some correct URL parsing:

use URI::URL;

use the host() and path() methods. Use a regexp to do something with
the host name. Use the File::Basename module to get the file name for
the path.

You can get URI::URL from CPAN, if you don't have it installed yet:
http://www.perl.com/CPAN

If for some reason you're allergic to modules:

my $url = 'http://www.shweinc.com/sitewars/anyfile.shtml';
my $dom = '';

($dom, $url) = ($url =~ m|http://www\.([^/]+?)/(.+)\.shtml|i);

Will do the job, but it's pretty unreliable.

# perldoc perlre
# perldoc perlop

-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd.       | password?
NSW, Australia                      | 


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

Date: Tue, 01 Dec 1998 21:16:04 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: ICQ online pager
Message-Id: <o0Z82.13$Fn3.56@nsw.nnrp.telstra.net>

In article <740rh8$bnp$1@mango.singnet.com.sg>,
	"Eric B" <NOSPAMeboo@bigfoot.com> writes:

> The problem is how do I get the program to check the icq status of my
> friends? This program is going to reside on a server with a permanent
> connection to the Internet.

Get the ICQ protocol specification, if it is freely available. Do what
it tells you to do to achieve your task.

You may want to check out www.perl.com/CPAN/modules to see if someone
has already done it for you.

> PS: To email me, kindly remove NOSPAM from my email address.

To get email, kindly remove NOSPAM from your email address.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd.       | selective about it's friends.
NSW, Australia                      | 


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

Date: 01 Dec 1998 14:38:04 -0600
From: pap4628@cisyellow.carenet.org (Paul A. Palmer)
Subject: interface to IBM's MQ Series
Message-Id: <t4yaor1tub.fsf@cisyellow.carenet.org>

Well, I have searched CPAN, as well as the MQ Series home page, but if it's
there I missed it.

Does there exist a Perl interface to IBM's MQ Series? 

I have something called PLMQ.pm, but it's version 1.00, dated 17-Apr-1997, and
I cannot find any traces of later versions. And mail to the author bounces. So
it looks pretty dead.

Any clues would be appreciated. I'm not too excited about learning XSUBs...


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

Date: Tue, 1 Dec 1998 13:05:34 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: localtime () - perl's  bug ?
Message-Id: <MPG.10cdf9fa399085cf98989f@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

I don't understand why someone changed the title of this thread, which 
has nothing to do with | piping.  I have changed it back.

In article <slrn768cf4.d93.dformosa@godzilla.zeta.org.au> on 1 Dec 1998 
18:13:56 GMT, David Formosa <dformosa@zeta.org.au> says...
> In article <MPG.10cdb35d37c2bddf98993a@nntp.hpl.hp.com>, Larry Rosler wrote:
 ...
> >"The CONTEXT for the two-digit disambiguation is the Unix epoch, which 
> >will do perfectly well for almost all of our programs."
> >
> >As I stated explicitly in a previous post, the Unix epoch will not do 
> >at all for historical or astronomical programs.
> 
> As my Grandmother is still alive I don't think she counts as
> historical.  For dates that involve humans (wich is meany of them)
> your script is hopelessly inaccurate.

<MATH LESSON>

The snippet I showed is a function on the year.  Functions have domains 
for their arguments and ranges for their values, which are single-valued 
mappings of the arguments.  In this case the domain of the argument is 
the set of non-negative integers, and the range of the values is the set 
of years for which the Unix epoch is valid.

The function presented is accurate (and, IMO, trivial).

</MATH LESSON>

The purpose of the part of the snippet that said to do the mapping if 
the year was less than 1970 was completely arbitrary.  The purpose of 
this limit was to deal properly with Y2K bugs such as 100 for the year 
2000.  One could set it anywhere above 200 or so, which would certainly 
include your grandmother's birthday in the range of the function.

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


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

Date: 01 Dec 1998 00:42:40 -0500
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: localtime () - perl's  bug ?
Message-Id: <ltlnks4dv3.fsf@asfast.com>

Russ Allbery <rra@stanford.edu> writes:

> Clive Newall <crn@itga.com.au> writes:
> 
> > New at this game, aren't you? When these decisions were made, every
> > clock cycle saved made significant difference. As did every byte of
> > precious memory saved. Often forgotten in these days of software bloat
> > and 100+MHz processors.
> 
> I disbelieve this.  struct tm was cast into its current form in the 1970s,
> yes?  I find it hard to believe the cost of an extra few bytes of memory
> to offset the array by one element, or the cost of a subtraction, was that
> overriding of a concern for machines even in the 1970s.

As a programmer who worked all through the 1970's, I assure you that
these timing considerations were indeed concerns back then, and well
into the 1980's.  If your program made a single call to localtime(),
then of course, you wouldn't notice the difference.  However, if this
call was made repeatedly within a large loop, the cumulative time
saved by avoiding the extra subtraction could be easily measured with
a wristwatch.  Multiply that by the number of times the program was
run and by the average number of programs that make similar use of
localtime(), and you can get into some serious time savings.

And remember that CPU-seconds were very expensive back then, so the
time difference could also be measured by your bank balance.

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -le '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x"'


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

Date: 1 Dec 1998 19:01:22 GMT
From: millerb@millerb.fc.hp.com (Bryan Miller)
Subject: Logging module with flock() ?
Message-Id: <741ee2$e9v@fcnews.fc.hp.com>
Keywords: Log-Logger flock()

Does anyone know of a version of Log-Logger or something
similar that provides a logfile generation mechanism but
also provide some sort of file locking mechanism?

I would like to log activity from a client program where
up to twelve child processes can be spawned and writing
to the log with the potential for concurrent access.
If need be I can modify Log-Logger but I would prefer
not to re-invent the wheel (and poorly at that :-).

cheers,
Bryan Miller
---
HP-UX Development Labs
Fort Collins, CO, USA
millerb@patchsvr.fc.hp.com


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

Date: Tue, 01 Dec 1998 16:31:35 -0500
From: Jon Peck <jmp35@cornell.edu>
Subject: Memory in Perl
Message-Id: <36646037.C0EC09D8@cornell.edu>

Hi- can any Perl gurus out there tell me a little about memory
management in perl, since I can't seem to find out elsewhere?  I know
each runtime environment is a little different, but in general:

 - Does Perl delete/clean a variable when it sees it will no longer be
needed in the rest of the script?

 - If not, will my()'d variables be cleared when the subroutine/block
exits, or still exist and just not be acessible? How about local()?

 - Is there any forcable garbage-collection?

 - Is re-using temp variables a good solution?  How about setting vars
to null?

 - Does reset() have anything to do with this?

Any help would be greatly appreciated.  Please reply to email:
jmp35@cornell.edu

Thanks!
-Jon Peck


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

Date: Tue, 1 Dec 1998 19:49:04 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: memory leak
Message-Id: <ebohlmanF3Axpt.7Eo@netcom.com>

jschueler@detroit.usweb.com wrote:
: I'm running the following subroutine several million times, and it seems to
: cause a slow memory leak.  Anybody know why?

: sub htmlclean () {
:   local( $T ) = $_[0] ;
:   while ( $T =~ s/\%([0-9a-eA-F]{2})/pack( 'c', hex($1) )/e ) {}
:   return $T ;
:   }

Not off the top of my head I don't, but I do know you're re-inventing the 
wheel.  Take a look at the URI::Escape module.



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

Date: Tue, 01 Dec 1998 19:34:09 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Need 5.003 source code for UNIX
Message-Id: <8caf17hd24.fsf@gadget.cscaper.com>

>>>>> "Mail" == Mail Server Administrator <Postmaster@moody.edu> writes:

Mail> Where can I get Perl 5.003 source code for UNIX?

Tell me if you install 5.003 on a webserver, and I'll try out
one of the rootkits to take over your box.

Seriously, 5.003 is KNOWN BAD.
All versions of Perl prior to 5.004 are known to have BUFFER OVERFLOW
problems.  Does that ring a bell?  Like how nearly every security
bug reported (of the 3 to 15 a week that I see) is related to a BUFFER
OVERFLOW?

You should really be using either 5.004 or 5.005 for new installations.

print "Just another Perl installer,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Tue, 1 Dec 1998 14:24:25 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: NO DOC NOWHERE!! (Was: emulating sed's "/start/,/stop/<do something>"?)
Message-Id: <MPG.10ce0946cc2b06e1989749@news.scescape.net>

In article <dkcombsF3Ap0H.Mxn@netcom.com>, dkcombs@netcom.com says...
[snip search for info on ... flip flop]

=> OK, that's it -- the ENTIRE doc on " ... ", or on "flipflop". 
=> Wonderful...

perlop, under Range Operators.  It's flip-flop, not flipflop...  You also 
didn't search for ... in the pods, did you?

perlop.pod:(as in B<sed>), use three dots ("...") instead of two.)  The 
right

=> And, cannot find it in blue camel, cookbook index, ed 1 of little
=> ref-book, ...  

Blue Camel, pg 90.  Second paragraph.  It's in the index under '..'.

Cookbook, page 177, example 6.8.  It's also the 25th line in the index, 
first column on page 735, near the bottom.

I don't have (or need) the 'ref-book'...

=>               (Randal's effective perl will arrive in a few days,
=> maybe it has something).

I'm sure.

=> "little known" sure must be true!

Little known, yes.  Hard to find, yes.  Impossible?  No.

HTH!

=> David

--Matthew


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

Date: Tue, 1 Dec 1998 14:52:49 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl and Y2K
Message-Id: <1vk147.am6.ln@flash.net>

John W. Edl Jr. (edl@lucent.com) wrote:

: I was asked if this version of perl is Y2K compliant.  Anyone know for sure?


   Yes, anyone who has searched for '2000' in the documentation
   that shipped with perl knows for sure...

   Anyone who has searched for 'y2k' in c.l.p.misc at www.dejanews.com
   knows for sure (1700 hits)

   Anyone who has searched for 'year 2000' in c.l.p.misc at www.dejanews.com
   knows for sure (400 hits)


   I'm beginning to detect a pattern there...


   (that version is NOT free of CERT security advisories though...)


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


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

Date: Tue, 1 Dec 1998 14:15:46 -0600
From: "Kevin Wormington" <kworm@sofnet.com>
Subject: Perl binary manipulation
Message-Id: <jSX82.273$r32.1006@news15.ispnews.com>

Hi, I am fairly new to perl and am trying to extract fields from a binary
field that has the layout below.  I have managed to get the field converted
to binary padded to 32bits using pack("N") and viewed in binary via unpack
("B32"), but when I try to use something like unpack("B3B5B3B4B1B6B10") it
seems to stop on the singe bit designated B1.  Can anyone provide any hints
on how to extract this info?

Thanks
Kevin

31-29           Reserved
28-24           Type field (Currently unused)
23-21           Chassis field
20-17           Slot field
16              PM field
15-10           Link field
9-0             Channel field

Translate 1041 to binary :

10000010001

Pad to 32 bits :

00000000000000000000010000010001


Separate the fields by a space :

000 00000 000 0000 0 000001 0000010001






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

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

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