[9906] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3499 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 21 09:07:21 1998

Date: Fri, 21 Aug 98 06:00:49 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 21 Aug 1998     Volume: 8 Number: 3499

Today's topics:
        [Upgrade Prob] 5.005 causes "to late for -T" errors in  Matthew.Wickline@usa.net
        binding operator (=~) with variables ? <Jehan.Procaccia@inapg.inra.fr>
    Re: binding operator (=~) with variables ? <rick.delaney@shaw.wave.ca>
    Re: Call another perl script? <versace@gianni.com>
        characters convert implicitly on output! (was: write st RonnyAtWork@imstressed.com
    Re: characters convert implicitly on output! (was: writ (Orjan Stromberg)
    Re: Coderef as hash-index (Ilya Zakharevich)
    Re: Converting to lowecase (M.J.T. Guy)
    Re: Easy regx please help.... huntersean@hotmail.com
        Exec() with Perl 5005_02 under WindowsNT <juerg.herren@alcatel.ch>
    Re: Exec() with Perl 5005_02 under WindowsNT huntersean@hotmail.com
    Re: Greedy arrays in list assignments (Craig Berry)
    Re: HELP: split <versace@gianni.com>
        How to get data from Access-Database via CGI <info@kptkip.com>
    Re: Is Perl5.004 Year 2000 compilant? dave@mag-sol.com
    Re: Is Perl5.004 Year 2000 compilant? huntersean@hotmail.com
    Re: Is Perl5.004 Year 2000 compilant? <maps.on@no.spam>
        Looking for help <goetschalckx.raf@glo.be>
        Overstrike problem with xdvi <rosenkranz@mathconsult.co.at>
        Perl Docs.. forget the original post <simon@new-mediacom.com>
    Re: PREFIX in MakeMaker (Ilya Zakharevich)
        Q: Sliding Window Sort With Perl? <faerber@ind.uni-stuttgart.de>
        Script wanted to change /etc/passwd passwords. <bigbro@dmrt.nl>
        Send cmd and Receive result from command? <versace@gianni.com>
    Re: Send cmd and Receive result from command? (Sam Holden)
    Re: server config error or script error? <barnett@houston.Geco-Prakla.slb.com>
        Strange characters while writing in files joumdane@hotmail.com
    Re: Stumped! Need help! huntersean@hotmail.com
    Re: Using Perl module without access to Perl installati <rra@stanford.edu>
        why doesn't this work as expected... newsgrp@business-heaven.com
    Re: why doesn't this work as expected... <rick.delaney@shaw.wave.ca>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 21 Aug 1998 12:43:32 GMT
From: Matthew.Wickline@usa.net
Subject: [Upgrade Prob] 5.005 causes "to late for -T" errors in scripts
Message-Id: <6rjq1k$6lo$1@nnrp1.dejanews.com>

Greetings. :)


My sysadmin just upgraded from 5.003 to version 5.005_01 built for
sun4-solaris and since that upgrade (that was the *only* variable involved)
all of my taint checking scripts have broken with the ``Too late for "-T"
option'' error.

I've read perldiag.
My #! did have -wT before, so I tried -Tw and then -T -w and then just -T
Still fails perl -c

Does anyone have any ideas about how I can re-gain the ability to -T? My
sysadmin is not a big perl guy, so I'm hoping y'all will be able to help out.
Are there any relevant options when building perl?

Can anyone think of some possible relevant issues?

Note that the updrade was from 5.003 (three, not four) to 5.005. Maybe
everyone else ran into some obscurely related upgrade problem when moving to
5.004 and adjusted to that so that they never saw the thing I'm seeing...?

Anyone have any clues? I don't :/

(as I read usenet via dejanews, I'd appreciate e-mail cc, as it will let me
read  your responses before they process into dejanews' database. TIA :)

-matt

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


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

Date: Fri, 21 Aug 1998 14:04:29 +0200
From: Jehan Procaccia <Jehan.Procaccia@inapg.inra.fr>
Subject: binding operator (=~) with variables ?
Message-Id: <35DD624D.E121ACE4@inapg.inra.fr>

I want to match a pattern in a string line using a variable as the
pattern:

$line="hello disney";
$line2="hello happydisneyland";
$var="disney";
if ($line =~ /$var/)
    then .... # match is OK :-)  this is what I want

if ($line2 =~ /$var/)
    then .... # match is also OK   :-(  this is not what I want

I want an exact match

I am trying to use pattern matching operators like "starting with" : ^
operator and "ending with" $ operator but it doesn't seem to work while
using a variable in the pattern:
$line =~ /^$var/
$line =~/^$$var/ .... nothing works :-(

jehan@inapg.inra.fr



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

Date: Fri, 21 Aug 1998 12:34:31 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: binding operator (=~) with variables ?
Message-Id: <35DD6AD1.E3CCC965@shaw.wave.ca>

[posted and mailed]

Jehan Procaccia wrote:
> 
> $line="hello disney";
> $line2="hello happydisneyland";
> $var="disney";
[snip] 
> I want an exact match
> 

No, you want a full word match.  For an exact match, you should use eq.

    /\b$var\b/;

Read about the wonderful adventures of \b in perlre.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Fri, 21 Aug 1998 15:16:24 +0800
From: 8\(F&@ <versace@gianni.com>
Subject: Re: Call another perl script?
Message-Id: <35DD1EC8.2B88@gianni.com>

Thanks and can I pass the variable to the called scripts?  E.g. Can I
still get $function == "a" in a.pl?

Tad McClellan wrote:
> 
> 8\(F&@ (versace@gianni.com) wrote:
> : Hi all,
> 
> : I have writen 3 perl cgi scripts for different functions, say a.pl, b.pl
> : and c.pl.  Now, I would like to write another perl script to dispatch to
> : a.pl, b.pl or c.pl depends on the function passed in. E.g
> 
> : if ($function eq "a") {
> :       call a.pl
> : } elsif ($function eq "b") {
> :       call b.pl
> : } elsif ($function eq "c") {
> :       call c.pl
> : }
> 
>    perldoc -f system
> 
> --
>     Tad McClellan                          SGML Consulting
>     tadmc@metronet.com                     Perl programming
>     Fort Worth, Texas


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

Date: Fri, 21 Aug 1998 07:13:21 GMT
From: RonnyAtWork@imstressed.com
To: connor@tekla.ing.umu.se
Subject: characters convert implicitly on output! (was: write stripping chars)
Message-Id: <6rj6mh$hb9$1@nnrp1.dejanews.com>

In article <slrn6tkuub.f92.connor@tekla.ing.umu.se>,
  connor@tekla.ing.umu.se (Orjan Stromberg) wrote:
> to print some variables with it. The problem seems to be that the
> variables contain ANSI sequences, in particular, colours. The literal
> ESC seems to be stripped off by write. Is this normal behaviour?

There seems to be indeed a bug in Perl, or at least in some early versions
of Perl, although I could not reproduce the behaviour you experienced.
I tried your example with Perl 5.000 and found that ESC is turned into
0x30, not stripped off, when output. For example, the command

   perl -e 'print (sprintf %c,27)'| od -h

displays

   0000000 3000
   0000001

In case you are not familiar with od - you did not write which platform you
are running perl on -, note that the important part in the output is the '30':
It is the hex code of what Perl turned Escape into.

This seems to apply to control characters in general. Here is another test,
more closely modeled after your example:

#!/usr/local/bin/perl
$esc=sprintf %c,27;
print $esc,"abc";
format STDOUT =
@<<<<<<<<
$test
 .

$test = $esc.(sprintf %c, 11).(sprintf %c,4)."xyz";
write;

Calling this program 'et', I typed

   et|od -h

and got

   0000000 3061 6263 3030 3078 797a 0a00
   0000013

As you can see, not only escape, but also the characters with code 11 (0x0B)
and 4 are turned into 0x30.

But now comes the crazy part: When writing the test program, the very first
execution of et|od -h produced 1B61 6263 3030 etc., that is: the first escape
was output *correctly*, while the other ones turned into 0x30. I could never
reproduce this, and I would not believe it if I  did not still see it in my
window!!!

Does anyone has any explanation for this? Could someone repeat this test
with a more recent version of Perl?

Ronald
(This message mailed AND posted)
--
Ronald Fischer <RonnyAtWork@imstressed.com>
http:///ourworld.compuserve.com/homepages/ronald_fischer

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


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

Date: 21 Aug 1998 08:37:37 GMT
From: connor@tekla.ing.umu.se (Orjan Stromberg)
Subject: Re: characters convert implicitly on output! (was: write stripping chars)
Message-Id: <slrn6tqcei.r5o.connor@tekla.ing.umu.se>

On Fri, 21 Aug 1998 07:13:21 GMT, RonnyAtWork@imstressed.com
<RonnyAtWork@imstressed.com> wrote:
> In article <slrn6tkuub.f92.connor@tekla.ing.umu.se>,
>   connor@tekla.ing.umu.se (Orjan Stromberg) wrote:
> > to print some variables with it. The problem seems to be that the
> > variables contain ANSI sequences, in particular, colours. The literal
> > ESC seems to be stripped off by write. Is this normal behaviour?

[snip]

> This seems to apply to control characters in general. Here is another test,
> more closely modeled after your example:
> 
> #!/usr/local/bin/perl
> $esc=sprintf %c,27;
> print $esc,"abc";
> format STDOUT =
> @<<<<<<<<
> $test
> .
> 
> $test = $esc.(sprintf %c, 11).(sprintf %c,4)."xyz";
> write;
> 
> Calling this program 'et', I typed
> 
>    et|od -h
> 
> and got
> 
>    0000000 3061 6263 3030 3078 797a 0a00
>    0000013
>
> As you can see, not only escape, but also the characters with code 11 (0x0B)
> and 4 are turned into 0x30.

Well, barring an endian difference, I get the exact same output, both
from perl version 5.003 and 5.004, so if it indeed is a bug, it's not
been fixed.

Well, I got around my original problem by making my own little
padding, since I was doing nothing particularly difficult, but it
would be interesting to know why perl behaves this way.

  /Orjan

--
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
My house is made out of balsa wood, so when I want to scare the 
neighborhood kids I lift it over my head and tell them to get out
of my yard or I'll throw it at them.
                                                            Stephen Wright
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


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

Date: 21 Aug 1998 08:56:36 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Coderef as hash-index
Message-Id: <6rjco4$cps$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Greg Bacon
<gbacon@cs.uah.edu>],
who wrote in article <6rhh8h$l8t$1@info.uah.edu>:
> Right.  It's important to remember that hash keys are strings (not
> scalars, just simple strings).  

 ... unless the hash is tied.  Which allows to create a simple
"interface" with the-stringified-value-to-actual-ref hash behind the
scene.

> I believe someone (gsar?) wrote a Tie::RefHash module, but I can't
> seem to find it on the CPAN.  It did a little behind the scenes magic
> to allow you to use references as hash keys without the trouble you've
> encountered.

See above.

Ilya


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

Date: 21 Aug 1998 10:04:48 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Converting to lowecase
Message-Id: <6rjgo0$apa$1@pegasus.csx.cam.ac.uk>

Scott Erickson <Scott.L.Erickson@HealthPartners.com> wrote:
>
>Not necessarily true. The sysadmin who installed Perl on my system,
>for whatever reason, did not install perldoc. Eventually it was
>installed, but, please, do not assume that if you have perl, you have
>perldoc

But the standard install procedure always installs perldoc (at least on
Unix platforms  -  dunno about the rest).    So if you don't have
perldoc, you don't have a correctly installed Perl.


Mike Guy


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

Date: Fri, 21 Aug 1998 10:32:39 GMT
From: huntersean@hotmail.com
Subject: Re: Easy regx please help....
Message-Id: <6rjic8$v3u$1@nnrp1.dejanews.com>

In article <6rhvci$1vb$1@nnrp1.dejanews.com>,
  chad@gurucom.net wrote:
> I know this is essy, but i keep screwing it up could someone please give me
> the regx to parse this line.  thanks.
>
> $line = '<a href="http://i.am.stupid.com/index.html">Yes that's me</a>';
>
> this is what I want:
>
> ($link, $title) = ( $line =~ /(?)(?)/; }

($link, $title) = $line =~ m|<a href="(.*?)">(.*?)</a>|i ;

>
> -thanks chad

It's a pleasure

Sean H

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


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

Date: Fri, 21 Aug 1998 10:07:30 +0200
From: Juerg Herren <juerg.herren@alcatel.ch>
Subject: Exec() with Perl 5005_02 under WindowsNT
Message-Id: <35DD2AC2.157F2E4@alcatel.ch>

I'm working with Perl 5005_02 under WindowsNT 4.0

I'd like to run a exe file (written in c++) from a perlScript. I made a
small Testprogram that prints a line and returns with "return 13;"

The call is OK (my program prints this line) but after the return also
my perlScript dies.

1. Before I worked with perl version 5.003_07. The same program BUT it
doesn't die after return !!!

Why this different ?

2. I tried to work with fork();exec(); and wait();.
-> "The unsupported function fork function..."

3. Now I'd like to download the perl sourcecode because I read that I
will be able then to use fork(),...
? Where can I get the sourceCode ??
? Or is there another possibility to start an exeFile ??

Thanks a lot
    Juerg Herren





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

Date: Fri, 21 Aug 1998 10:40:05 GMT
From: huntersean@hotmail.com
Subject: Re: Exec() with Perl 5005_02 under WindowsNT
Message-Id: <6rjiq6$vbp$1@nnrp1.dejanews.com>

In article <35DD2AC2.157F2E4@alcatel.ch>,
  Juerg Herren <juerg.herren@alcatel.ch> wrote:
> I'm working with Perl 5005_02 under WindowsNT 4.0
>
> I'd like to run a exe file (written in c++) from a perlScript. I made a
> small Testprogram that prints a line and returns with "return 13;"
>
> The call is OK (my program prints this line) but after the return also
> my perlScript dies.
>
> 1. Before I worked with perl version 5.003_07. The same program BUT it
> doesn't die after return !!!
>
> Why this different ?
>
> 2. I tried to work with fork();exec(); and wait();.
> -> "The unsupported function fork function..."
>
> 3. Now I'd like to download the perl sourcecode because I read that I
> will be able then to use fork(),...
> ? Where can I get the sourceCode ??
> ? Or is there another possibility to start an exeFile ??
>
> Thanks a lot
>     Juerg Herren
>
>
I think you need `` (backticks) or system().  NT doesn't have a fork() system
call (AFAIK)

Sean Hunter

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


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

Date: 21 Aug 1998 05:25:58 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Greedy arrays in list assignments
Message-Id: <6rj0d6$jpv$1@marina.cinenet.net>

Josh Kortbein (kortbein@iastate.edu) wrote:
: Craig Berry (cberry@cinenet.net) wrote:
: : Can't imagine how it could be in a consistent way.  After all, how would
: : one handle
: 
: :   (@foo, $bar, @baz) = split //, 'abcde';
: 
: : in any such general scheme?  I suppose you could limit it to cases with
: : at most one array in the list, count scalars following the array, and work
: : backward...but that seems horribly awkward.
: 
: It seems more consistent (in my limited experience) to treat the
: LHS as a flattened array, and distribute the split values left-to-right
: until one side runs out.

Well, if I'm understanding you correctly, that's how Perl does it -- with
the implicit effect that the first array mentioned on the LHS absorbs all
remaining values produced by the RHS.  I agree that's the Right Thing to
Do; my comments were regarding a query by another poster regarding
possible alternatives.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Fri, 21 Aug 1998 15:17:54 +0800
From: 8\(F&@ <versace@gianni.com>
Subject: Re: HELP: split
Message-Id: <35DD1F22.2EBD@gianni.com>

Many Thanks!

Jonathan Feinberg wrote:
> 
> 8\(F&@ <versace@gianni.com> writes:
> 
> > $_ = "AAA BBB CCC,DDD EEE FFF,"John, William",GGG III JJJ";
> 
> You want the Text::CSV module, available at the CPAN.
> 
> --
> Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
> http://pobox.com/~jdf/


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

Date: Fri, 21 Aug 1998 14:54:24 +0100
From: "Alexander Marquart" <info@kptkip.com>
Subject: How to get data from Access-Database via CGI
Message-Id: <6rjqih$jgg$1@sun579.rz.ruhr-uni-bochum.de>

Hello there!

I4ve got the problem to connect our Web-Server via CGI to the data on our
Access- Server.

Does anybody know if it is possible to get the data out of the database with
CGI to implement these in my HTML-pages?


For any hint, how to realize this or for any information, where to get
further details to solve this problem i would be very kind.


Thanks a lot and cu here soon!



Alex





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

Date: Fri, 21 Aug 1998 08:28:47 GMT
From: dave@mag-sol.com
Subject: Re: Is Perl5.004 Year 2000 compilant?
Message-Id: <6rjb3u$mq9$1@nnrp1.dejanews.com>

In article <35DB58C1.53FBD166@bctel.net>,
  Jeff Gao <jeff_gao@bctel.net> wrote:
> Does anybody know that whether perl 5.004 is y2k compilant?

I think you'll find that anyone who has read the Perl FAQ or this newsgroup
over the last few months or has done any of the obvious searches on DejaNews
will be well aware whether or not Perl 5.004 is y2k compliant.

Dave...

--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>

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


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

Date: Fri, 21 Aug 1998 10:36:12 GMT
From: huntersean@hotmail.com
Subject: Re: Is Perl5.004 Year 2000 compilant?
Message-Id: <6rjiis$v9t$1@nnrp1.dejanews.com>

In article <35DB58C1.53FBD166@bctel.net>,
  Jeff Gao <jeff_gao@bctel.net> wrote:
> Does anybody know that whether perl 5.004 is y2k compilant?
>
> Thanks
>
> --
> Jeff Gao
>
>
Yawn! Yes.

Sean H

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


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

Date: Fri, 21 Aug 1998 13:15:31 +0200
From: Geert Roovers <maps.on@no.spam>
Subject: Re: Is Perl5.004 Year 2000 compilant?
Message-Id: <35DD56D3.41122B94@no.spam>

Yes, anybody knows wether perl 5.004 is y2k compliant.

Geert

Jeff Gao wrote:
> 
> Does anybody know that whether perl 5.004 is y2k compilant?
> 
> Thanks
> 
> --
> Jeff Gao


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

Date: Fri, 21 Aug 1998 14:09:09 +0200
From: "Rafg" <goetschalckx.raf@glo.be>
Subject: Looking for help
Message-Id: <6rjo2c$gpc$1@trex.antw.online.be>

Hi,
I'm looking for someone to built a search engine on my site.
You can contact me thru the adress below.
yours,
rafg
--
_________________________________________
R A F G
rafg@eudoramail.com
ICQ UIN: 10844120




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

Date: Fri, 21 Aug 1998 11:12:23 +0200
From: Markus Rosenkranz <rosenkranz@mathconsult.co.at>
Subject: Overstrike problem with xdvi
Message-Id: <35DD39F7.167E@mathconsult.co.at>

> I use xdvi +copy and it works perfectly.
That's fine for you.  It does not work in my case.  But it displays a
mysterious warning that I do not understand:

  marcus@merlot:~$ xdvi +copy misc/sample2e 
  Warning: Cannot convert string "on !# ignored" to type Boolean

Do you know what this means and how it can be fixed.  Does it have any
bearing on the overstrikes issue?
--- MR


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

Date: Fri, 21 Aug 1998 10:27:08 +0100
From: Simon Wistow <simon@new-mediacom.com>
Subject: Perl Docs.. forget the original post
Message-Id: <645CAC0140CED111AF1500805FEDDB8AA41D@ns.new-mediacom.co.uk>

I'm a complete newbie myself and I found CLPM a bit diconcerting to
start off with however now that I know MO ...

One thing puzzles me though, you advocate ignoring 'FAQless newbies' yet
admit that you 'first learned of the perl faqs' this way.

Some of us with window boxes don't have grep either (now there's an
idea, hmmmm);






> -----Original Message-----
> From:	cabneySP4M@SP4M.SP4Mcyberpass.net (C. Abney)
> [SMTP:cabneySP4M@SP4M.SP4Mcyberpass.net]
> Posted At:	Tuesday, August 18, 1998 6:26 AM
> Posted To:	misc
> Conversation:	Perl Docs.. forget the original post
> Subject:	Re: Perl Docs.. forget the original post
> 
> In article <35CFACAE.86EC7B4E@spider.herston.uq.edu.au>,
> 	Jaime Metcher <metcher@spider.herston.uq.edu.au> writes:
> 
> [ where FAQless posters should have looked before posting, but
>   didn't, and weighting the resulting flamage ]
> 
> > 1. The camel book (fair enough).
> > 2. Not in the camel book, but in perlre (still fair enough).
> > 3. Not in either the camel or perlre (where they thought it would
> be)
> > but in perlop (yeah, OK, they should have grepped).
> > 4. In neither the camel, perlre or perlop, but somewhere in one the
> the
> > many parts of the FAQ list (ditto, but I'd be giving points for
> trying).
> > 5. In none of the above, but answered on this ng and therefore in
> > DejaNews (fatigue allowance here, especially for newcomers).
> 
> Speaking as a newbie to clpm, the not so gentle remonstrations in this
> group are where I first learned of the perl faqs.  I went to CPAN,
> then
> discovered them on my harddrive (they are kind of hidden away).  These
> are really nice!  They should go in /usr/doc.
> 
> Speaking as someone who tries to help out in c.o.l.m. I have to say
> the
> noise level here is far lower than what I'm used to, and am truly
> impressed by the sound advice posted here.  If arrogance and conceit
> can
> be good qualities, that has certainly been shown in clpm!  Not that
> any one of you has these character qualities, of course. :)
> 
> I might even be tempted to try it in colm. (Every question has an
> answer, every FAQ gets a RTFM)
> 
> What does make me wonder, though, is why a FAQless newbie's squeals
> aren't simply ignored?
> 
> -C
> -- 
> ...if we truly desire world domination, we've got to get our LSD into
> the corporate elite's conceptual water supply and alter the beast's
> consciousness. -ESR                                           C. Abney



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

Date: 21 Aug 1998 09:04:31 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: PREFIX in MakeMaker
Message-Id: <6rjd6v$dh1$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Russ Allbery 
<rra@stanford.edu>],
who wrote in article <m3g1eqx4ak.fsf@windlord.Stanford.EDU>:
> In general, I don't think that PREFIX does what I want when installing
> modules in a non-standard location.  I always set LIB on the command line
> instead, and that puts things where I expect it to.  I haven't had a
> chance to take a look at ExtUtils::MakeMaker (which is an ungodly mess)
> and figure out where to correct it so that it does what I expect.

I find that it works as it should (at least if the Perl build was
performed with -Dprefix= option).  However, looking through the
generated Makefile, I saw that there are two places which mention
$(SITEARCHEXP).  (Grep for 'EXP\>'.)

Is there any reason to use $(SITEARCHEXP) in the Makefile?

Ilya


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

Date: Fri, 21 Aug 1998 14:52:57 +0200
From: Johannes Faerber <faerber@ind.uni-stuttgart.de>
Subject: Q: Sliding Window Sort With Perl?
Message-Id: <35DD6DA9.3EE3@ind.uni-stuttgart.de>

Hi,

I am still learning perl and would like to know your opinion:

I have: huge gzipped logfiles
        with timestamps but only roughly sorted (correct only in
        range of 1-2 minutes)

I like: to sort the lines after sec_since_1970 as they are passing 
        my script - maybe:
        - read n lines into list (size m)
        - sort list
        - write n lines from list
        - check sequence

Is that feasible? Can I put records into a list and sort it only
after one field of my record?        

That would save me from writing several MB logfiles just in order 
to sort them...

thanks for your help,
Johannes


-- 
Institute of Communication Networks and Computer Engineering (IND)
University of Stuttgart
Pfaffenwaldring 47                           Tel: +49-711-685 7968
D-70569 Stuttgart                            Fax: +49-711-685 7983
Johannes Faerber                      faerber@ind.uni-stuttgart.de


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

Date: 21 Aug 1998 12:11:42 GMT
From: "Vincent Verhagen" <bigbro@dmrt.nl>
Subject: Script wanted to change /etc/passwd passwords.
Message-Id: <01bdccfc$a83655c0$691ea8c0@situtr666>


Hi.

I'm looking for a CGI / Perl script that allows users of my Linux system to
change their /etc/passwd password via the web server. Does anybody know
if/where such a script is available?

Thanks very much in advance!

Vincent.



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

Date: Fri, 21 Aug 1998 19:06:17 +0800
From: 8\(F&@ <versace@gianni.com>
Subject: Send cmd and Receive result from command?
Message-Id: <35DD54A9.35A2@gianni.com>

Hi all,

How to do that? I'd tried 

open (CMD, "|$CMD|");

but received nothing using
open (CMD, "|$CMD|");
sleep (5);
while (<CMD>) {
	print $_;
}

I can receive the result if the first '|' in "|$CMD|" was removed.

Please help!


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

Date: 21 Aug 1998 12:10:06 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Send cmd and Receive result from command?
Message-Id: <slrn6tqosu.r0a.sholden@pgrad.cs.usyd.edu.au>

On Fri, 21 Aug 1998 19:06:17 +0800, 8\(F&@ <versace@gianni.com> wrote:
>Hi all,
>
>How to do that? I'd tried 
>
>open (CMD, "|$CMD|");
>
>but received nothing using
>open (CMD, "|$CMD|");
>sleep (5);
>while (<CMD>) {
>	print $_;
>}
>
>I can receive the result if the first '|' in "|$CMD|" was removed.
>
>Please help!

try perl -w...

alternatively you could read the documentation...

again try perl...

Sam



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

Date: Fri, 21 Aug 1998 07:20:34 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: server config error or script error?
Message-Id: <35DD6612.3D73EE35@houston.Geco-Prakla.slb.com>

M Munhall wrote:
> 
> I am trying to run a form processing script from Selena Sol's script
> archive.  You may or may not be familiar with it.  When the script is run
> from the command line the expected result is returned, but when run from a
> browser a server misconfiguration/error occurs (error 500).
Error 500 means "oops, something screwed up, and I'm not going to tell
you any more than that".

To get any real information out of it, you need to examine your server
logs.  It should have all kinds of useful informatoin in it.

Another quick test:  Can you run the script from the command line.  If
you get any errors, fix them, and try again.



> Being new to cgi, I am not sure if there could actually be something in the
> Perl script that is causing this error or if it is a genuine server error.
> Other Perl scripts (much simpler than this one) run fine.  The ISP is aware
> of my problem but is incredibly slow to respond.
Find another, more responsive, ISP.

> 
> Any ideas?
Lots of them, but not about what you're wanting to know.  :-)

> 
> Thanks,
> M. Munhall
HTH.

Cheers,
Dave

-- 
Dave Barnett	Software Support Engineer	(281) 596-1434


Have fun.  It's not just a statement, it's really good advice.


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

Date: Fri, 21 Aug 1998 11:09:05 GMT
From: joumdane@hotmail.com
Subject: Strange characters while writing in files
Message-Id: <6rjkgh$17a$1@nnrp1.dejanews.com>

Hi,
I'm writing a program whitch is handling files. When I write in any file a
string, i find the string written but with more characters at the end of the
string. a sample program whitch gives this is :

$file = 'tmp1';
open(TEST, ">$file" );
print TEST "HI" ;
close <TEST> ;

Anyone knows what's going on ?
                                                Thanks,
                                                Joumdane

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


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

Date: Fri, 21 Aug 1998 10:25:58 GMT
From: huntersean@hotmail.com
Subject: Re: Stumped! Need help!
Message-Id: <6rjhvl$unf$1@nnrp1.dejanews.com>

In article <35DC5407.53058C63@tvlistings.co.uk>,
  davemee@tvlistings.co.uk wrote:
> How y'doing? Good to hear.
>
> I was wondering if anyone had an elegant solution to >this< problem.
>
> I have hundreds of files open, the filehandles for them are generated
> dynamically as I need them. Opening and closing is all handled by
> searching through other arrays and constructing filehandles it *knows*
> will be open.
>
> What I need to do is read one line from a file, with only a string
> pointing to the filehandle.
>
> I *don't* want to have to read the whole file into an array all at once.
> I have to skip between files in a random order, so I want the system to
> keep track of the position for me automaticcly.
>
> Excuse the crassness of my code, but the mess below is *what* I am
> trying to achieve, I hope it's obvious why it doesn't work:
>
>     $progs[$item]=<{$fromfile}>;
>
> In a fit of desperation I thought the {} might help but evidently not.
> Any ideas, pointers, tips?
>
> (been through Camel, Llama, FAQ, and Dejanews without any leads).
>
> Please help. There's a pint in it for you :)
>
> Cheers, Dave
>
>

What you need is to store references to the filehandles in an array or hash,
and read or write via the reference.  The code to create a filehandle
reference is on blue camel pg 248.

so you'll first do:
my $fromfile = "foo";
open FROMFILE, $fromfile;
my $fromfile2 = "bar";
open FROMFILE2, $fromfile2;

my %handles = ($fromfile=>\*FROMFILE,
	       $fromfile2=>\*FROMFILE2);


Then, instead of
   $progs[$item]=<{$fromfile}>;

You'll do something like:
   $progs[$item] = <$handles{$fromfile}>;

You may want to consider using the FileHandle module.  You could then use an
array or hash to store references to FileHandles returned by the
"FileHandle::new" operator.  Check out blue camel page 442.

Mine's a Guinness!

Sean H

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


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

Date: 21 Aug 1998 03:10:57 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Using Perl module without access to Perl installation
Message-Id: <m3hfz6tzke.fsf@windlord.Stanford.EDU>

Zenin <zenin@bawdycaste.org> writes:

>         PREFIX also puts things where you expect it to, so long as you
>         are expecting the same thing from PREFIX as MakeMaker is.

MakeMaker, at least the last time that I tried to use PREFIX, apparently
expects PREFIX not to affect the installation location of man pages at
all.  I think that's the main thing that I ran into that annoyed me.
Ilya's comment is probably related to the same thing.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Fri, 21 Aug 1998 10:29:55 GMT
From: newsgrp@business-heaven.com
Subject: why doesn't this work as expected...
Message-Id: <6rji71$upn$1@nnrp1.dejanews.com>

This is the script....

#!/usr/bin/perl

$ip = " test.|test1.|test2";
print "tst1: $ip\n\n";
$ip =~ s/(\W)/\\$1/g; 		#putting in escape for non chars
print "tst2: $ip\n\n";
$ip =~ s/\\\|/\|/g;		#remove the escaping of the |
print "tst3: $ip\n\n";
$ip =~ tr/./\./;	        #??? why isn't this changing everything to a .
print "tst4: $ip\n\n";

exit;

Creates this output......

tst1:  test.|test1.|test2

tst2: \ test\.\|test1\.\|test2

tst3: \ test\.|test1\.|test2

tst4: \ test\.|test1\.|test2

Why isn't the output tst4:.... all .'s

Thanks
Terry

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


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

Date: Fri, 21 Aug 1998 12:17:56 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: why doesn't this work as expected...
Message-Id: <35DD66ED.59D615D0@shaw.wave.ca>

[posted and mailed]

newsgrp@business-heaven.com wrote:
> 
> $ip = " test.|test1.|test2";
> print "tst1: $ip\n\n";
> $ip =~ s/(\W)/\\$1/g;           #putting in escape for non chars
> print "tst2: $ip\n\n";
> $ip =~ s/\\\|/\|/g;             #remove the escaping of the |
> print "tst3: $ip\n\n";
> $ip =~ tr/./\./;                #??? why isn't this changing 
> everything to a .

Why are you using tr?  You were quite happy using s///g before that. 
Look up tr in perlop.  And if you want everything to be dots, why all
the gymnastics in the middle?

    $ip =~ s/././g;

Or, if you really want to use tr (and there are often reasons why you
should):

    $ip =~ tr/\n/./c;

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

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

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