[23240] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5461 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 8 06:06:08 2003

Date: Mon, 8 Sep 2003 03:05:08 -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           Mon, 8 Sep 2003     Volume: 10 Number: 5461

Today's topics:
        Cautionary Note (was): AI::GA <xanthian@well.com>
        emulating @+ and @- <tassilo.parseval@rwth-aachen.de>
    Re: emulating @+ and @- <nospam-abuse@ilyaz.org>
    Re: emulating @+ and @- (Anno Siegel)
        exit() argument evaluation <peter.dintelmann@dresdner-bank.com>
    Re: exit() argument evaluation <krahnj@acm.org>
        GNU make & make.pl are dead: long live Perl makepp <occitan@esperanto.org>
        How To activate command line history in debugger? <k.kronschnabl_nospm_@ica-intercom-akademie.de>
        illegal seek <dave.nospam@ntlworld.com>
    Re: illegal seek news@roaima.freeserve.co.uk
    Re: illegal seek (Anno Siegel)
        LWP and gzip sprint@pilot.net
    Re: LWP and gzip (Sam Holden)
    Re: LWP and gzip <NOSPAM@bigpond.com>
    Re: LWP and gzip news@roaima.freeserve.co.uk
    Re: Newby Question: Displaying Excel from within my CGI <tcurrey@no.no.no.i.said.no>
    Re: Newby Question: Displaying Excel from within my CGI <noreply@gunnar.cc>
    Re: Newby Question: Displaying Excel from within my CGI <tcurrey@no.no.no.i.said.no>
    Re: NT: perl 5.8.0: system call - commnad split into mu (Eric)
        perldoc can't display doc (Ronald Fischer)
    Re: perldoc can't display doc <bart.lateur@pandora.be>
    Re: perldoc can't display doc <kuujinbo@hotmail.com>
        simple regex problem <vervoom@hotmail.com>
    Re: simple regex problem <krahnj@acm.org>
    Re: simple regex problem <noreply@gunnar.cc>
    Re: simple regex problem <mpapec@yahoo.com>
    Re: simple regex problem <vervoom@hotmail.com>
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 8 Sep 2003 09:04:34 +0000 (UTC)
From: "Kent Paul Dolan" <xanthian@well.com>
Subject: Cautionary Note (was): AI::GA
Message-Id: <14dc3f68fb3080fcc18038906f8e22ad.48257@mygate.mailgate.org>

"Arthur T. Murray" <uj797@victoria.tc.ca> wrote:

> * "A prophet is without honor in his own country."

> The Mentifex AI Mind project is not faring well here in the
> United States -- a country full of ignorance and war-mongering.

Arthur, I want you to read this document very carefully,
consider your posting habits over the past several years,
and give yourself a fair score on each and every item, as
it would be scored by someone completely impartial; just
say: have I ever done _anything_ where someone might think
this describes me:

http://math.ucr.edu/home/baez/crackpot.html

You don't need to tell anyone but you the result, but you
_do_ need to understand that you just boosted that score,
and that if you cannot gain some perspective on yourself,
and on how your work is perceived by those with some real
knowledge in the field, you are going to join James Harris
of sci.math as one of the really obnoxious and over the edge
mental cases of Usenet, and not just the fairly harmless,
obsessed, and blind to his own ideas' trivialities net.kook
you are right now.

Recommending your self-published book as a serious work for
a classroom was a much more severe symptom of progress up
the James Harris scale; that starts to impinge on the real
world and cause real harm to others.

Claiming AI had been "solved", and that YOU, YOU, YOU had done
it, was a _much_ worse symptom again, and having instantly to
recant the claim to the point of meaninglessness should have
warned you that you were shooting youself a little closer yet
to James Harris.

James doesn't have a life left, or any judgement at all; or
the respect of anyone at all; try not to go there.  All he
does any more is add blunder after blunder to his list, while
claiming to be misunderstood, persecuted, and all the rest
your above statement starts to have you saying, and ranting
at and attacking anyone who tries to point out the weaknesses
of his claims. His only remaining use is to be the horrible
example he is.

I don't have a life either, for other reasons all of my own
devising, and it is no fun at all to be only a horrible example
to others.  Don't go there.

If you want to contribute to the AI mind problem, and not
just brag falsely that you already have but are universally
misunderstood, start by bringing yourself up to speed on
what _real_ researchers, who submit their work for peer review
AND LISTEN TO THE REVIEWS and FIX THEIR ERRORS IN RESPONSE
and SUBMIT THEIR WORK FOR REVIEW AGAIN, AND AGAIN, AND AGAIN,
UNTIL THE REVIEWERS SAY IT IS CORRECT, in purist humility that
anything less isn't science, have already discovered and set
as the next level from which to advance.

This will take you literal years of formal education and hard
study, the same years the other real researchers all cheerfully
invested just to be able to add one new advance to the effort,
if very lucky. You may well find that you aren't smart enough,
after all, and need to make other plans.  It happens to many,
but you owe it to yourself at least to try.

[My daughter just started the next five years of such a slog,
after working a while and deciding that with her brains she
could contribute more if she'd learn more to have the tools to
make the contributions, so this has special meaning to me
today. Hers is what's known as the sane approach, and what
I've been doing, hoping the years since since she left school
for a prestigeous job that she'd someday choose it, is as close
as an atheist is allowed to get to praying.]

Don't pretend that you are going to be the architect, be
content to add a few bricks to the edifice and call that a
life's work.  That's the only way the real work of science
ever gets done.

Almost everything Einstein first published was derived from
pieces first found by others, he was as much the jigsaw
puzzle assembler as anything, bringing just his one more
piece that was key to the work of seeing how the other parts
best fit, not springing the whole thing forth from sheer
testosterone poisoning derived "genius", as your attempts
reflect.  The media should better explain this, not pretend
he worked in isolation.

Try to be at least that humble.

xanthian, who has a little GA project that sometimes has a
little piece that can help the next guy take the next baby
step, and is otherwise mostly just a way to fill time and
try to be useful and stay out of jail.

When it doesn't go well for a while, I use the output to
finger paint, and I'm no artist.

This is all I _can_ do, because I failed to finish my
education, wasting a pretty good mind on a pretty pointless
career.

I'm hoping my offspring's better choices let her do more.

I hope that for other people as well. The motto of the
United Negro College Fund, my unbelievably racist
grandfather's nevertheless only regular charity check,
is exactly right: a mind _is_ a terrible thing to waste.
[It frankly doesn't matter the color or style of wrapper
in which it comes, it's _still_ a terrible thing to waste
a good mind.]

Thus this quite possibly futile and long past too late note.


-- 
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG


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

Date: 8 Sep 2003 09:12:20 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: emulating @+ and @-
Message-Id: <bjhh5k$3ib$1@nets3.rz.RWTH-Aachen.DE>

Hi,

I am currently working on something that should be backward-compatible 
at least up to 5.00503. Unfortunately, this relies on @+ and @- which
weren't there by that time. So I have to find a way to create and
populate these two arrays with 5.00503. Consider the original code that
assumes that @(+|-) exist:
    
    sub bla {
        my ($string, $pat, $code) = @_
        while ($string =~ /$pat/g) {
            $code->(@- > 1 ? () : substr($string, $-[0], $+[0] - $-[0]),
                    map substr($string, $-[$_], $+[$_] - $-[$_]), 1 .. $#-);
        };
    }

This is essentially what Ruby's scan() does: Scan a string for a pattern
and call the code via the reference. If the pattern contains
subpatterns, call it like

    $code->($1, $2, ...);

otherwise (that means, no captured subpatterns) do

    $code->($&);

This means, I need the whole of @- and @+, and not just the first
element of each two. My question is specifically about generating
elements 1 to $#-. My current solution:

    while ($string =~ /($pat)/g) {
        @- = @+ = ();   # clear previous match offsets
        # populates $-[0] and $+[0]
        push @-, index($string, $1);
        push @+, pos($string);

        # fill @-[1..#@-] and @+[1..#@+]
        my $digit = 2;  # $1 is the whole match
        while () {
            no strict 'refs';
            if (defined $$digit) {
                # extract offsets of $$digit
                ...
                $digit++;
            } else {
                last;
            }
        }
        
        $code->(@- > 1 ? () : substr($string, $-[0], $+[0] - $-[0]),
                map substr($string, $-[$_], $+[$_] - $-[$_]), 1 .. $#-);
    }
        
The part I'm uneasy about is

    if (defined $$digit) {
        ...
    }

Specifically, can $2 be undefined but $3 still contain a submatch? I
vaguely remember that I had such cases but I can't reproduce them now.
If they exist, I can't use the above code and need something better. If
so, what would be a correct solution?

Thanks in advance for any pointers,
Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Mon, 8 Sep 2003 09:54:32 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: emulating @+ and @-
Message-Id: <bjhjko$ssb$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Tassilo v. Parseval
<tassilo.parseval@post.rwth-aachen.de>], who wrote in article <bjhh5k$3ib$1@nets3.rz.RWTH-Aachen.DE>:
>         push @-, index($string, $1);
>         push @+, pos($string);

>         $code->(@- > 1 ? () : substr($string, $-[0], $+[0] - $-[0]),
>                 map substr($string, $-[$_], $+[$_] - $-[$_]), 1 .. $#-);

???  What is the point of finding indices, then calling substr?  Why
not use $$_ directly?

> Specifically, can $2 be undefined but $3 still contain a submatch?

Of course:

  (a)?(b)

Hope this helps,
Ilya


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

Date: 8 Sep 2003 10:04:43 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: emulating @+ and @-
Message-Id: <bjhk7r$88p$1@mamenchi.zrz.TU-Berlin.DE>

Tassilo v. Parseval <tassilo.parseval@post.rwth-aachen.de> wrote in comp.lang.perl.misc:
> Hi,
> 
> I am currently working on something that should be backward-compatible 
> at least up to 5.00503. Unfortunately, this relies on @+ and @- which
> weren't there by that time. So I have to find a way to create and
> populate these two arrays with 5.00503. Consider the original code that

[$string =~ /($pat)/g]

> Specifically, can $2 be undefined but $3 still contain a submatch? I
> vaguely remember that I had such cases but I can't reproduce them now.
> If they exist, I can't use the above code and need something better. If
> so, what would be a correct solution?

I have vaguely asked myself that too.

It is my impression that after a successful match $1 ... $n are
always defined where n is the number of capturing parentheses in $pat.
Even if a submatch doesn't apply (as in an alternation), the corresponding
$i is empty, but defined.

The hard part is finding where this is documented.  I can't.

Anno


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

Date: Mon, 8 Sep 2003 10:30:03 +0200
From: "Dr. Peter Dintelmann" <peter.dintelmann@dresdner-bank.com>
Subject: exit() argument evaluation
Message-Id: <bjhdd2$jnv2@news-1.bank.dresdner.net>

Hi,

    perl -le 'print 4==7 ? 0 : 1'
    
produces "1" as output and

    perl -e 'die 4==7 ? 0 : 1'

produces "1 at -e line 1.". But

    perl -e 'exit 4==7 ? 0 : 1'

sets the exit code to 4 instead of 1 (using brackets around the 
argument of exit() changes this). 

Is there any reason for this behaviour?

    Peter Dintelmann



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

Date: Mon, 08 Sep 2003 09:43:43 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: exit() argument evaluation
Message-Id: <3F5C4F58.A0C4CD38@acm.org>

"Dr. Peter Dintelmann" wrote:
> 
>     perl -le 'print 4==7 ? 0 : 1'
> 
> produces "1" as output and
> 
>     perl -e 'die 4==7 ? 0 : 1'
> 
> produces "1 at -e line 1.". But
> 
>     perl -e 'exit 4==7 ? 0 : 1'
> 
> sets the exit code to 4 instead of 1 (using brackets around the
> argument of exit() changes this).
> 
> Is there any reason for this behaviour?


perldoc perlop
[snip]
           nonassoc    named unary operators
           nonassoc    < > <= >= lt gt le ge
           nonassoc    == != <=> eq ne cmp
           left        &
           left        | ^
           left        &&
           left        ||
           nonassoc    ..  ...
           right       ?:
           right       = += -= *= etc.
           left        , =>
           nonassoc    list operators (rightward)


exit (a named unary operator) has higher precedence than == while print
and die (list operators (rightward)) have lower precedence.


John
-- 
use Perl;
program
fulfillment


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

Date: Mon, 8 Sep 2003 09:43:01 +0200
From: Daniel Pfeiffer <occitan@esperanto.org>
Subject: GNU make & make.pl are dead: long live Perl makepp
Message-Id: <20030908094301.6d1e3c67.occitan@esperanto.org>

Hi,

I have so far not seen the advantage of my 100% Perl syntax - at least not =
until Emacs learns to syntax highlight the specific parts.  Since my projec=
t <http://dapfy.bei.t-online.de/make.pl/> was progressing very slowly, I to=
ok a new look at its closest competitor, makepp.  It is so much superior to=
 GNU make, that I am putting up with make's strange syntax.

Despite being written in Perl, until now it offered little access to Perl. =
 That has now changed with this patch <http://dapfy.bei.t-online.de/make.pl=
/perl.patch> and corresponding test <http://dapfy.bei.t-online.de/make.pl/p=
erl.test> I contributed to version 1.20.  With that make.pl is dead, and I =
will also contibute my builtin commands to makepp.

coralament / best Gr=F6tens / liebe Gr=FC=DFe / best regards / elkorajn sal=
utojn
Daniel Pfeiffer

-- GPL 3: take the wind out of Palladium's sails! --
 ------
  -- My other stuff here too, make.pl, sawfish...: --
   ------
    -- http://dapfy.bei.t-online.de/ --


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

Date: Mon, 08 Sep 2003 10:08:22 +0200
From: Kurt Kronschnabl <k.kronschnabl_nospm_@ica-intercom-akademie.de>
Subject: How To activate command line history in debugger?
Message-Id: <bjhde7$g22$07$1@news.t-online.com>

Hi all,


does anybody know how to enable the command line history in the debugger?

Under Suse 8.2 is it already active. Not under Knoppix 3.1/3.2.

I am a newbie in perl and don't understand the explanation in "man 
perldeb" to install Term::ReadKey and Term::Readline. I tried to create 
the file .perldb in ~ with the content
use Term::ReadKey;
use Term::Readline;
but this does not enable the history feature. BTW in the perl lib dirs 
is a ReadLine.pm but no a ReadKey.

Any hints are appreciated.

Regards, Kurt



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

Date: Mon, 08 Sep 2003 08:48:06 +0100 (BST)
From: "Dave Saville" <dave.nospam@ntlworld.com>
Subject: illegal seek
Message-Id: <qnirfnivyyragyjbeyqpbz.hkwbk62.pminews@text.news.ntlworld.com>

I was debugging a totally unrelated problem yesterday and put in a
quick and dirty print line with $! in it. Now as it happened the bit of
code I was trying to debug was not giving the error I thought it was
and so $! of course had a previous value.

What printed out was "Illegal Seek" - looking backwards I found a "seek
HANDLE,0,0; Now I have never seen any code where the return from seek
is checked although I guess it should be :-)

The actual code is as follows:

open LIST, "<$clean_username" or die "$clean_username $!";
flock LIST, $LOCK_EX;
seek LIST, 0, 0;

I had read that one should re seek after flock in case another process
modified the file between you opening it and flock coming back with the
exclusive lock.

Or does seek give an error if it is already where one wants to seek to?

TIA


Regards

Dave Saville

NB switch saville for nospam in address




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

Date: Mon, 8 Sep 2003 10:01:43 +0100
From: news@roaima.freeserve.co.uk
Subject: Re: illegal seek
Message-Id: <n4tt21-tom.ln1@moldev.cmagroup.co.uk>

Dave Saville <dave.nospam@ntlworld.com> wrote:
> What printed out was "Illegal Seek" - looking backwards I found a "seek
> HANDLE,0,0

The error value is only set on an error: it's never implicitly reset. So,
can you be sure that this is the relevant seek that generated the
error? What happened when you /did/ check the return value from it?

> The actual code is as follows:

> open LIST, "<$clean_username" or die "$clean_username $!";

The "<" is implicit, and so can be omitted. This leaves a quoted simple
variable, so the quotes can now also be stripped:

	open LIST, $clean_username or die "can't open $clean_username: $!";

> flock LIST, $LOCK_EX;

Depending on the underlying implementation of flock and your cross
platform requirements, you cannot /guarantee/ an exclusive lock with
read-only file access. (Mostly it will work, but just be aware...)

> seek LIST, 0, 0;

> I had read that one should re seek after flock in case another process
> modified the file between you opening it and flock coming back with the
> exclusive lock.

You usually need a seek (even if it's to the current position, ick!) when
changing from reading to writing on the same file, as this flushes the
I/O buffers. However, if you've not read anything then there's no point
in rewinding the stream as it's already there. A flock is applied to the
entire file, not just to a section, so when you get the lock you've got
the file in its entirety.

> Or does seek give an error if it is already where one wants to seek to?

No, it's quite happy with that. What it does object to is trying to seek
on a pipe (e.g. stdin) or non-seekable device (e.g. tape). Maybe your
file $clean_username is actually a named pipe?

Cheers,
Chris
-- 
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}


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

Date: 8 Sep 2003 09:23:21 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: illegal seek
Message-Id: <bjhhq9$6oi$1@mamenchi.zrz.TU-Berlin.DE>

Dave Saville <dave.nospam@ntlworld.com> wrote in comp.lang.perl.misc:
> I was debugging a totally unrelated problem yesterday and put in a
> quick and dirty print line with $! in it. Now as it happened the bit of
> code I was trying to debug was not giving the error I thought it was
> and so $! of course had a previous value.
> 
> What printed out was "Illegal Seek" - looking backwards I found a "seek
> HANDLE,0,0;

$! is meaningless, unless immediately after the return from an
failed system call.  The "Illegal seek" value may or may not come
from the call in your code, nobody knows.

>              Now I have never seen any code where the return from seek
> is checked although I guess it should be :-)

Then you haven't seen enough code.  Of course you must check seek() if
it's important.  You also ought to check the flock() call.

> The actual code is as follows:
> 
> open LIST, "<$clean_username" or die "$clean_username $!";
> flock LIST, $LOCK_EX;

"$LOCK_EX" looks fishy.  The constant exported by Fcntl.pm is "LOCK_EX".
Are you sure this is literally your code?

Anyway, you don't want an exclusive lock on a read-only file.  Many
systems (Solaris, for instance) won't even give you one.  That's one
of the reasons why it's important to check the call to flock().

> seek LIST, 0, 0;
> 
> I had read that one should re seek after flock in case another process
> modified the file between you opening it and flock coming back with the
> exclusive lock.

That's okay, though your code has bigger problems.

> Or does seek give an error if it is already where one wants to seek to?

No.  But, as noted,  forget about the error code, it can come from
anywhere.

Anno


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

Date: Mon, 08 Sep 2003 08:50:13 +0100
From: sprint@pilot.net
Subject: LWP and gzip
Message-Id: <rvcolvootvpdunblk55jpgc28qbivb54s7@4ax.com>

New to perl and experimenting with LWP.

However I have come across some website content that comes down as
"content-encoding: gzip" followed by a few hundred bytes of
gobbledegook. 

Can someone point me to some sample code to de-crypt this on the fly,
please

Thanks 


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

Date: 8 Sep 2003 08:06:37 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: LWP and gzip
Message-Id: <slrnbloe4d.npm.sholden@flexal.cs.usyd.edu.au>

On Mon, 08 Sep 2003 08:50:13 +0100, sprint@pilot.net <sprint@pilot.net> wrote:
> New to perl and experimenting with LWP.
> 
> However I have come across some website content that comes down as
> "content-encoding: gzip" followed by a few hundred bytes of
> gobbledegook. 
> 
> Can someone point me to some sample code to de-crypt this on the fly,
> please

I'd guess that the uncompress function in Compress::Zlib might do the trick.

However, it seems a bit "rude" for a web server to send gzip encoded
stuff unless you specified it in the Accept-Encoding header of the request.

-- 
Sam Holden



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

Date: Mon, 8 Sep 2003 18:12:40 +1000
From: "Gregory Toomey" <NOSPAM@bigpond.com>
Subject: Re: LWP and gzip
Message-Id: <bjhdlt$j1v1l$1@ID-202028.news.uni-berlin.de>

<sprint@pilot.net> wrote in message
news:rvcolvootvpdunblk55jpgc28qbivb54s7@4ax.com...
> New to perl and experimenting with LWP.
>
> However I have come across some website content that comes down as
> "content-encoding: gzip" followed by a few hundred bytes of
> gobbledegook.
>
> Can someone point me to some sample code to de-crypt this on the fly,
> please
>
> Thanks

You are proabably downloading a file stored in zip format on the server.
Archive::zip (available from www.cpan.org) works with plain zip files.

On Linux I would call the Linux utilities "gunzip" or "zcat", using the Perl
"system" command, to unzip the file.

gtoomey




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

Date: Mon, 8 Sep 2003 10:12:27 +0100
From: news@roaima.freeserve.co.uk
Subject: Re: LWP and gzip
Message-Id: <rott21-tom.ln1@moldev.cmagroup.co.uk>

sprint@pilot.net wrote:
> However I have come across some website content that comes down as
> "content-encoding: gzip" followed by a few hundred bytes of
> gobbledegook. 

The webserver shouldn't provide content with gzip encoding unless your
client has offered that capability. Complain to the website provider.

> Can someone point me to some sample code to de-crypt this on the fly,
> please

Feed the data content through one of the many gzip modules
(e.g. Compress:Zlib or maybe PerlIO::gzip) to uncompress it.

Chris
-- 
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}


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

Date: Mon, 8 Sep 2003 00:21:32 -0700
From: "Trent Curry" <tcurrey@no.no.no.i.said.no>
Subject: Re: Newby Question: Displaying Excel from within my CGI
Message-Id: <bjhaq3$lm3$1@news.astound.net>

"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:bjgepo$iovdq$1@ID-184292.news.uni-berlin.de...
> Cyde Weys wrote:
> > Gunnar Hjalmarsson wrote:
> >> CGI ... Postgres ... Excel ...
> >>
> >> Do you have a Perl question?
> >
> > Maybe he wanted to do it with Perl (That's the unspoken assumption
> > I garnered from his post, anyway).
>
> Really? :)  The reason why I pretended not to 'understand' is that
> OP's "How can this be done?" doesn't indicate that he had made any own
> attempt to find a solution. Such as a simple search for 'Excel' at
> search.cpan.org...

Well, he is posting this in a Perl group, so one could assume he meant in
Perl. As for weather or not he did any prior homework, well I think its a
bit inconclusive.

> Maybe that's just me, but I think it's reasonable to expect some own
> effort before asking for help here.

How do we know this isn't his last desperate attempt? This doesn't seem like
something trivial and while Excel itself may be off topic, there could be
something in Perl that can be of some relation, say creating a tab delimited
file that can be easily made into an Excel spread sheet. But that would not
make it directly related, and may not be what the OP is looking for.




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

Date: Mon, 08 Sep 2003 09:56:24 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Newby Question: Displaying Excel from within my CGI
Message-Id: <bjhctm$j0ffm$1@ID-184292.news.uni-berlin.de>

Trent Curry wrote:
> "Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message 
> news:bjgepo$iovdq$1@ID-184292.news.uni-berlin.de...
>> OP's "How can this be done?" doesn't indicate that he had made
>> any own attempt to find a solution. Such as a simple search for
>> 'Excel' at search.cpan.org...
> 
> ... weather or not he did any prior homework, well I think its a 
> bit inconclusive.

<snip>

> How do we know this isn't his last desperate attempt? This doesn't
> seem like something trivial and while Excel itself may be off
> topic, there could be something in Perl that can be of some
> relation,

There sure is. If he had made just a little effort to look for it (see
above), he would have found it. And if the difficulties had been about
how to make use of an adequate module, he would at least have
mentioned it.

"Last" attempt? Don't think so.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Mon, 8 Sep 2003 02:04:35 -0700
From: "Trent Curry" <tcurrey@no.no.no.i.said.no>
Subject: Re: Newby Question: Displaying Excel from within my CGI
Message-Id: <bjhgr9$m1r$1@news.astound.net>

"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:bjhctm$j0ffm$1@ID-184292.news.uni-berlin.de...
> Trent Curry wrote:
> > "Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
> > news:bjgepo$iovdq$1@ID-184292.news.uni-berlin.de...
> >> OP's "How can this be done?" doesn't indicate that he had made
> >> any own attempt to find a solution. Such as a simple search for
> >> 'Excel' at search.cpan.org...
> >
> > ... weather or not he did any prior homework, well I think its a
> > bit inconclusive.
>
> <snip>

My mistake. Running a quick query @ search.cpan.org yields a sizable list of
results ;p

> > How do we know this isn't his last desperate attempt? This doesn't
> > seem like something trivial and while Excel itself may be off
> > topic, there could be something in Perl that can be of some
> > relation,
>
> There sure is. If he had made just a little effort to look for it (see
> above), he would have found it. And if the difficulties had been about
> how to make use of an adequate module, he would at least have
> mentioned it.

I stand corrected.

> "Last" attempt? Don't think so.

No arg there. I completely over looked the reference cpan in your post. I
was sort of assuming he had been there and didn't think anything of it.
Thanks for correcting that :)




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

Date: 8 Sep 2003 01:13:37 -0700
From: eric.chin@pinnacle.co.uk (Eric)
Subject: Re: NT: perl 5.8.0: system call - commnad split into multiple line ?
Message-Id: <d8c847cd.0309080013.508e0cc0@posting.google.com>

Thankyou. I learn something today and I have a long way to go before I
get to know perl :)

Eric

"David K. Wall" <usenet@dwall.fastmail.fm> wrote in message news:<Xns93ED7AC20B8C6dkwwashere@216.168.3.30>...
> Eric <eric.chin@pinnacle.co.uk> wrote:
> 
> > Greetings,
> > 
> > I am fairly new to Perl. I downloaded Perl 5.8.0 for NT/Win2000
> > platform.
> > 
> > I want to copy file from server1 to server2 using robocopy. In my
> > perl script:
> > 
> 
> For your own safety and sanity, enable strict and warnings:
> 
>     use strict;
>     use warnings;
> 
> Among other things, 'strict' will force you to declare your 
> variables, and warnings will tell you about all sorts of real and 
> potential errors.  Unless you have a good reason otherwise, these two 
> statements should start all your programs.  
> 
> > $datenow = `date /T`;
> 
> $datenow has a newline on the end of it.  (Actually CR-LF since this 
> is windows, but never mind.)
> 
> > ($day,$mth,$yr) = split /\//, $datenow;
> 
> Now $yr has a newline on the end of it.
> 
> Instead of calling an external program, it's usually easier to use 
> Perl's localtime() function.
> 
>     my ($day, $mth, $yr) = (localtime)[3,4,5];
>     $yr += 1900;  
>     $mth++;
> 
> perldoc -f localtime
> 
> > $src = "\\\\server1\\d1\\$yr\\$mth";
> > $dest = "\\\\server2\\d2\$yr\\$mth";
> > $swth = "\/r:1 \/w:5 \/MIR";
> 
> There's no need to escape the forward-slashes here.  You're not 
> inside a slash-delimited regex.
> 
> > $comm = "robocopy $src\\$yr\\$mth $dest\\$yr\\$nth $swth";
> 
> If you had enabled strict or warnings (or both), perl would have 
> given you an error message when you tried to use $nth.
> 
> > print "system($comm)";
> > 
> > When I checks the system($comm) construct using print, it shows
> > the $comm string in multiple lines. For example:
> > 
> > system(robocopy \\server1\d1\2003
> > \09 \\server2\d2\2003
> > \09 /r:1 /w:5 /MIR)
> 
> Yes, right after each place where you use $yr.
> 
> > Is there any way to get the $comm string into one line ? I believe
> > because it split into multiple line, robocopy gets the parameter
> > wrong and therefore won't work.
> 
> No, it's because `date /t` returns a string with a newline on the 
> end.


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

Date: 8 Sep 2003 01:40:07 -0700
From: ronaldf@eml.cc (Ronald Fischer)
Subject: perldoc can't display doc
Message-Id: <219750c.0309080040.2f36d379@posting.google.com>

I'm running Perl 5.8 under cygwin. When I do something like

perldoc IO::File

I get the error message

Ignored /usr/lib/perl5/5.8.0/cygwin-multi-64int/IO/File.pm: unreadable
No documentation found for "IO::File".

Although the file /usr/lib/perl5/5.8.0/cygwin-multi-64int/IO/File.pm
is clearly readable.

When I do a

perldoc -f open

I get the error message

Ignored /usr/lib/perl5/5.8.0/pods/perlfunc.pod: unreadable
No documentation found for "perlfunc".

In fact, I can't get at any documentation with perldoc.

Any suggestions?


Ronald


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

Date: Mon, 08 Sep 2003 08:50:26 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: perldoc can't display doc
Message-Id: <4kgolv4bpk69tj0pvnnsn0c9vvirobve1t@4ax.com>

Ronald Fischer wrote:

>I'm running Perl 5.8 under cygwin. When I do something like
>
>perldoc IO::File
>
>I get the error message
>
>Ignored /usr/lib/perl5/5.8.0/cygwin-multi-64int/IO/File.pm: unreadable
>No documentation found for "IO::File".
>
>Although the file /usr/lib/perl5/5.8.0/cygwin-multi-64int/IO/File.pm
>is clearly readable.
 ...
>In fact, I can't get at any documentation with perldoc.

Check out the file permissions under that file tree. I'm assuming Cygwin
does at least some attempt in emulating Unix in that regard.

   HTH,
   Bart.


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

Date: Mon, 08 Sep 2003 18:14:58 +0900
From: ko <kuujinbo@hotmail.com>
Subject: Re: perldoc can't display doc
Message-Id: <bjhhcp$f6d$1@pin3.tky.plala.or.jp>

Ronald Fischer wrote:
> I'm running Perl 5.8 under cygwin. When I do something like
> 
> perldoc IO::File
> 
> I get the error message
> 
> Ignored /usr/lib/perl5/5.8.0/cygwin-multi-64int/IO/File.pm: unreadable
> No documentation found for "IO::File".
> 
> Although the file /usr/lib/perl5/5.8.0/cygwin-multi-64int/IO/File.pm
> is clearly readable.
> 
> When I do a
> 
> perldoc -f open
> 
> I get the error message
> 
> Ignored /usr/lib/perl5/5.8.0/pods/perlfunc.pod: unreadable
> No documentation found for "perlfunc".
> 
> In fact, I can't get at any documentation with perldoc.
> 
> Any suggestions?
> 
> 
> Ronald

You might want to double-check that the 'perl_manpages' are installed. 
When you run cygwin setup (Select Packages) it is listed under 'Docs' 
category. Not 100% sure, but I don't think it is installed by default.

HTH - keith



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

Date: Mon, 08 Sep 2003 10:35:00 +0100
From: JS <vervoom@hotmail.com>
Subject: simple regex problem
Message-Id: <bjhihj$nsq$1@cspc1n11.baplc.com>

Hi,

I'm trying to build a regex to put the department name into a variable 
$dept and the rest of the line into another variable $stats:

E-Test			3	-	4	-
Health and Safety       -       1       1	-
Finance                 -       3       -       -

This is my regex:

($dept,$stats)=/^(.[^\s-|\d]*)\s+(.*)/;

but it doesn't work because of the \s- is not actually handled as a 
string, but individual charaters.

Can anyone fix this for me please?

Thanks,

JS.



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

Date: Mon, 08 Sep 2003 09:50:03 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: simple regex problem
Message-Id: <3F5C50D4.347B0881@acm.org>

JS wrote:
> 
> I'm trying to build a regex to put the department name into a variable
> $dept and the rest of the line into another variable $stats:
> 
> E-Test                  3       -       4       -
> Health and Safety       -       1       1       -
> Finance                 -       3       -       -
> 
> This is my regex:
> 
> ($dept,$stats)=/^(.[^\s-|\d]*)\s+(.*)/;
> 
> but it doesn't work because of the \s- is not actually handled as a
> string, but individual charaters.
> 
> Can anyone fix this for me please?


my ( $dept, $stats ) = unpack 'A24 A*', $_;



John
-- 
use Perl;
program
fulfillment


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

Date: Mon, 08 Sep 2003 12:00:04 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: simple regex problem
Message-Id: <bjhjuo$ink19$1@ID-184292.news.uni-berlin.de>

John W. Krahn wrote:
> JS wrote:
>> I'm trying to build a regex to put the department name into a
>> variable $dept and the rest of the line into another variable
>> $stats:
>> 
>>E-Test                  3       -       4       -
>>Health and Safety       -       1       1       -
>>Finance                 -       3       -       -
> 
> my ( $dept, $stats ) = unpack 'A24 A*', $_;

That doesn't work for the E-Test line. How about:

     my ($dept, $stats) = /(.+[a-z])\s+(.*)/;

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Mon, 08 Sep 2003 11:56:49 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: Re: simple regex problem
Message-Id: <qckolvkl31t1bl17cr0f0ltn04qugptsv6@4ax.com>

On Mon, 08 Sep 2003 10:35:00 +0100, JS <vervoom@hotmail.com> wrote:

>I'm trying to build a regex to put the department name into a variable 
>$dept and the rest of the line into another variable $stats:
>
>E-Test			3	-	4	-
>Health and Safety       -       1       1	-
>Finance                 -       3       -       -
>
>This is my regex:
>
>($dept,$stats)=/^(.[^\s-|\d]*)\s+(.*)/;

untested,

my ($dept, $stats) = /(.+?[\d-]+)\s+(.*)/;




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

Date: Mon, 08 Sep 2003 11:02:39 +0100
From: JS <vervoom@hotmail.com>
To: "John W. Krahn" <krahnj@acm.org>
Subject: Re: simple regex problem
Message-Id: <3F5C53BF.4030604@hotmail.com>

John W. Krahn wrote:
> JS wrote:
> 
>>I'm trying to build a regex to put the department name into a variable
>>$dept and the rest of the line into another variable $stats:
>>
>>E-Test                  3       -       4       -
>>Health and Safety       -       1       1       -
>>Finance                 -       3       -       -
>>
>>This is my regex:
>>
>>($dept,$stats)=/^(.[^\s-|\d]*)\s+(.*)/;
>>
>>but it doesn't work because of the \s- is not actually handled as a
>>string, but individual charaters.
>>
>>Can anyone fix this for me please?
> 
> 
> 
> my ( $dept, $stats ) = unpack 'A24 A*', $_;
> 
> 
> 
> John

Thanks John,

The problem with that is if the dept name is longer than 24 characters e.g:

Customer Service International




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

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.

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 V10 Issue 5461
***************************************


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