[13379] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 789 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 14 03:07:32 1999

Date: Tue, 14 Sep 1999 00:05:18 -0700 (PDT)
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, 14 Sep 1999     Volume: 9 Number: 789

Today's topics:
    Re: About File::Copy ?? (elephant)
    Re: ATTN: Who would like to write a perl IDE for linux <sjs@yorku.ca>
    Re: back for more sorting abuse (Abigail)
    Re: display graph through CGI <meridamx@enol.com>
    Re: Exact matching? (Abigail)
        Faxing Script richb@fastlane.net
    Re: Faxing Script (Martien Verbruggen)
    Re: file renaming or copying <ehpoole@ingress.com>
    Re: Is perl Safe? <ehpoole@ingress.com>
    Re: Need date/time validation on user input. (Larry Rosler)
    Re: output of backticks (Abigail)
        Perl Calls the second <krajzewicz@inx.de>
    Re: Perl Calls the second (Martien Verbruggen)
    Re: Perl Y2k (Abigail)
        perlcc bug ? <riemensd@natlab.research.philips.com>
    Re: Question about split (Abigail)
    Re: Question about split (Abigail)
    Re: rand questions (Abigail)
        Reading files on a remote server ???????? <stewart@xcs.com.au>
    Re: Reading files on a remote server ???????? (Martien Verbruggen)
    Re: syslog / linux (Martien Verbruggen)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Tue, 14 Sep 1999 17:12:56 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: About File::Copy ??
Message-Id: <MPG.1248845b2054992f989cc6@news-server>

roger chiu writes ..
>when I copy file to other directory with File::Copy, the result are
>different between Win98 and NT. In win98, use
>"copy("c:\\a.txt","d:\\a.txt")" and cannot use "copy("c:\\a.txt","d:\\")".
>In NT, use "copy("c:\\a.txt","d:\\")". Why are different between win98 and
>NT? How do it copy files of a directory to other directory? Thanks a lot.

confirmed .. same problem here when trying to copy into the root 
directory (not a problem when copying into other directories)

  5.005_03 ActiveState build 519

Win9x deals with its root directory very strangely - use something like 
this instead

  my $fileToCopy = 'a.txt';
  copy( "c:/$fileToCopy", "d:/$fileToCopy");

no real loss because the C<copy( 'c:/a.txt', 'd:/')> version of the call 
would use that filename anyway

-- 
 jason - elephant@squirrelgroup.com -


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

Date: 13 Sep 1999 21:24:22 -0500
From: Steven Smolinski <sjs@yorku.ca>
Subject: Re: ATTN: Who would like to write a perl IDE for linux
Message-Id: <m3906akz6x.fsf@hank.yorku.ca>

Tom Christiansen <tchrist@mox.perl.com> writes:

> In short, Unix types are seldom interested in a new "IDE".

I always look at the websites flogging new IDEs for Linux, and I even install
all the demos I can get thinking that I've just doubled my productivity.  
Without exception, within hours I've been back in xemacs and a shell...

But, I'm still a sucker for a flashy new toy :)

Steve


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

Date: 14 Sep 1999 01:45:31 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: back for more sorting abuse
Message-Id: <slrn7trrtc.f00.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCCV September MCMXCIII in
<URL:news:x73dwiksgr.fsf@home.sysarch.com>:
$$ >>>>> "KS" == Kragen Sitaker <kragen@dnaco.net> writes:
$$ 
$$   KS> BTW, Shellsort (capitalized because it's named after somebody
$$   KS> called Shell) is O(N^(3/2)), or O(N sqrt N), not O(N lg N) as you
$$   KS> say in the paper, if I remember correctly.
$$ 
$$ i didn't know about the name. i have to research the O() value.

Paging Donald E. Knuth; Paging Donald E. Knuth!

Knuth [2] spends more than 10 pages on shellsort. While shellsort dates from
1959, the complexity of shellsort is still not fully understood. Depending
on the increments being used, different run time complexities for shellsort
can be found.

For instance, picking increments h_s = 2^{s+1} - 1, for 0 <= s < floor lg N,
leads to a run time complexity of O (N sqrt N). (Papernov and Stasevich [3]).

But do we pick the set of all numbers of the form 2^p 3^q that are less
than N as our set of increments, the run time complexity is O (N (log N)^2).
(Vaughan Pratt, 1969). However, this has a very large overhead.

An alternative method comes from Incerpi and Sedgewick [1]. Starting with
any number p > 1, define a base sequence a_1, a_2, ..., where a_k is the
least integer >= p^k such that a_j and a_k are relative prime, 1 <= j < k.
Now, define increments by setting h_0 = 1 and
                       (r)        (r+1)
h_s = h_{s-r} a_r  for (2) < s <= ( 2 ).
This leads to a run time complexity of O (N e^{sqrt(8 ln p) * sqrt(ln N)}),
where the constant implied by O () depends on p. Hence, a run time complexity
of O (N^{1+\epsilon}) for any \epsilon > 0. Which is asymptotic worse than
Pratt's result, but more useful in pratice.

Pratt-like sequences {5^p 11^q} and {7^p 13^q} have lower overhead than
Pratts original sequence, yet retain the O (N (log N)^2) bound.

Another sequence, by Sedgewick [4], is
      {9*2^s - 9*2^{s/2} + 1       if s is even
h_s = {8*s^2 - 6*2^{(s+1)/2} + 1   if s is odd
leading to a run time complexity of O (N^{4/3}).
                       
Empirical tests have been done by Weiss [6]. For the sequence 2^k - 1, ...,
7, 3, 1, the results suggest an average running time of O (N^{5/4}). The
above mentioned Sedgewick sequence gave an emperical result of O (N^{7/6}).

Shellsort was proposed by Donald L. Shell [5], back in 1959. Knuth calls it
shellsort (lowercase).


[1]  Janet Incerpi and Robert Sedgewick in "J. Comp. Syst. Sci", 31 (1985),
     pp 210-224; also in "Lecture Notes in Comp. Sci." 1136 (1996) pp 1 - 11.
[2]  Donald E. Knuth: "The Art of Computer Programming", Volume 3, 2nd edition.
     Reading: Addison-Wesley, 1998. pp 83-95.
[3]  A. A. Papernov, and G. V. Stasevich in "Problemy Peredachi Informatsii",
     1, 3 (1965), pp 81-98.
[4]  Sedgewick in "J. Algorithms" 7, (1986), pp 159-173.
[5]  Donald L. Shell in "CACM" 2, 7 (July 1959), pp 30 - 32.
[6]  M. A. Weiss in "Comp. J." 34 (1991), pp 88 - 91



Abigail
-- 
START   ENT3    T-1
1H      LD4     H,3
        ENT1    INPUT,4
        ST1     5F(0:2)
        ST1     6F(0:2)
        ENN1    -N,4
        ST1     3F(0:2)
        ENT1    1-N,4
2H      LDA     INPUT+N,1
3H      ENT2    N-H,1
4H      CPMA    INPUT,2
        JGE     6F
        LDX     INPUT,2
5H      STX     INPUT+H,2
        DEC2    0,4
        J2P     4B
6H      STA     INPUT+H,2
7H      INC1    1
        J1NP    2B
        DEC3    1
        J3NN    1B


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 13 Sep 1999 23:49:09 -0600
From: "Chuck Burgess" <meridamx@enol.com>
Subject: Re: display graph through CGI
Message-Id: <7rko67$ao9$1@news.inquo.net>

A more detailed explanation, in case you're not familiar with the GD module:
The GD.PM is a module used to produce GIFs and serve them to the web
browser. You can find all of the information about the GD.PM at
http://www-genome.wi.mit.edu/ftp/pub/software/WWW/GD.html
If you want to see an example of what kind of graphs the GD.PM is capable of
producing, I am developing a commercial Internet Survey package. You can
find a test version on my personal website at http://www.enol.com/~meridamx
and click on the Web Survey Link.

Glenn Kauffman <glenn.kauffman@worldnet.att.net> wrote in message
news:7rj4g0$to$2@bgtnsc03.worldnet.att.net...
> Yes, you can do this, as I have. You will have to use the GD module to
draw
> your image from the data.
>
> Glenn Kauffman
>
> <harris_m@my-deja.com> wrote in message
news:7rc2v5$4au$1@nnrp1.deja.com...
> I have Excel spreadsheet which creates graph. I could use Perl OLE
> interface and maniputate excel spreadsheet.
>
> Is there any way my CGI script can display the graph from Excel on Web
> browser? One way would be to save Excel graph in bit map format (how?)
> and send out HTML code which will refer to the bitmap created.
>
> Anyone has done something like this or some pointers how to do this?
> Thank you.
> Harris
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
>




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

Date: 14 Sep 1999 01:49:11 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Exact matching?
Message-Id: <slrn7trs4a.f00.abigail@alexandra.delanet.com>

Dan C. Rinnert (dcr@canville.net) wrote on MMCCIV September MCMXCIII in
<URL:news:37DD7462.623B@canville.net>:
^^ I don't know what happened to the text of my original message, but what
^^ I was trying to ask is how can I do an exact match in Perl?  I haven't
^^ found anything in the FAQ or the books I have to do that.


Then you need better books. Between now, and when you buy the better books,
look up `eq' in the perlop manpage.



Abigail
-- 
perl -wle '$, = " "; print grep {(1 x $_) !~ /^(11+)\1+$/} 2 .. shift'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 14 Sep 1999 00:46:26 -0500
From: richb@fastlane.net
Subject: Faxing Script
Message-Id: <1EFED57ED60F4556.0F2E3C0ED99E21EB.4071E989EF62B671@lp.airnews.net>

Looking for a perl script that will allow file to be faxed to specified
fax number.  The selectable file would be a text file on the local hard
drive.



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

Date: Tue, 14 Sep 1999 06:34:08 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Faxing Script
Message-Id: <A%lD3.196$Wz1.14181@nsw.nnrp.telstra.net>

In article <1EFED57ED60F4556.0F2E3C0ED99E21EB.4071E989EF62B671@lp.airnews.net>,
	richb@fastlane.net writes:
> Looking for a perl script that will allow file to be faxed to specified
> fax number.  The selectable file would be a text file on the local hard
> drive.

Faxing is not a trivial thing to do. Modems are different, faxing
protocols are different, communications between faxes is idiosyncratic
and not trivial to anticipate.

Normally you'd first want a fax system installed, which already takes
care of all these things for you. What is your OS?  What is your Fax
system? For unices Hylafax works pretty well. Look for it on the web.
There is no perl module for HylaFax yet (although I started working on
one a while ago, a project abandoned for want of time), but it's got a
pretty comprehensive set of command line interafces which perl can use
pretty nicely (in fact, that's what my prototype module does).

For win32 you should be able to treat your fax as a printer, but how
you pass it the required parameters is specific to the software etc.
Maybe ActiveState has some win32 specific faxing modules.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | You can't have everything, where would
Commercial Dynamics Pty. Ltd.       | you put it?
NSW, Australia                      | 


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

Date: Tue, 14 Sep 1999 01:57:35 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: file renaming or copying
Message-Id: <37DDE3CF.13414505@ingress.com>

dave_pomeroy4266@my-deja.com wrote:
> 
> I am trying to either rename a file or copy it.  When I attempt to
> rename it the status returns false.  When I copy it the status returns
> true but the new file is empty.  Anyone have any ideas?  I am in win32.
> Thanks for all your help.
> Dave Pomeroy

Most common cause assuming the parameters in rename() are correct:

You are trying to rename an open file (usually happens when someone places
the rename before the close statement rather than after).

You should be going a step further than just testing whether its false and
asking what's wrong.  You should be taking a look at $! to see exactly
*what* error was returned.

-- 
Ethan H. Poole           ****   BUSINESS   ****
ehpoole@ingress.com      ==Interact2Day, Inc.==
(personal)               http://www.interact2day.com/


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

Date: Tue, 14 Sep 1999 01:53:18 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: Is perl Safe?
Message-Id: <37DDE2CE.9AD15A64@ingress.com>

David Cassell wrote:
> 
> Mike Smith wrote:
> >
> > Hi all,
> >
> > We use Perl as a tools to help us wade through all of our data on our
> > project.  My System Integrity team are asking how do I know that perl
> > is safe, has it been trough code inspection, unit test, coverage test
> > etc.
> > Can anyone help?  What is the update process for perl.
> 
> Perl comes with test suites.  It goes through testing before
> beta versions become the next 'stable' version.  The perlhist
> doc has some info on that.  [Not that there are not slips
> now and then - Perl isn't perfect.]
> 
> How do you know that your System Integrity Team is safe?

Perl even goes a step further, everyone who wishes may download the source
code for Perl, review it in-house if they wish, and then compile the
reviewed code for themselves.

If that doesn't satisfy your Systems Integrity Team, they had better start
unplugging the computers because things don't get much more open than open
source projects -- and you had better start firing the Team and looking
for some replacements!

-- 
Ethan H. Poole           ****   BUSINESS   ****
ehpoole@ingress.com      ==Interact2Day, Inc.==
(personal)               http://www.interact2day.com/


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

Date: Mon, 13 Sep 1999 23:54:25 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Need date/time validation on user input.
Message-Id: <MPG.124790f2c48aec06989f5e@nntp.hpl.hp.com>

In article <MPG.12461bf2d153689f98973f@nntp1.ba.best.com> on Sun, 12 Sep 
1999 21:22:50 -0700, Bill Moseley <moseley@best.com> says...
> Ricky C. Matlak (ricky_c_matlak@mail.northgrum.com) seems to say...
> > I have a user entering dates and times, and I must worry about bogus
> > entries (i.e. Feb 30th, or say month 99/01/1999), and could use
> > something to validate the entries.  Need to account for leap years,
> 
> Take a look at Date::Calc and Date::Manip
> 
> Date::Manip is big, but it's a lot of fun, too.  People can type in a 
> wide range of formats.  Example: 'last tuesday in november' works.  
> That's probably overkill for what you need.

Here is a very lightweight function that I posted earlier this year to 
the Perl Function Repository.  Daniel Grisinger has changed jobs, and 
the Repository site isn't active, so I retrieved the code from Deja.  

This function includes error-checking, whereas timelocal and timegm 
don't.


#!/usr/local/bin/perl -w
use strict;
 
# UTC_to_Epoch: Convert UTC date/time to Unix-epoch time.
# Larry Rosler, 11 February, 1999
 
# UTC_to_Epoch converts a broken-down date/time array from UTC to time
# in seconds since the Unix Epoch (midnight on 1 January, 1970).  It is 
# essentially the inverse of gmtime.
 
# The input is a list of at least three integers:
#  year   [1970 to 2099]
#  month  [1 to 12]
#  day    [1 to whatever is appropriate for the year and month]
#  hour   [0 to 23; 0 if omitted]
#  minute [0 to 59; 0 if omitted]
#  second [0 to 59; 0 if omitted]
# 'undef' is returned if the arguments do not represent a valid
# date/time on or after the Unix Epoch.
 
sub UTC_to_Epoch {
    my ($year, $mon, $day, $hour, $min, $sec) = @_;
    defined $year && defined $mon && defined $day or return;
    my @m_day = (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    $m_day[2] = 29 unless $year % 4; # OK from 1901 through 2099. 
 
    1970 <= $year         && $year <= 2099
    && 1 <= $mon          && $mon  <= 12
    && 1 <= $day          && $day  <= $m_day[$mon]
    && 0 <= ($hour ||= 0) && $hour <= 23
    && 0 <= ($min  ||= 0) && $min  <= 59
    && 0 <= ($sec  ||= 0) && $sec  <= 59
         or return; 
 
    # Adapted from Astronomical Computing, Sky & Telescope, May, 1984.
     24 * 60 * 60 * (367 * $year - 678972 - 40587 + int(275 * $mon / 9)
        + $day - int((int(int($year + ($mon < 9 ? -1 : 1) *
        int(abs($mon - 9) / 7)) / 100) + 1) * 3 / 4) -
        int(7 * (int(($mon + 9) / 12) + $year) / 4)) +
        60 * 60 * $hour + 60 * $min + $sec
}

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


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

Date: 14 Sep 1999 00:35:32 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: output of backticks
Message-Id: <slrn7trnq5.f00.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCCV September MCMXCIII in
<URL:news:x7906akyab.fsf@home.sysarch.com>:
;; >>>>> "A" == Abigail  <abigail@delanet.com> writes:
;; 
;;   A> Since my knowledge of Perl internals is less than my knowledge of
;;   A> the sexlive of antartic sparrows, there are other ways to get the
;;   A> knowledge to do such tricks.
;; 
;; so what is the mean carrying weight for a horny antarctic sparrow?


During winter or summer?



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 14 Sep 1999 08:52:13 +0200
From: Daniel Krajzewicz <krajzewicz@inx.de>
To: Daniel Krajzewicz <krajzewicz@inx.de>
Subject: Perl Calls the second
Message-Id: <37DDF09D.E2A88176@inx.de>

Hello !!!

Well, I'm still searcjing for help about the Perl-calls-topic from a =

HTML-document without having to press a button.
AbiGails answer was quite french, I didn=B4t understood...

Is there maybe a possibility to make a call from JAVASCRIPT ??

thanks,
Daniel Krajzewicz

-- =

 __________________________
<     Daniel Krajzewicz    >
 >------------------------<
<     krajzewicz@inx.de    >   =

 >------------------------<
< http://www.art-so-far.de >
 >------------------------<
<__________________________>


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

Date: Tue, 14 Sep 1999 07:03:36 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl Calls the second
Message-Id: <crmD3.202$Wz1.14181@nsw.nnrp.telstra.net>

In article <37DDF09D.E2A88176@inx.de>,
	Daniel Krajzewicz <krajzewicz@inx.de> writes:
> Hello !!!
> Well, I'm still searcjing for help about the Perl-calls-topic from a 
> HTML-document without having to press a button.
> AbiGails answer was quite french, I didnīt understood...

Ok, less french:

You can't do it.  Your question does not make sense. You are talking
nonsense. 

First read up on the protocols and definitions, so that you at least
know what you are talking about. Then, carefully, formulate a clear
and concise question. Then ask. In the _appropriate_ group.

> Is there maybe a possibility to make a call from JAVASCRIPT ??

So, what does _this_ have to do with perl?

Just to be even more clear: You cannot call a server side perl script
from HTML/CS Java/CS JavaScript/your car/the rear end of your
cat/a banana.

Maybe you should go to one of the comp.infosystems.www.* groups, and
ask there. Your question has absolutely no relevance to perl.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd.       | from a rich salesperson.
NSW, Australia                      | 


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

Date: 14 Sep 1999 00:05:41 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl Y2k
Message-Id: <slrn7trm25.f00.abigail@alexandra.delanet.com>

Sam Holden (sholden@pgrad.cs.usyd.edu.au) wrote on MMCCIV September
MCMXCIII in <URL:news:slrn7tr0lu.n74.sholden@pgrad.cs.usyd.edu.au>:
## On Mon, 13 Sep 1999 17:55:33 -0400, Li Kong <lkong@hns.com> wrote:
## >
## >--------------A1CD81DF8463BA2423E3D245
## >Content-Type: text/plain; charset=gb2312
## >Content-Transfer-Encoding: 7bit
## 
## That MIME, post the same thing twice once in HTML is a bit silly. It doesn't
## bother me much, since my reader ignores the HTML bit (it does make replying
## take a second or two longer though...) You really don't need to do that. Plai
## old every day text is a great format for news posts.

My newsreader simply ignores the entire post...... ;-)

## >It is my first question in this group, I am no perl expert, the
## >group name is not comp.lang.perl.expert. I suppose I can
## >ask any question related to perl.
## 
## Unless that question is answered in the Frequently Asked Questions. The
## same as every other newsgroup.

Or if the question is answered by trivial research in the manual. Or if
the question is off topic.

## >It will waste you only 5 seconds to look at my question.
## >You'd rather spend 2 or 3 minutes send a gabage reply.

You are a whiner.

*ploink*



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 14 Sep 1999 05:36:52 GMT
From: "Riemens, ir. D.K." <riemensd@natlab.research.philips.com>
Subject: perlcc bug ?
Message-Id: <37DDDEF4.DE633073@natlab.research.philips.com>

Hi,

I am using perlcc to generate an executable from my 
perl app. Unfortunately the behaviour of the executable
is not the same. The program should generate a (long)
table with testresults. It produces nothing!

I have tried to generate C code to see if I could understand
what is going on, but the '-gen' option does not seem to
work. I succeeded by stopping the process during compilation
and copying the C-file, but that didn't do me much good (:-).

During compilation, a number of  warnings is generated,
which I do not understand:

riemensd@starling>perlcc rstat.pl  

--------------------------------------------------------------------------------
Compiling rstat.pl:
--------------------------------------------------------------------------------
Making C(rstat.pl.c) for rstat.pl!
/cadappl/perl/5.005_02/HP-UX_B.11.00/bin/perl
-I/home/ponsen/Projects/perl/lib
-I/home/ponsen/Projects/perl/lib/site_perl
-I/home/ponsen/Projects/perl/arch
-I/cadappl/perl/5.005_02/HP-UX_B.11.00/lib/5.00502/PA-RISC2.0
-I/cadappl/perl/5.005_02/HP-UX_B.11.00/lib/5.00502
-I/cadappl/perl/5.005_02/HP-UX_B.11.00/lib/site_perl/5.005/PA-RISC2.0
-I/cadappl/perl/5.005_02/HP-UX_B.11.00/lib/site_perl/5.005 -I.
-MO=CC,-orstat.pl.c rstat.pl
rstat.pl syntax OK
substcont: op = LOGOP (0x401d76c0) pp_substcont, pmop = PMOP
(0x401d6a40) pp_subst
pmopsym = (OP*)&pmop_list[28]
substcont: op = LOGOP (0x401ecea0) pp_substcont, pmop = PMOP
(0x401d6bc0) pp_subst
pmopsym = (OP*)&pmop_list[29]
substcont: op = LOGOP (0x401e73e0) pp_substcont, pmop = PMOP
(0x401e0300) pp_subst
pmopsym = (OP*)&pmop_list[67]
substcont: op = LOGOP (0x401e7580) pp_substcont, pmop = PMOP
(0x401e0400) pp_subst
pmopsym = (OP*)&pmop_list[68]
substcont: op = LOGOP (0x401e72e0) pp_substcont, pmop = PMOP
(0x401e02c0) pp_subst
pmopsym = (OP*)&pmop_list[69]
substcont: op = LOGOP (0x401e76e0) pp_substcont, pmop = PMOP
(0x401e0500) pp_subst
pmopsym = (OP*)&pmop_list[70]
substcont: op = LOGOP (0x401e7460) pp_substcont, pmop = PMOP
(0x401e0380) pp_subst
pmopsym = (OP*)&pmop_list[71]
substcont: op = LOGOP (0x401e9080) pp_substcont, pmop = PMOP
(0x401e03c0) pp_subst
pmopsym = (OP*)&pmop_list[72]
Compiling C(rstat) for rstat.pl!
/cadappl/perl/5.005_02/HP-UX_B.11.00/bin/perl
-I/home/ponsen/Projects/perl/lib
-I/home/ponsen/Projects/perl/lib/site_perl
-I/home/ponsen/Projects/perl/arch
-I/cadappl/perl/5.005_02/HP-UX_B.11.00/lib/5.00502/PA-RISC2.0
-I/cadappl/perl/5.005_02/HP-UX_B.11.00/lib/5.00502
-I/cadappl/perl/5.005_02/HP-UX_B.11.00/lib/site_perl/5.005/PA-RISC2.0
-I/cadappl/perl/5.005_02/HP-UX_B.11.00/lib/site_perl/5.005 -I.
/tmp/rstat.pl.tst
cc -D_HPUX_SOURCE -Aa -I/usr/local/include -O
-I/cadappl/perl/5.005_02/HP-UX_B.11.00/lib/5.00502/PA-RISC2.0/CORE  -o
rstat rstat.pl.c  -L/usr/local/lib
-L/cadappl/perl/5.005_02/HP-UX_B.11.00/lib/5.00502/PA-RISC2.0/CORE
-lperl -lnsl -lnm -lndbm -ldld -lm -lc -lndir -lcrypt
cc: line 7694: warning 5004: Uninitialized variable "left" in function
"pp_sub_write_header" (5004)
cc: line 9287: warning 5004: Uninitialized variable "left" in function
"pp_sub_File__Basename__fileparse_set_fstype" (5004)


What do the "substcont:" warnings mean?

My system:

  This is perl, version 5.005_02 built for PA-RISC2.0
  HP-UX starling B.11.00 A 9000/820 2005777119 two-user license


After adding a lot of debug print statements in my code and comparing
the output of the perl run and the compiled version, I came to the 
conclusion that the following line of code is not handled correctly:

    next if (($no_product ne "") && ($prod =~ /^$no_product/));

The condition should produce false in a lot of case, but seems to be 
true. The individual conditions are OK, so I suspect the handling of
the '&&' operator to be the cause.

If I replace this line by:

    if ($no_product ne "")
     { if ($prod =~ /^$no_product/) { next; } }

The code runs OK.

Is this really a bug, or am I missing something??

I've tried to find more info on perlcc, but did not succeed.


One other thing that also came up. My old perl:

   This is perl, version 5.004_04 built for PA-RISC1.1

shows different behaviour than the new one:

  This is perl, version 5.005_02 built for PA-RISC2.0

Has anything dramatically changed. Is there documentation
about changes for which I could/should check my code?

Best regards, David



-- 
    David Riemens
    Philips Semiconductors ASIC Service Group
    Embedded Systems Technology Centre 
    Building WAY-p 93
    Prof. Holstlaan 4
    5656 AA Eindhoven, The Netherlands

    Phone: +31-40-2745145
    Fax:   +31-40-2744115
    mailto:riemensd@natlab.research.philips.com


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

Date: 14 Sep 1999 00:37:48 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Question about split
Message-Id: <slrn7trnue.f00.abigail@alexandra.delanet.com>

Kragen Sitaker (kragen@dnaco.net) wrote on MMCCV September MCMXCIII in
<URL:news:3TiD3.9387$N77.720532@typ11.nn.bcandid.com>:
<> In article <slrn7trc04.f00.abigail@alexandra.delanet.com>,
<> Abigail <abigail@delanet.com> wrote:
<> >And as the manual will tell you, by default, split *keeps* leading empty
<> >fields, and discards trailing empty fields.
<> 
<> The manual *does* say that is the default.  Does that mean there's a
<> way to change it?  I couldn't find one mentioned there.


Yes, there is a way not to discard trailing empty fields. Use the
third argument.

You need to use different (but simple) approaches to discard empty
leading fields.



Abigail
-- 
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 14 Sep 1999 00:40:16 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Question about split
Message-Id: <slrn7tro32.f00.abigail@alexandra.delanet.com>

Matthew Miller (namille2@news.vt.edu) wrote on MMCCV September MCMXCIII
in <URL:news:7rkbbl$a52$1@solaris.cc.vt.edu>:
:: 
:: Kragen, thanks for your explaination. I understand now about getting
:: a null string from split. Now, I only wish split didn't do such a
:: thing. I've now got a work around. I just believe that split should
:: refrain spitting out a null string that (in my case) is not needed.

Since it's a hell of a lot easier to discard empty strings than to
figure out how many were discarded by Perl, be glad Perl includes
them in the result. It's extremely trivial to discard any leading
empty strings.



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 14 Sep 1999 01:56:56 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: rand questions
Message-Id: <slrn7trsiq.f00.abigail@alexandra.delanet.com>

Gene Senyszyn (scatt@goes.com) wrote on MMCCIV September MCMXCIII in
<URL:news:37DC8A33.A759B41A@goes.com>:
:: Hi,
:: 
:: I've been searching for a seemingly simple answer to a few questions
:: using rand().
:: Is there a way to force rand() to return only integers?

No. And there is no need to. You can always round it yourself.

:: I have an array, and I get the # of items in it, and call rand() using
:: the # of items as the expression (ie $x = rand $count;)
:: I then have a print statement that prints the # returned ($x) and the
:: corresponding position in the array. (print $ARRAY[$x];)
:: 
:: The variable $x gets converted to an integer, however the next random
:: number can be 4.3333, where the last one was maybe 4.2222, and they both
:: print the same lines.

And? What is the problem? If you think that rand() will never return
the same number, you are awfully mistaken. Say you have an array with
10 elements.  You randomly select one. The chance you select index 4 is
10%. REGARDLESS whether the previous pick was 4 as well. Even if the
previous 100 picks were all 4, there is still a 10% chance this pick
will be 4 as well.

:: Technically, its a random number, but when I print the array item, they
:: are the same.
:: 
:: Any ways around this?


It looks like you want something else. The FAQ has an entry on shuffling
arrays.


Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sun, 12 Sep 1999 09:20:31 +1000
From: "Stewart Pitt" <stewart@xcs.com.au>
Subject: Reading files on a remote server ????????
Message-Id: <7renur$6el$1@news.eisa.net.au>

Does any one know if using perl whether or not I can execute a script on one
server and open a file to read or write on another server connected only by
the internet?????

Stewart Pitt
X-IT Computer Services P/L
stewart@xcs.com.au






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

Date: Tue, 14 Sep 1999 05:37:35 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Reading files on a remote server ????????
Message-Id: <zalD3.183$Wz1.12377@nsw.nnrp.telstra.net>

In article <7renur$6el$1@news.eisa.net.au>,
	"Stewart Pitt" <stewart@xcs.com.au> writes:
> Does any one know if using perl whether or not I can execute a script on one
> server and open a file to read or write on another server connected only by
> the internet?????

Yes, you can. Most likely you will need to have some underlying
protocol like NFS or SMB to do this, or you could pull the file down
with ftp, edit it locally and put it back. Many possibilities.

Can't e of any more help than that, because you don't tell us very
much, now, do you?

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


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

Date: Tue, 14 Sep 1999 06:59:22 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: syslog / linux
Message-Id: <enmD3.200$Wz1.14181@nsw.nnrp.telstra.net>

In article <ZUhD3.104$Wz1.8091@nsw.nnrp.telstra.net>,
	mgjv@comdyn.com.au (Martien Verbruggen) writes:
> In article <m3906a603f.fsf@anthrax.local.net>,
> 	Benjamin Schweizer <SternSZ@gmx.de> writes:
> 
>> Iīve written a little daemon and I want to save messages (stdout) to
>> the syslog daemon. Is there a function in perl or is this done by
>> the os?
> 
> I am not sure what you mean by the distinction between the two above,
> but perl has a module called Sys::Syslog, which will probably do what
> you want. Although redirecting stdout to syslog will not work without
> a bit of work.

Just read the announcement of Tie::Syslog. You do want to have a look
at that :) clp.modules should have the announcement, CPAN the module.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Failure is not an option. It comes
Commercial Dynamics Pty. Ltd.       | bundled with your Microsoft product.
NSW, Australia                      | 


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 789
*************************************


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