[12678] in Perl-Users-Digest
Perl-Users Digest, Issue: 87 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 9 08:39:34 1999
Date: Fri, 9 Jul 1999 04:05:09 -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 Fri, 9 Jul 1999 Volume: 9 Number: 87
Today's topics:
Re: 2 simple questions for a newbie (markus)
Re: 2 simple questions for a newbie <ahands@sprynet.com>
Re: ActiveState OLE and SQLCODE <matt@sergeant.org>
Re: advice on data structures, and more <kelly@pcocd2.intel.com>
Re: advice on data structures, and more (Larry Rosler)
Re: CGI woes for newbie <ianmorty@nortelnetworks.com>
Re: CGI woes for newbie (Bart Lateur)
Re: CGI woes for newbie <gellyfish@gellyfish.com>
Re: Connecting to an Oracle DB with PERL 5 <rhrh@hotmail.com>
Re: Connecting to an Oracle DB with PERL 5 (Gary O'Keefe)
ftp <ianmorty@nortelnetworks.com>
Help!: trying to compile my scripts <smithda@webwide.net>
Re: Help!: trying to compile my scripts (Andrew Johnson)
Re: Help!: trying to compile my scripts (Andreas Fehr)
Re: Help!: trying to compile my scripts <carvdawg@patriot.net>
Re: Login on my website (I.J. Garlick)
Re: Need Expert Help! <dafydd@gointernet.co.uk>
Re: Need help with Win32::ODBC <rhrh@hotmail.com>
Re: OLE & Excel (Michel Dalle)
Re: Program for Easy Writing of Perl Code <cschmitz@stud.informatik.uni-trier.de>
Re: Question: Good Project? (Gary O'Keefe)
Sorting hash of Arrays now drops duplicate keys. <john@hendigital.com.au>
Re: Sorting Hashes of Arrays (Michel Dalle)
Re: toturial <td90537@hotmail.com>
Re: Using perlcc to compile a perl prog richardwchin@my-deja.com
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 Jul 1999 10:06:20 GMT
From: drbrain@ziemlich.org (markus)
Subject: Re: 2 simple questions for a newbie
Message-Id: <slrn7obics.7i1.drbrain@josefine.ben.tuwien.ac.at>
In article <8DFDC4EF9mgcongetnetcom@news.getnet.com>, mike wrote:
>But I would just like to loop thru the array and return all the values
>Something like:
>@values = query->param();
>.
>print join(" | ", @values;
>The above line returns the names of the controls, not the values.
>Any help please?
Why are you expecting the values when you ask for the keywords? If you
want the values, consider this :
@keyword = query->param();
foreach ( @keyword) { printf "\%s = \%s\n", $_m (query->param($_)); }
[take this as pseudo code]
>2. Once I learn how to do this (#1), I want to learn how to dump these values
>into mySQL database. I can successfully connect, run a SELECT staement, and
>return all the values via CGI; now I want to learn how to begin dumping all
>this info into my database.
>Anyone want to throw me a couple of bones!?
Looks something like
$sql = "INSERT INTO table VALUES('".query->param('key1')."','".
query->param('key2')."')";
$dbh->do($sql);
There are better ways to do this and all is described in 'perldoc DBI'
and 'perldoc DBD::mysql'.
sincerly,
Markus
--
" ... light of my life, fire of my loins. My sin, my soul ... "
------------------------------
Date: Fri, 09 Jul 1999 06:39:22 -0400
From: Adrian Hands <ahands@sprynet.com>
To: mike <mgcon@getnet.com>
Subject: Re: 2 simple questions for a newbie
Message-Id: <3785D15A.557F89A4@sprynet.com>
mike wrote:
>
> I am trying to learn Perl (it is my second week) and I have two somewhat simple
> questions.
>
> 1. Using CGI, All I want to do is take all the values from the form, and print
> it out once I click submit. I have been able to define each one seperatley:
>
> $name = query->param("name");
> etc
> etc
> .
> .
> .
> print $name;
>
> But I would just like to loop thru the array and return all the values
> Something like:
>
> @values = query->param();
> .
> .
> .
> print join(" | ", @values;
>
> The above line returns the names of the controls, not the values.
> Any help please?
>
> 2. Once I learn how to do this (#1), I want to learn how to dump these values
> into mySQL database. I can successfully connect, run a SELECT staement, and
> return all the values via CGI; now I want to learn how to begin dumping all
> this info into my database.
> Anyone want to throw me a couple of bones!?
>
> Mike
Something like (untested):
my $dbh = DBI::connect("DBD:mySQL", "myid", "mypasswd");
my $ins = $dbh->prepare("insert into mytable values(?, ?)");
print "<UL>\n";
for $key (query->param()) {
printf("<LI>%s</LI>\n", $query->param($key));
$ins->exec($key, $value);
}
print "</UL>\n";
$dbh->commit();
------------------------------
Date: Fri, 09 Jul 1999 09:41:13 +0100
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: ActiveState OLE and SQLCODE
Message-Id: <3785B5A9.6057A5C4@sergeant.org>
Dorr Lewright wrote:
>
> Two questions:
> 1) What are the differences between using ActiveState (use OLE;) and
> CPAN (use Win32::OLE) for database access to SQLServer DBMS?
use OLE is deprecated. Don't use it. ActivePerl comes with the CPAN
module Win32::OLE.
> 2) When using (use OLE;), how do I get ahold of the SQLCODE value?
Don't do that. Always use Win32::OLE.
Matt.
------------------------------
Date: 09 Jul 1999 00:57:07 -0700
From: Michael Kelly - FVC PCD VET ~ <kelly@pcocd2.intel.com>
Subject: Re: advice on data structures, and more
Message-Id: <us2lncqmf1o.fsf@fht2007.fm.intel.com>
Ross <litscher@cis.ohio-state.edu> writes:
>
> Hi everyone. I know someone is going to point me to the FAQ after
> reading what i ask, but I have looked there and I cannot find what i
> need. I also have "Programming Perl" and has kinda helped, not really
> noticable to you judging by the length of this message, but... trust me.
> Please be gentle. Now here is what i'm trying to do. I need to sort
> entries of a "database" according to zip code first and then within zip
> code, the institution name. So i'm splitting up each line doing
> something like this
>
Ross, I've been through the same ground, and the book looks
just like the POD. Try 'Advanced Perl Programming', it's got just
what you need in the first chapter. And as I have said before, I've
never read past the first chapter. But i intend to get aroundtoit! ;)
I do a lot of sorting based on a list of parameters. The key
for this method, is that one field needs to be unique, between two
lists. You can throw out the line counter, it slows you
down. And you can 'tie' to a database if memory is short.
Once you have your vars assigned, arrange them in 'a hash of a
hash of a hash...' with the most common denominator on the left, and
the least common on the right, your sorting needs are the controlling
factor on the order.
while(<>) { #Untested
...fill the vars, empties are ok, undef them first so there is no bad data.
$database{$state}{$zip}{$city}{$address}{$address_2}{$department}{$institution}{$last_name}{$first_name} = $error_code;
};# END of while CLEAN_LIST
What does it do? You have a 'hash', where there is a 'list'
of "states" that are 'keys' in the 'hash'. Each "state" 'key' points
to a list of "zips", that are in turn 'keys' in a 'hash' pointing to a
list of "cities", that are 'keys'...and so on.
So what good is this? Easy sorting. And you can reuse those
vars, if they are not needed again, else rename the keys comming out.
foreach $state (sort keys %database) { #you get a sorted foreach of the states
print"state=$state\t"; #I do this for debug
foreach $zip (sort keys ${$database{$state}}) { #foreach zip from the current state
print"zip=$zip\t"; # debug
foreach $city (sort keys ${$database{$state}{$zip}}) { #foreach city from the current state and zip
print"city=$city\t"; # debug
yadda...yadda...yadda
} #END of foreach $city
} #END of foreach $zip
} #END of foreach $state
The hardest part is knowing how to take out the end data, as
it is being pointed to by the proceding key. Look up references.
The end result will be
print"error code=$database{$state}{$zip}{$city}{$address}{$address_2}{$department}{$institution}{$last_name}{$first_name}\n";
if the end data were an array it would be @{$database{$state}{$zip...
--
Not speaking for Intel
Michael Kelly (the one in Folsom)
1900 Prarie City Road desk (916) 356-2822
Folsom, CA. 95630 Page (916) 360-5847
M/S FM6-114 fax (916) 356-4561
"Just say not to a pretty GUI"
------------------------------
Date: Fri, 9 Jul 1999 03:57:53 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: advice on data structures, and more
Message-Id: <MPG.11ef757361b02d68989c7b@nntp.hpl.hp.com>
[Posted and a courtesy copy sent. Egregiously long lines reformatted.]
In article <us2lncqmf1o.fsf@fht2007.fm.intel.com> on 09 Jul 1999
00:57:07 -0700, Michael Kelly - FVC PCD VET ~ <kelly@pcocd2.intel.com>
says...
...
> Once you have your vars assigned, arrange them in 'a hash of a
> hash of a hash...' with the most common denominator on the left, and
> the least common on the right, your sorting needs are the controlling
> factor on the order.
>
> while(<>) { #Untested
I'll say! Even if it were fixed so it compiled, it might never finish.
> ...fill the vars, empties are ok, undef them first so there is no
> bad data.
What does 'undef them first' mean? The hashes will be autovivified, and
any 'empties' will automatically be undefined.
> $database{$state}{$zip}{$city}{$address}{$address_2}{$department}
> {$institution}{$last_name}{$first_name} = $error_code;
>
> };# END of while CLEAN_LIST
>
> What does it do? You have a 'hash', where there is a 'list'
> of "states" that are 'keys' in the 'hash'. Each "state" 'key' points
> to a list of "zips", that are in turn 'keys' in a 'hash' pointing to a
> list of "cities", that are 'keys'...and so on.
> So what good is this? Easy sorting. And you can reuse those
> vars, if they are not needed again, else rename the keys comming out.
>
> foreach $state (sort keys %database) {
> #you get a sorted foreach of the states
> print"state=$state\t"; #I do this for debug
> foreach $zip (sort keys ${$database{$state}}) {
^
%
> #foreach zip from the current state
> print"zip=$zip\t"; # debug
> foreach $city (sort keys ${$database{$state}{$zip}}) {
^
%
> #foreach city from the current state and zip
> print"city=$city\t"; # debug
> yadda...yadda...yadda
> } #END of foreach $city
> } #END of foreach $zip
> } #END of foreach $state
Ugggh. O(NlogN * MlogM * LlogL). Kiss your CPU goodbye!
Excerpted from the upcoming paper by Uri Gellman and me,
"A Fresh Look at Efficient Perl Sorting"
<URL:http://www.hpl.hp.com/personal/Larry_Rosler/sort/>:
<QOUTE>
Multi-subkey sorts
Often you need to sort records by a primary subkey, then for all the
records with the same primary subkey value, you need to sort by a
secondary subkey. One horribly inefficient way to do this is to sort
first by the primary subkey, then sort all the records with each primary
subkey by the secondary subkey. ...
</QUOTE>
Perhaps needless to say, there are less 'horribly inefficient' ways to
do the proposed sort, and now you know where to find them.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 09 Jul 1999 10:33:08 +0100
From: Ian Mortimer <ianmorty@nortelnetworks.com>
Subject: Re: CGI woes for newbie
Message-Id: <3785C1D4.AC10BB33@nortelnetworks.com>
Mike,
I think this is what you're after (?):
Stick this lot at the top of your script -
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
You then access the form variables by using lines like:
print "<html>\n";
print "<body bgcolor=white>\n";
print "<center>\n";
print "This is the result from the text input: $FORM{name_of_input1}\n";
print "This is the result from the text input: $FORM{name_of_input2}\n";
etc..
(NOTE: "name_of_input1" is the name of the input tag from your form you
wish to use)
I'm not sure about the SQL bit though.
Ian.
mike wrote:
>
> I am trying to learn Perl (it is my second week) and I have two somewhat
> simple
SNIP
------------------------------
Date: Fri, 09 Jul 1999 10:02:19 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: CGI woes for newbie
Message-Id: <3786c732.9912314@news.skynet.be>
mike wrote:
>$name = query->param("name");
Isn't there a"$" missing before the "query"?
>print $name;
>
>But I would just like to loop thru the array and return all the values
>Something like:
>
>@values = query->param();
>print join(" | ", @values;
>
>The above line returns the names of the controls, not the values.
Yes. The docs for CGI.pm say it would. So, first get the names, and the
use a loop to get the values. Or use map(), to apply the call to each
name in a row.
@names = $query->param();
# version 1
@values = map { $query->($_) } @names;
print join " | ", @values;
#version 2
foreach $name (@names) {
my $value = $query->($name);
print " $name -> $value\n";
}
The latter will be helpful when you want to put them data in the
database.
Bart.
------------------------------
Date: 9 Jul 1999 11:50:10 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI woes for newbie
Message-Id: <3785d3e2@newsread3.dircon.co.uk>
Ian Mortimer <ianmorty@nortelnetworks.com> wrote:
> Mike,
>
> I think this is what you're after (?):
>
No it isnt - he is already using CGI.pm as is clear from his post.
/J\
--
"It's easier for a man to enter a camel is he stands on a box" -
Jonathan Creek
------------------------------
Date: Fri, 09 Jul 1999 08:57:05 +0100
From: Richard H <rhrh@hotmail.com>
Subject: Re: Connecting to an Oracle DB with PERL 5
Message-Id: <3785AB51.4ED4A5BF@hotmail.com>
Jeff Stampes wrote:
>
> David Riggs <driggs@dsw.net> wrote:
> : Basically what I'd like to be able to do is jump into an oracle database
>
> Then go to CPAn and check out the DBD::Oracle module
and DBI.pm which will provide you with all the select, prepare and
execute methods you could wish for,
Richard H
------------------------------
Date: Fri, 09 Jul 1999 10:55:41 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: Connecting to an Oracle DB with PERL 5
Message-Id: <3785d183.94157290@news.hydro.co.uk>
On Fri, 09 Jul 1999 08:57:05 +0100, Richard H <rhrh@hotmail.com>
wrote:
>Jeff Stampes wrote:
>>
>> David Riggs <driggs@dsw.net> wrote:
>> : Basically what I'd like to be able to do is jump into an oracle database
>>
>> Then go to CPAn and check out the DBD::Oracle module
>
>and DBI.pm which will provide you with all the select, prepare and
>execute methods you could wish for,
If performance is an issue, I have timed the performance of perl
scripts using DBD::Oracle and DBI.pm against an equivalent PL/SQL
script and there is no significant change in performance (variances of
the order of seconds with multiple SELECTs on a ~100K row table).
DBI.pm also allows you to maintain multiple connections simultaneously
incase you need to compare or reconcile data between systems. And
dbms_output sucks big time (thank goodness for printf, all hail
printf!), and whoever thought that utl_file was an acceptable way to
access the local filesystem should be taken out, torn to shreds by
angry pitchfork-wielding villagers and their decomposing giblets left
on display outside Oracle's development centre as a warning to the
others...
Perl's the right way to go.
Gary
--
Gary O'Keefe
gary@onegoodidea.com
You know the score - my current employer has nothing to do with what I post
------------------------------
Date: Fri, 09 Jul 1999 10:25:24 +0100
From: Ian Mortimer <ianmorty@nortelnetworks.com>
Subject: ftp
Message-Id: <3785C004.6F360D15@nortelnetworks.com>
Hi all,
Is it possible to run an ftp session using perl ?
I want to send a file generated by my script to another machine on
demand (like a backup system). There would be no need for user
interaction - the machine name, filename, username and password all
remain constant.
Any ideas ?
Ian.
------------------------------
Date: Fri, 9 Jul 1999 01:29:23 -0500
From: "Don Smith" <smithda@webwide.net>
Subject: Help!: trying to compile my scripts
Message-Id: <7m45sa$5fd$1@news.unicomp.net>
Hello,
I am trying to find a method of hiding my sources from the public. I have
looked into the B:: module some and it seems that I should be able to
compile my scripts into either C or Bytecode format. The latter would be
preferred because of its machine-independence. I'm having some problems,
though:
1. I can't seem to find byteperl (which, as I understand it, will execute
bytecode-compiled scripts)
2. I can't find perlcc. The links from CPAN searches are dead-ends. Does
anyone know where it is?
3. Is there a good source of information/examples on how I can best do what
I want (hide deliverable sources)?
Thanks in advance!
-Don
------------------------------
Date: Fri, 09 Jul 1999 09:04:19 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Help!: trying to compile my scripts
Message-Id: <nWih3.5216$SH6.138599@news1.rdc2.on.home.com>
In article <7m45sa$5fd$1@news.unicomp.net>,
Don Smith <smithda@webwide.net> wrote:
! Hello,
!
! I am trying to find a method of hiding my sources from the public. I have
nobody looks under my bed but my wife and the dust bunnies (and my
kids near birthdays and Christmas)---so they'll be reasonably safe
there for a nominal fee.
! 3. Is there a good source of information/examples on how I can best do what
! I want (hide deliverable sources)?
you either deliver sources or you don't ... hiding deliverable
sources seems oxymoronic at best.
regards
andrew
------------------------------
Date: Fri, 09 Jul 1999 09:12:27 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: Help!: trying to compile my scripts
Message-Id: <3785bcc4.13767486@news.uniplus.ch>
On Fri, 09 Jul 1999 09:04:19 GMT, andrew-johnson@home.com (Andrew
Johnson) wrote:
>In article <7m45sa$5fd$1@news.unicomp.net>,
> Don Smith <smithda@webwide.net> wrote:
>! Hello,
>!
>! I am trying to find a method of hiding my sources from the public. I have
>
>nobody looks under my bed but my wife and the dust bunnies (and my
>kids near birthdays and Christmas)---so they'll be reasonably safe
>there for a nominal fee.
>
Give me your address, I'd like to send you my tax forms :)
Andreas
------------------------------
Date: Fri, 09 Jul 1999 06:26:03 +0100
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: Help!: trying to compile my scripts
Message-Id: <378587EB.AC00D6FF@patriot.net>
> I am trying to find a method of hiding my sources from the public. I have
> looked into the B:: module some and it seems that I should be able to
> compile my scripts into either C or Bytecode format. The latter would be
> preferred because of its machine-independence. I'm having some problems,
> though:
Don,
I read the other responses to your question...wow.
Anyway, I, too, have posted asking about perlcc, and not received any
responses. However, since you are using a Microsoft platform, take a
look at:
1. ActiveState has PerlApp, that they claim will create free-standing
executables.
2. http://www.perl2exe.com
------------------------------
Date: Fri, 9 Jul 1999 08:37:02 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: Login on my website
Message-Id: <FELH9q.Atp@csc.liv.ac.uk>
In article <7m3j5o$8te$1@news.vsnl.net.in>,
"Programmaholic" <programmaholic@hotmail.com> writes:
> Hi,
>
> I would also like to create an email system like hotmail, just for
> educational purpose (to understand how it works).
No you don't. Unless you have a large team behind you it will take a very
long time to match Hotmail. Also you need a dedicated very fast server to
do it properly.
>
> I work in Perl - cgi.
>
> Any comments are welcome.
--
Ian J. Garlick
ijg@csc.liv.ac.uk
Mathematicians are like Frenchmen: whatever you say to them they
translate into their own language, and forthwith it is something
entirely different.
-- Johann Wolfgang von Goethe
------------------------------
Date: Fri, 09 Jul 1999 11:21:54 +0100
From: Dafydd Hopkin <dafydd@gointernet.co.uk>
Subject: Re: Need Expert Help!
Message-Id: <3785CD42.DFA02F9E@gointernet.co.uk>
Rick Delaney wrote:
>
> [posted & mailed]
>
> Dafydd Hopkin wrote:
> >
> > Rick Delaney wrote:
> > >
> > > split /(?<!\\)\t/, $line;
> >
> > Parser doesn't like '<', and without it it doesn't work 'cos that's not
> > the way 'lookbehind' works - it'd be lookin to see if the tab itself
> > wasn't a '\' which obviously it wouldn't be.
>
> I should have said this feature requires 5.005. Yes, without the '<',
> you have negative look-*ahead* and it will do what you say.
>
> > It will also miss out on a valid separator like...
> >
> > 1\\ 2 3
> >
> > because the last '\' will be assumed to escape the tab, whereas it was
> > actually escaping another '\'.
>
> Well that wasn't made clear. You could try some variation of
>
> my @a = $line =~ m{([^\t\\]*(?:\\.[^\t\\]*)*)(?:\t|$)}g;
>
> which is just a variation of "How can I split a [character] delimited
> string except when inside [character]?" from perlfaq4.
Sorry - I had looked through the FAQ, but I hadn't found that. Yeah -
their answer is probably the best. This works like a dream...
use Text::ParseWords;
while(<>)
{
@test=quotewords(" ", true, ($_));
print "$#test:@test\n";
}
(with a tab character in the quotes...)
Thanks alot for all your help.
--
Many thanks,
Dafydd
------------------------------
Date: Fri, 09 Jul 1999 08:52:39 +0100
From: Richard H <rhrh@hotmail.com>
Subject: Re: Need help with Win32::ODBC
Message-Id: <3785AA47.FB9AD697@hotmail.com>
Giovanni Davila wrote:
>
> I have this script:
> # -----------------------------------
> use Win32::ODBC;
> $db = new Win32::ODBC( "myDSN" );
> if (!$db->Sql("SELECT * FROM Domains"))
> I'm getting this error: Can't call method "Sql" on an undefined value
> I also get the error with "Close()". It's like it doesn't know that > I'm using Win32::ODBC, which I do have.
It seems to be more like you're uppercasing the first letter of your
method names when probably you shouldn't, Its a while since I used
Win32, but you should check the docs, that the methods aren't like:
$dbh->sql("select la di da");
^
$dbh->close();
^
Richard H
------------------------------
Date: Fri, 09 Jul 1999 10:12:01 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: OLE & Excel
Message-Id: <7m4hvs$qo4$1@news.mch.sbs.de>
In article <7m3ivc$soi$1@nnrp1.deja.com>, hemant_gandhi@my-deja.com wrote:
>Hi all,
>I am processing excel file thru a perl program. reading the excel file
>and loading it in the database. can any one tell me how to find out the
>number of sheets in the excel file ?
Two ways (at least) :
1) by looking at the helpfile of Excel :
the Worksheets Collection Object has a property called Count
2) by looking at the Perl FAQ "Using OLE with Perl" :
the example of saving all the charts to GIF/... shows how to loop
through all the sheets in a workbook
You can also have a look at the Win32::OLE::Enum documentation
for an alternative approach.
Isn't it amazing what kind of junk you find on your PC ? Of course,
it helps if you read it sometimes...
Michel.
------------------------------
Date: 9 Jul 1999 09:48:13 GMT
From: Christoph Schmitz <cschmitz@stud.informatik.uni-trier.de>
Subject: Re: Program for Easy Writing of Perl Code
Message-Id: <7m4ggt$17s$1@fu-berlin.de>
Francisco Romero <fromero@csudh.edu> wrote:
: Does anyone know if there is an application that will help you write
: perl code with ease!
How about XEmacs? Gives you syntax highlighting and automatic
indentation and stuff.
Christoph
--
-- Christoph Schmitz <cschmitz(at)stud.informatik.uni-trier.de> --
The use of COBOL cripples the mind; its teaching should, therefore, be
regarded as a criminal offence. -- Edsger W. Dijkstra
------------------------------
Date: Fri, 09 Jul 1999 10:38:25 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: Question: Good Project?
Message-Id: <3785d05a.93859825@news.hydro.co.uk>
On Thu, 08 Jul 1999 09:11:07 -0400, Chad La Joie <cllajoie@mtu.edu>
wrote:
>That idea is so stupid.
> --CK
>
>Jason Stapels wrote:
>
>> Write Windows2001
>
Yeah, stoopid. It'd work too fast, probably wouldn't be as buggy, and
they might actually ship it out the door on time. I just can't see MS
changing the "look and feel" of their flagship product that
radically...
Gary
--
Gary O'Keefe
gary@onegoodidea.com
You know the score - my current employer has nothing to do with what I post
------------------------------
Date: 9 Jul 1999 16:29:57 -0800
From: "John Hennessy" <john@hendigital.com.au>
Subject: Sorting hash of Arrays now drops duplicate keys.
Message-Id: <01bec9e4$cfb49f40$f34f39cb@stingray>
Thanks to all who responded to the previous post.
I was aware of the Alpha versus Numeric sort functionality but the method I
had used was ineffective.
My problem now is that the sort on group drops any duplicate keys. (Of
course).
ie. I only end up with one user displayed for each group ID.
Ultimately what I need to achieve is to read in the login name, group and
real name, produce output
sorted by login name, real name (preferably surname) and each group
numerically sorted with it's members alpha sorted.
Not asking much of Perl just of my ability.
Help would be appreciated.
John.
------------------------------
Date: Fri, 09 Jul 1999 10:34:55 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Sorting Hashes of Arrays
Message-Id: <7m4jaq$ruk$1@news.mch.sbs.de>
In article <01bec9bd$da310480$f34f39cb@stingray>, "Greg Savage" <greg@hendigital.com.au> wrote:
>I have written the following block of code to read in the login name, group
>ID and Real name from the
>/etc/passwd file. I am using a Hash of the array so I can return all three
>fields with a single key.
>I then use a foreach outside of the main while loop to soft on the key.
>
>This works fine for keys based on login name or real name but I am unable
>to get a numeric sort on
>the group field.
Hmmm, usually you will have several users for one group. With your code,
the hash value will only contain the LAST user with that group ID, not ALL
users for that group...
Depending on what you're trying to achieve, you might use a multi-level
hash instead of a HoL, like :
$hash_pw->{$group}{$login} = $name;
For the rest, have a look at the sort function in Perl. <=> is explained
there...
Michel.
--
aWebVisit - extracts visitor information from WWW logfiles and shows
the top entry, transit, exit and 'hit&run' pages, the links followed
inside your website, the time spent per page, the visit duration etc.
For more details, see http://gallery.uunet.be/Michel.Dalle/awv.html
------------------------------
Date: Fri, 09 Jul 1999 12:38:47 +0200
From: distler <td90537@hotmail.com>
Subject: Re: toturial
Message-Id: <3785D136.6801E439@hotmail.com>
www.cpan.org
good tutorial
------------------------------
Date: Fri, 09 Jul 1999 10:22:54 GMT
From: richardwchin@my-deja.com
Subject: Re: Using perlcc to compile a perl prog
Message-Id: <7m4iho$6qp$1@nnrp1.deja.com>
In article <7kd7fu$e28$1@nnrp1.deja.com>,
wilda1@my-deja.com wrote:
- snip -
> I have sucessfully compiled many other scripts using perlcc
- snip -
could I ask you if you've had any problems using perlcc, I understand
it's still at beta stage. I want to create a single executable rather
than a script that some users might be tempted to edit.
Thanks
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". 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 V9 Issue 87
************************************