[10675] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4267 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 20 21:07:28 1998

Date: Fri, 20 Nov 98 18:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 20 Nov 1998     Volume: 8 Number: 4267

Today's topics:
    Re: ! Help with an EASY question <Jason@InsideMedicine.com>
    Re: ! Help with an EASY question <Jason@InsideMedicine.com>
    Re: a very simple question! (Alastair)
    Re: Activestate WIN32 Service Pack??? <samuel.patton@wichita.boeing.com>
    Re: ascending (Alastair)
    Re: Auto Incrementing Characters-a subtle problem? (Tye McQueen)
    Re: Bareword? bigcheese@my-dejanews.com
    Re: Beginner Book? <ajonsson@csi.com>
    Re: CGI.pm: How to translate newlines and so forth. (Alastair)
        Getting what a refernce meta-refers to <fecund@fatnet.net>
        Good Book: "Advanced Perl Programming" (David Combs)
    Re: Help - popup window option (Alastair)
    Re: help with a new game (Erik)
    Re: Is it possible to run a web server on Win95? <kris@fit2print.com>
        Little help here <skapunk@n-link.com>
    Re: Little help here <uri@fastengines.com>
        Looking for a script to "roll dice" <donboy@qis.net>
    Re: Perl para windows 95 <slepetys@homeworks.com.br>
    Re: Perl Win32, finding all drives, need help (Tye McQueen)
    Re: puzzler <due@murray.fordham.edu>
    Re: puzzler <uri@fastengines.com>
        Question from a mega-geek <nospam.perl_rocks@hotmail.com>
        Regular Expression <sberg1@tampabay.rr.com>
        Security with .htaccess <dixonmat@pouch.com>
    Re: Sum by group (Claes Bjorklund)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 20 Nov 1998 16:46:15 -0600
From: "Jason Hatcher" <Jason@InsideMedicine.com>
Subject: Re: ! Help with an EASY question
Message-Id: <734rct$hhk@enews4.newsguy.com>

Thank you for the graceful solution.

Jason





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

Date: Fri, 20 Nov 1998 16:47:18 -0600
From: "Jason Hatcher" <Jason@InsideMedicine.com>
Subject: Re: ! Help with an EASY question
Message-Id: <734re9$him@enews4.newsguy.com>

Thank you for the graceful solution.

Jason





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

Date: Sat, 21 Nov 1998 01:44:35 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: a very simple question!
Message-Id: <slrn75c6ms.hp.alastair@calliope.demon.co.uk>

Yue Wang <ywang@engsoc.carleton.ca> wrote:
>Subject: a very simple question!
>Newsgroups: comp.lang.perl.misc
>Summary: 
>Keywords: 
>
>
>Hi, 
>	I have a very simple question with regard to automatically reload
>a HTML page, basically I am trying to redirect to this URL in my cgi
>script using

Yue,

You will get a better response to HTML/HTTP questions in a newsgroup devoted to
HTML/HTTP. See the comp.infosystems hierarchy.

Good luck.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Fri, 20 Nov 1998 23:05:06 GMT
From: "Sam Patton" <samuel.patton@wichita.boeing.com>
Subject: Re: Activestate WIN32 Service Pack???
Message-Id: <F2qtGI.5yJ@news.boeing.com>

When did you send this and do we know whats in this SP that would or would
not impact what we have been doing.

Any guesses????


Steven Morlock wrote in message ...
>I received the following from the ActiveState folks:
>
>Hello Steven,
>
>I appreciate that you have taken the time to write to us.
>
>ActiveState and its employees are working very hard at getting the service
>pack for the PRK released.  Currently, the PRK service pack is in the final
>stages of Quality Assurance and will be available immediately following
>this process.
>
>Sincerely,
>
>Sandy Fleischer
>
>At 08:17 AM 11/19/98 -0500, you wrote:
>>
>>From the ActivePerl download page:
>>
>>>>NOTE to Perl Resource Kit -- Win32 Edition users: If you have the Perl
>>Resource Kit installed,
>>>>then you need the PRK Service Pack 1 to update ActivePerl. Do not
>download
>>and install the files below.
>>>>The PRK Service Pack 1 will be available in a day or two.
>>
>>This message has been on the site very, very long time.
>>Can owners of the 'Perl Resource Kit' expect support on this product?
>>
>>
>>
>
>Sandy Fleischer
>ActiveState Tool Corp. -- Professional Tools for Perl Developers
>
>http://www.ActiveState.com
>
>Robert M Bellavance wrote in message <243650014@hpcc01.corp.hp.com>...
>>Ok, I took the bait and bought the Perl Resource Kit
>>for Win32. The current build of ActivePerl is now
>>at 507 an of you bought the PRK they tell you this:
>>
>>"NOTE to Perl Resource Kit -- Win32 Edition users:
>>If you have the Perl Resource Kit installed, then
>>you need the PRK Service Pack 1 to update ActivePerl.
>>Do not download and install the files below.
>>The PRK Service Pack 1 will be available in a day or two."
>>
>>BULL*HIT!!!
>>
>>This message has been there for two builds and over a week.
>>If you look at http://www.activestate.com/PRK/patches.htm the
>>service pack was due in mid October.
>>
>>My question. Should I just forget about the PRK "rules" and grab the
>>507 build? I know this will probably mean I will have to install
>>modules, but it will mean that I don't have to just sit on my
>>hands and wait for something that may not happen.
>>
>>You'd think Activestate would give the PRK users priority because
>>of the bucks we shelled out, but noooooo!!! What a rip off!
>>
>
>




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

Date: Sat, 21 Nov 1998 01:42:05 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: ascending
Message-Id: <slrn75c6i5.hp.alastair@calliope.demon.co.uk>

Casema <ours@casema.net> wrote:
>Hi group,
>
>$SQL = "SELECT * FROM news";
>what would be a valid statement to get the output ascending /
>descending?????
>Oh, by the way, I am using WIN32::ODBC, so this is Perl Related

No it's not. It's SQL related as stated. For a SQL tutorial, check out ;

http://w3.one.net/~jhoffman/sqltut.htm

HTH.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: 20 Nov 1998 16:56:44 -0600
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Auto Incrementing Characters-a subtle problem?
Message-Id: <734s3c$s60@fohnix.metronet.com>

Lee Benfield <lbenfie1@nospamford.com> writes:
) 
) Autoincrementing a character gives a character, but autodecrementing
) doesnt.
) 
) Any way to change this behaviour?

Yes, send in a patch that implements magical auto decrement and
convince the pumpking that it is a good patch.  In the process of
doing this, you will probably come up with some good answers for
your next question:

) And why is it like it is, out of interest?

Check http://www.dejanews.com/ for more answers.  My favorite
is "because it wasn't needed to make C<'a'..'z'> work".
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: Sat, 21 Nov 1998 00:20:37 GMT
From: bigcheese@my-dejanews.com
Subject: Re: Bareword?
Message-Id: <735106$jk8$1@nnrp1.dejanews.com>

Okay
I didn't see that!
^_^

Thanks for your help!
-Dan

In article <732s47$1jq$1@mathserv.mps.ohio-state.edu>,
  ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
> [A complimentary Cc of this posting was sent to
> <bigcheese@my-dejanews.com>],
> who wrote in article <732reg$o0f$1@nnrp1.dejanews.com>:
>
> > Bareword found where operator expected at line 42, near "$base
='<IMGSRC=kana/k1"
> >
> > 17 @kana = $ENV{'QUERY_STRING'} =~ /([^Aaeiou +9]*[Aaeiou +9])/g;
> > 31 for ($i = 1; $i < length($ENV{'QUERY_STRING'}); $i++) {;
> > 32 $fi = $kana[$i];
> > 33	if (length($fi)==8 && $fi=~/%28[KkHh][12345]%29) {
> > 34		chop($kana[$i]);
> > 35		chop($kana[$i]);
> > 36		chop($kana[$i]);
> > 37		$hd = chop($kana[$i]);
> > 38		$fr = chop($kana[$i]);
> > 39		if ($fr eq 'K') {
> > 40			if ($hd == 1) {
> > 41				$base = '<IMG SRC=kana/k1/';
> > 42				$bwth = ' WIDTH=15 HEIGHT=15>\n';
>
> If you would use a smart editor, you would momentarily see that the /
> on line 41 end a REx which starts on line 33.
>
> Hope this help,
> Ilya
>


--
 Dan  /| ________________
O|===|* >________________>
      \| http://members.xoom.com/big_cheese

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


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

Date: Fri, 20 Nov 1998 18:35:52 -0600
From: "AJ" <ajonsson@csi.com>
Subject: Re: Beginner Book?
Message-Id: <ex$yyZOF#GA.330@nih2naac.prod2.compuserve.com>

As I once saw some Perl guru reply, PERL is a Programmers Extraction and
Reporting Language, and not really meant to be
an instructional language per say, but one so-so way to do it would
be to look at "PERL 5 for Dummies" which assumes little previous knowledge,
though I hear it is not the best PERL book, one might have to be prepared to
"unlearn" a few things down the road.  I might suggest also supplementing
PERL learning with a book on general programming conecpts.

A Jonsson

lvirden@cas.org wrote in message <7339e1$eta$1@srv38s4u.cas.org>...

According to Jeff Kennedy <jeff.kennedy@natdecsys.com>:
:I need a book geared to an ABSOLUTE BEGINNER!  No perl experience, no
:programming experience, no real shell scripting experience.
:
:What would I be looking for?  Not something that assumes I know
:anything!

That's a good question.  I've a co-worker who programmed years ago in
IBM assembler, who now has a Unix workstation on his desktop.  He knows
enough shell scripting to read a shell script, but not enough to do much
original scripting.  And he knows no C.  However, Perl would do wonders
for him.  However, when he's looked at the two O'Reilly's books, as well
as tried taking intro courses, he found too much pre-reqs on knowing
scripting and C to get thru the books/courses.

Let me know what you find.  I think telling someone to become comfortable
in programming in a compiled language before learning a scripting language
seems, to me, to be the wrong approach.  Hopefully someone has taken on
the topic.  I know I've had the MacPerl book recommended to me.  One of
these days I need to get it and see how that works out.
--
<URL:mailto:lvirden@cas.org> Quote: Saving the world before bedtime.
<*> O- <URL:http://www.purl.org/NET/lvirden/>
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.




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

Date: Sat, 21 Nov 1998 01:33:25 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: CGI.pm: How to translate newlines and so forth.
Message-Id: <slrn75c61t.hp.alastair@calliope.demon.co.uk>

Jarrod Stenberg <jarrod@alcmn.org> wrote:
>
>Then when I restore values using CGI.pm it prints it with the textarea part
>of the form just as typed BUT I would like it to also do this when printing
>as html.  So the obvious thing to do is: $text=param('text); $text=~ s/%0A/
><BR>/g; print $text; and so on but this does not work because from
>$text=param('text) the special characters are already gone (interpreted?).

Well, the regex is wrong for a start - check perlre on how to code characters
like carriage-returns.

I often circumvent this type of issue by using a <PRE></PRE> combination.

HTH.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: 20 Nov 1998 14:19:54 -0800
From: Yary H. <fecund@fatnet.net>
Subject: Getting what a refernce meta-refers to
Message-Id: <734pua$fm5@drn.newsguy.com>

Here's an odd question:

Can a sub examine a reference, and determine if it's a reference to something
anonymous, or a reference to something the caller has a name for- and get the
name?

Here's an example. I'd like

sub magic_trace { ... }
$::bar = 1;
print join(", ", magic_trace(\(my ($a, @b, %c)), \$::bar, [4,5,6]));

to output somthing like
"$a, @b, %c, $main::bar, []"

If you must know, ... hmm, no I won't tell you why I would use it, other than it
has to do with retroftting someone else's code (and that person has already been
terminated). Even if I never use it, just knowing how it could be done would be
cool.

-yary


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

Date: Fri, 20 Nov 1998 23:42:22 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Good Book: "Advanced Perl Programming"
Message-Id: <dkcombsF2qv6M.2J3@netcom.com>

Of course, PP.

But another not yet mentioned is "Advanced Perl" or the like,
by Srinivasan, pub  by O'Reilly.

Gives you a DERIVATION of lots of perl stuff.  For one who
can't abide abstractions, and needs a "concrete" approach,
eg how things work UNDERNEATH, this book can't be beat (I think --
although there might be others I don't know about).

Also a chapter on "perl internals", re the stacks, etc, and
how typeglobs work internally, with data-structure pictures.

Also more about how context works, how it goes "top down", etc.

Like I say, for someone who has to know how things work internally,
to be able to understand how to use it (maybe those of us like this
are in a minority), this is a SURELY(!) book to have, and to read.
Lots of things you take on faith from other books, you actually
UNDERSTAND via this book.

(Obviously you must also have PP, and the cookbook (which I have
but haven't gotten into yet).  Actually, perl is such a HUGE language,
complete with a gillion little details, that you need to read VARIOUS
people's way of explaining it, tying together seemingly disparate 
parts.)

Why this book hasn't gotten more push via this newsgroup puzzles me,
unless there is something personal going on.  The book is written
very well (as is of course PP, etc, also), but just from a
quite different viewpoint, more towards how all this stuff works
internally -- which at least one person (me) finds a real help!

Just my two bits!


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

Date: Sat, 21 Nov 1998 01:35:45 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Help - popup window option
Message-Id: <slrn75c669.hp.alastair@calliope.demon.co.uk>

Dale Sutcliffe <dales@enhanced-performance.com> wrote:
>based on which radio button selected is it possible to display results in a new window and/or in the
>same window, below the form?
>How?

The answer's the same no matter which language you use for CGI. Try asking in a
newsgroup devoted to CGI programming (comp.infosystems....) and you'll reach a
better target audience.

Good luck.


-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: 20 Nov 1998 23:22:13 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: help with a new game
Message-Id: <734tj5$a13$1@news.cyberhighway.net>

In article <6045-3655E6FD-72@newsd-113.bryant.webtv.net>,
	dragonelf@webtv.net writes:
> what would be better to use to build a text multiplayer game? perl, c++,
> basic? any responses please

Download a MUD driver.
HTH!

P.S. Language advocacy questions are not really appropriate for this forum.

-- 
Erik Nielsen, Cyberhighway Internet Services NOC
Cmdmt. XI: Thou shalt not inflict upon me thy useless prattlings, for I
thy God am a busy God. 
             -- Joe Thompsonn in a.s.r.


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

Date: Sat, 21 Nov 1998 00:34:22 GMT
From: Kris <kris@fit2print.com>
Subject: Re: Is it possible to run a web server on Win95?
Message-Id: <36560A4A.B22142F3@fit2print.com>



"A.J. Norman" wrote:

>  In article <733kmk$cmn$1@nnrp1.dejanews.com>,
>  <dominikl@my-dejanews.com> wrote:
>  >
>  > does it have to be apache?  there are other Webservers like xitami
>  > or omniHTTPd whitch allow cgi's.  And they are realy easy to
>  > install.
>
>  I can second the recommendation for xitami, it takes about five minutes
>  to install and is easy to configure.  Works fine with Activestate Perl
>  on NT machines, so I'd guess W95 shouldn't be too much of a problem.
>
> --
> Andrew Norman, Leicester, England
> nja@le.ac.uk || andrew.norman@le.ac.uk
> http://www.le.ac.uk/engineering/nja/

Where can I get this xitami?  I guess I'm partial to A-patchy because my ISP
uses it, hell I think the whole Internet uses it, and its seems it was made
for a good cause.

Kris

--
fit2print.com - Your Digital Newsstand
Order individual magazines @ http://www.fit2print.com




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

Date: Fri, 20 Nov 1998 17:33:47 -0600
From: Timothy M Bryant <skapunk@n-link.com>
Subject: Little help here
Message-Id: <3655FC5A.7891BBD9@n-link.com>

I am wondering if someone out there could give me a little help in how
to use Perl for programming.  I was told by a friend that it could be
done.  I am just someone who wants to learn new stuff on a raggedy
computer.  Thanks!!



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

Date: 20 Nov 1998 19:03:48 -0500
From: Uri Guttman <uri@fastengines.com>
To: Timothy M Bryant <skapunk@n-link.com>
Subject: Re: Little help here
Message-Id: <sarsofdap3v.fsf@camel.fastserv.com>

>>>>> "TMB" == Timothy M Bryant <skapunk@n-link.com> writes:

  TMB> I am wondering if someone out there could give me a little help in how
  TMB> to use Perl for programming.  I was told by a friend that it could be
  TMB> done.  I am just someone who wants to learn new stuff on a raggedy
  TMB> computer.  Thanks!!

well, perl is a programming language so you can use it for
programming so your friend is correct. does that answer your question?

go to www.perl.com and spend some time there. then download perl to your
ragtop computer. then buy some good books on perl (o'reilly ones are the
best in general) and spend some time learning perl. pretty soon you will
be amazing your friends and neighbors with perl programs.

hth,

uri


-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Fri, 20 Nov 1998 20:45:44 -0500
From: Donboy <donboy@qis.net>
Subject: Looking for a script to "roll dice"
Message-Id: <36561B48.A0CD4894@qis.net>

I'm currently webmastering a site for role playing games and I need a
cgi program that will roll dice online.

The script must be able to generate random numbers, roll dice of any
number of sides (i.e. 10 sided dice, 4 sided dice as well as the regular
6 sided dice) and it must be able to receive input via an HTML form.

If anyone has a script even REMOTELY similar to this, please let me
know.  If you have one that is your own personal creation, I would be
willing to buy a copy for a reasonable price.


-- 
================================
Donboy@qis.net  //  ICQ# 8983870
================================


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

Date: Fri, 20 Nov 1998 22:34:12 -0200
From: Roberto Slepetys Ferreira <slepetys@homeworks.com.br>
Subject: Re: Perl para windows 95
Message-Id: <36560A84.6D470CED@homeworks.com.br>

Josi,
tente no www.perl.org ou no www.perl.com

Existem 3 versues de perl para Win32, a executavel, a .DLL e o
PerlScript.

Baixe a Win32 executavel.

[]s
Slepetys

"Josi Carlos Jeske" wrote:

> Onde posso conseguir perl para windows 95



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

Date: 20 Nov 1998 19:24:31 -0600
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Perl Win32, finding all drives, need help
Message-Id: <7354of$5a6@fohnix.metronet.com>

"J|rgen Ibelgaufts" <ibelgaufts@gfc-net.de> writes:
) 
) can't find it in the documentation, so here is my question:
) 
) how can i find all valid drive letters with perl on win-nt
) (using GS perl 5.005)?

I wish there were a "GS perl 5.005" as in "Gurusamy Sarathy's
binary distribution" but I can't find a binary distribution for
perl 5.005_xx except for from ActiveState (which includes
restrictions on distribution so I can't use it as part of our
commercial product).

So I guess you mean GS's bindist of Perl 5.004_02, or the standard
Perl dstribution (source code) that is under Gurusamy Sarathy's
name but should not be tagged "GS" [a binary distribution needs
to include who made it in the description because different people
or groups can produce different binary distributions of the same
version of Perl using different choices of compilers, optional
features, etc. -- but there is only one source distribution of
Perl per version] and which you then built yourself.

Whoa!  If you just typed "5" when you meant "4", then I probably
sound silly with such a long response.  It is related to a common
lack of understanding of this relationship that I see in many
Win32 Perl users.

Back to your question.  If you get
http://www.metronet.com/~tye/alpha/Win32API/File-0.05.zip, then
you can do:

    use Win32API::File qw( getLogicalDrives );

    @drives= getLogicalDrives();

to get what you asked for.  It uses the Win32 API GetLogicalDrives()
so it doesn't poll each drive letter which can cause delays or even
annoying pop-up windows.

This will probably end up in a future version of the libwin32
bundle.

Cheers,
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: 20 Nov 1998 23:17:41 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: puzzler
Message-Id: <734tal$9ko$0@206.165.167.202>


jschueler@detroit.usweb.com wrote in message
<733v23$l9i$1@nnrp1.dejanews.com>...
>Is there a good trick for transposing a two dimensional array? That is,
>combine a two dimensional array into a one dimensional array columnwise:
1st
>element/1st row followed by 1st element/2nd row, etc.  There must be some
way
>to streamline what I wrote.
>

[snip]

Ok, not an original idea here.  Today is the start of cartography week for
me.  I am trying to learn to think about maps so I am taking posts and
trying to map them.  Thus, taking the ideas of the others, and maybe one of
my own.  Here is my solution:

my @LOL = (
        [ "fred", "barney",],
        [ "george", "judy", "elroy" ],
        [ "homer", "lisa", "bart" ],
        ) ;

my $n;
my @result = grep length,map {$n=$_;map {$_->[$n]} @LOL;} (0..@LOL);
print join "\n",@result;

kind of like it really.  Thanks everybody.

AmD




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

Date: 20 Nov 1998 19:00:10 -0500
From: Uri Guttman <uri@fastengines.com>
To: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: puzzler
Message-Id: <sarww4pap9x.fsf@camel.fastserv.com>

>>>>> "AMD" == Allan M Due <due@murray.fordham.edu> writes:

  AMD> my own.  Here is my solution:

  AMD> my @LOL = (
  AMD>         [ "fred", "barney",],
  AMD>         [ "george", "judy", "elroy" ],
  AMD>         [ "homer", "lisa", "bart" ],
  AMD>         ) ;

  AMD> my $n;
  AMD> my @result = grep length,map {$n=$_;map {$_->[$n]} @LOL;} (0..@LOL);
  AMD> print join "\n",@result;


i wish people would test their code with better data. this like several
solutions posted fail when any single list has more elements than the
number of lists. you are looping (0..@LOL) over the number of lists and
applying that to the elements of each list.

try it with the last list being:

        [ "homer", "lisa", "bart", 'marge', 'maggie' ],

you should get:

fred george homer barney judy lisa elroy bart marge maggie

but your code prints:
Use of uninitialized value at foo12.pl line 9.
Use of uninitialized value at foo12.pl line 9.
Use of uninitialized value at foo12.pl line 9.
fred george homer barney judy lisa elroy bart marge

no maggie since that is element 5 and your map loop only goes to 4
(incorrectly at that, see below).

on top of that (0..@LOL) is wrong in its own right. you should be doing
(0 .. $#LOL).


as i posted elsewhere this works fine without warnings or truncations:

while( grep { push( @flat, shift @{$_} ) if @{$_} } @LOL ) {} ;

uri

-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Fri, 20 Nov 1998 20:52:53 -0500
From: sara starre <nospam.perl_rocks@hotmail.com>
Subject: Question from a mega-geek
Message-Id: <36561CF5.706D9DDB@hotmail.com>

OK I admit it I'm a total geek to ask this, but does anyone know where I
can buy "perl-phenelia"? I'd love to get a sew-on patch of that
"Programming Republic of PERL" with the camel on it for my jean jacket.

Come to think of it, I may get it tatoo'ed on my.. well, we won't go
there :)

-S

--
"I'll quit using PERL when they pry my cold, dead fingers off the
mouse.."
-Sara Starre 1998




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

Date: Fri, 20 Nov 1998 20:51:42 -0500
From: "Shawn Berg" <sberg1@tampabay.rr.com>
Subject: Regular Expression
Message-Id: <I3p52.3351$QO1.7161076@newse2.tampabay.rr.com>

This is a multi-part message in MIME format.

------=_NextPart_000_011F_01BE14C7.94398E80
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

    I was trying to write a some code that takes segments of a path =
(from the environment and the command line) and build a complete valid =
path.  I wanted to make it flexible so that the user would not have to =
be concerned with the exact format of the segments (i.e., whether or not =
to end with a '/').  @mydir contains each of the parts.  I eventually =
got this code to work, but I'm curious to see some other methods.
      =20
        my ($path) =3D "";
        my (@mydir) =3D ("/data", "foo/", "bar");
        foreach (@mydir) {
            s/([^\/])$/$1\//;
            $path =3D $path . $_;
        }
        print "$path\n";                 =20
   =20
    Output:
        /data/foo/bar/

--
Cheers,
Shawn Berg

   =20



------=_NextPart_000_011F_01BE14C7.94398E80
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
<STYLE></STYLE>

</HEAD>
<BODY background=3D"">
<DL>
    <DD><FONT size=3D2>I was trying to write a some code that takes =
segments of a=20
    path (from the environment and the command line) and build a =
complete valid=20
    path.&nbsp; I wanted to make it flexible so that the user would not =
have to=20
    be concerned with the exact format of the segments (i.e., whether or =
not to=20
    end with a '/').&nbsp; @mydir contains each of the parts.&nbsp; I =
eventually=20
    got this code to work, but I'm curious to see some other=20
methods.</FONT></DD>
    <DD><FONT size=3D2></FONT><FONT color=3D#000000 face=3D"Courier New" =

    size=3D3>&nbsp;&nbsp; </FONT></DD>
    <DD><FONT color=3D#000000 face=3D"Courier New" size=3D3><FONT =
color=3D#000000=20
    face=3D"Courier New" size=3D2>&nbsp;&nbsp;&nbsp; my ($path) =3D=20
    &quot;&quot;;<BR>&nbsp;&nbsp;&nbsp; my (@mydir) =3D =
(&quot;/data&quot;,=20
    &quot;foo/&quot;, &quot;bar&quot;);</FONT></FONT></DD>
    <DD><FONT color=3D#000000 face=3D"Courier New" size=3D3><FONT =
color=3D#000000=20
    face=3D"Courier New" size=3D2>&nbsp;&nbsp;&nbsp; foreach (@mydir)=20
    {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
    s/([^\/])$/$1\//;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
$path =3D=20
    $path . $_;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; print=20
    =
&quot;$path\n&quot;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
    </FONT></FONT></DD></DL>
<DL>
    <DD>&nbsp;</DD>
    <DD><FONT color=3D#000000 face=3D"Courier New" size=3D3><FONT =
color=3D#000000=20
    face=3D"Courier New" size=3D2>Output:</FONT></FONT></DD>
    <DD><FONT color=3D#000000 face=3D"Courier New" size=3D3><FONT =
color=3D#000000=20
    face=3D"Courier New" size=3D2>&nbsp;&nbsp;&nbsp;=20
    /data/foo/bar/</FONT></FONT></DD></DL>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>--</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT><FONT color=3D#000000 =
face=3D"Courier New"=20
size=3D3><FONT color=3D#000000 face=3D"Courier New" =
size=3D2>Cheers,</FONT></FONT></DIV>
<DIV><FONT color=3D#000000 face=3D"Courier New" size=3D3><FONT =
color=3D#000000=20
face=3D"Courier New" size=3D2>Shawn Berg<BR></FONT></FONT></DIV>
<DL>
    <DD>&nbsp;</DD></DL>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#000000 face=3D"Courier New" size=3D3><FONT =
color=3D#000000=20
face=3D"Courier New" size=3D2></FONT></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_011F_01BE14C7.94398E80--



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

Date: Fri, 20 Nov 1998 23:20:55 GMT
From: "News" <dixonmat@pouch.com>
Subject: Security with .htaccess
Message-Id: <rPm52.854$5v3.6703943@news.optonline.net>

How do I add the routine to post or write to .htaccess with a username and a
password on an Apache server automatically without going into telnet?




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

Date: Sat, 21 Nov 1998 00:20:15 +0100
From: claes_no_spam@canit.se (Claes Bjorklund)
Subject: Re: Sum by group
Message-Id: <claes_no_spam-2111980020160001@p16.one.canit.se>

In article <3655BE4D.BDE0FADD@email.sps.mot.com>, Tk Soh
<r28629@email.sps.mot.com> wrote:

>[posted to c.l.pm and copy emailed]
>
>c_b9209@my-dejanews.com wrote:
>> 
>> Hi
>> 
>> I want to sum by group in a data file were the first column has groups values
>> and other has regular values. The data file is really huge
>> here is a script for small file but it doesn't works for a big one,please can
>> anyone help me this problem make me crazy
>> 
>> \Claes
>> 
>> sub test{
>> open IN, "$utdata\\tabel.dat" or die "can't open in: $!";
>> while (<IN>){
>> ($var,@DATS)=split(" ",$_);
>>    $suml{$var}  = [  @DATS ];
>>    $sum0{$var}+= $DATS[0];
>>    $sum1{$var}+= $DATS[1];
>>    $sum2{$var}+= $DATS[2];
>>    $sum3{$var}+= $DATS[3];
>>    $sum4{$var}+= $DATS[4];
>>    $ant{$var}+=1;
>> }
>> foreach $key  (sort(keys %sum0)) {
>>     print "$key =  $ant{$key} $sum0{$key} $sum1{$key} $sum2{$key} 
$sum3{$key}
>> $sum4{$key}\n";
>> 
>> }
>> 
>> }
>
>posting multiple copy of the same question doesn't make it quicker, you
>are just congesting this already congested ng.
>
I am sorry it was a misstake

>You did not supply a small sample of you data file, so your code isn't
>helpful enough, though it looked 'normal' to me. You also didn't
>describe axactly what your problem was. BTW, what did you mean by "it
>doesn't works for a big one"?

exampel

indata
1 2 5 7 7 
3 4 5 7 5
1 2 4 5 4
3 4 3 3 5
3 4 5 6 6
2 4 5 6 7
2 5 5 4 4
and I want this
outdata:
1 2 4 9 12 11
2 2 9 10 11 11
3 3 12 13 16 16

the second column is the number in each group
Of course the data file has more rows and columns

\Claes
>
>-TK


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

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

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