[11825] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5425 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 20 06:07:31 1999

Date: Tue, 20 Apr 99 03:00:19 -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           Tue, 20 Apr 1999     Volume: 8 Number: 5425

Today's topics:
    Re: Adding TCPIP # <wyzelli@yahoo.com>
    Re: blank form fields <kallidan@KDscripts.com>
    Re: CGI programmer wanted <staffan@ngb.se>
    Re: Check for NT Groups on 95 Client? <jholmes@nospam.psrw.com>
        Checksums from hell aaronsca@hotmail.com
    Re: Djgpp or Activestate ? <gellyfish@gellyfish.com>
    Re: Eliminate to another array <uri@sysarch.com>
    Re: FAQ 3.27: Where can I learn about CGI or Web progra <kai@sparc.spb.su>
    Re: Globdammit!!! <ronald_f@my-dejanews.com>
        Looping with Tk markaw2091@my-dejanews.com
    Re: obtaining user's PATH statement <ronald_f@my-dejanews.com>
    Re: Perl 'split' function in C?? <gellyfish@gellyfish.com>
    Re: Perl pipe under OS/2 broken? <ibelgaufts@gfc-net.de>
    Re: Perl Script to append data to text file <uri@sysarch.com>
    Re: Perl, VB, or Java??? <ronald_f@my-dejanews.com>
        Problem with writing to file. agniora@usa.net
    Re: Problem with writing to file. <Michael.Cameron@nospam.technologist.com>
    Re: Scripting language with LFN support? <harth@rz.uni-frankfurt.de>
        scriptlet to add line breaks at even multiples? <webmaster@counsel.net>
        Sorting Hashes of Arrays.... <Anthony@Baratta.com>
    Re: Sorting Hashes of Arrays.... (Michel Dalle)
        T-shirt with potential Perl-logo <occitan@esperanto.org>
    Re: Top 10 newbie errors? (Ran)
    Re: Wanna post, need programmer help (Larry Rosler)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 20 Apr 1999 18:12:56 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Adding TCPIP #
Message-Id: <k6XS2.2$vz2.375@vic.nntp.telstra.net>

All things are working now.. I have two scripts to process the radius log.

The first is a spruced up version of raquick.pl by Carl Rigney circa 1994.
This gives :

username, time online (hhh:mm:ss) Mb Input ###,###,### Mb Output ###,###,###

in a simple display to screen. (a separate version writes to a file and
re-sets the detail file to allow monthly processing.)

The second file condenses the log into:

username, connect time (date, time), disconnect time (date, time), time
online, Mb Input, Mb Output, IP number of session

This is written to a file (about 1/10 size of original) which is then a lot
easier to process in almost any form (SQL, Excel, etc)

Thanks to all and particularly Jonathon for the help.

If anyone wants copies just e-mail me...

Wyzelli

Jonathan Stowe wrote in message <371b06c8@newsread3.dircon.co.uk>...
>Wyzelli <wyzelli@yahoo.com> wrote:
>> I have a short Perl script which parses a file and extracts information
>> which is incremented to three arrays by key $user.
>>
><snip>
>
>> A sample of the file to be parsed is below.
>>
>> Wed Mar 31 18:10:17 1999
>>  Acct-Session-Id = "0F00007B"
>>
>
>Hmm,  Radius. Appalling logfile output.  I thought I had a program that
>does exactly (or nearly) what you wanted however I discovered it was a
shell
>script and not exactly something you would show in front of the children.
>
>Anyhow to match dotted quad IP number you could use:
>
>/(d+\.d+\.d+\.d+)/
>
>On a more general note what we do with this stuff is hack it around a bit
>to remove duplicates and create a '|' separated file that is then loaded
>into a MySQL database on a different server - bear in mind that these logs
>can get huge - and thus we can create reports without worrying about the
>nasty file format.
>
>/J\
>--
>Jonathan Stowe <jns@gellyfish.com>
>




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

Date: Tue, 20 Apr 1999 07:32:36 +0000
From: "Kalli Dan." <kallidan@KDscripts.com>
Subject: Re: blank form fields
Message-Id: <371C2D56.31525508@KDscripts.com>

Try this:

if ($survey_form{'comments_need_for_solutions_brochures'} eq "") {
        $solbro_comments++;
}

--
mikej wrote:

> Hi,
>
> I need a way of telling if someone left a form text field blank. I tried
> this:
>
> if (defined $survey_form{'comments_need_for_solutions_brochures'}) {
>         $solbro_comments = $solbro_comments + 1;
> }
>
> but even when I leave that text field blank and submit the form, the
> script will see the
> defined statement as true and increment the $solbro_comments variable
> when its not
> supposed to. I only want it to increment $solbro_comments if the text
> field had
> something entered into it. Any tips?
>
> Thanks....



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

Date: Tue, 20 Apr 1999 10:29:07 +0200
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: CGI programmer wanted
Message-Id: <371C3AD3.5C310457@ngb.se>

Diablo Killuminati wrote:
> 
> I opperate a couple of new adult sites and I am in need of a good CGI
> programmer.

If you really mean what you say - you don't need a CGI programmer. You
need to shut the sites down. 

If you have sites that in a good way discuss the problems of growing up
into adulthood (becoming a new adult), I wish you all the best of luck,
since more sites of this type could be wished for. In that case you need
to repost with some more information about the position and the terms.

Staffan


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

Date: Mon, 19 Apr 1999 10:41:12 -0400
From: "Jim Holmes" <jholmes@nospam.psrw.com>
Subject: Re: Check for NT Groups on 95 Client?
Message-Id: <7fffg8$mvo$1@flint.psrw.com>

Thanks, Kevin.

>Check the WIN32::NetAdmin Module as well.  There is a function there called
>"IsMember" where you supply the servername and groupname.

Win32::NetAdmin::GroupIsMember supports specifying a server, group and user.
Unfortunately,  this doesn't work for 95/98 machines, only NT -- unless I've
installed my Perl incorrectly...


>Jim, usually this is done with a KIX script:
>
>IF InGroup("groupname")
>    shell ("perlscript.pl")
>END IF


I've pretty much figured out that we'll have to use KIX to support 95
clients while we're migrating them over to NT.


Again, thanks!

Jim




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

Date: Tue, 20 Apr 1999 07:14:38 GMT
From: aaronsca@hotmail.com
Subject: Checksums from hell
Message-Id: <7fh9gq$vj5$1@nnrp1.dejanews.com>

So it's like this:  I want to be able to generate checksums just like the BSD
"sum" program. I tried the unpack("%32C*", <>) way just like in the camel
book. This works fine until you try to checksum hundreds of files that are
hundreds of megs.  It takes forever.  So, I tried going the sysread method,
but for some reason I just can't get it right.	Some of the checksums are ok,
but others are wrong, and it is really frustrating.  Snippet of code:

  my($fh) = gensym;
  open($fh, $file) || die;
  for(;;){
    $_ = sysread($fh, $buf, 512);
    unless(defined($_)){
      next if $! =~ /EAGAIN|EWOULDBLOCK/o;
      last;
    }
    last if ($_ == 0);
    $tsiz += $_;
    $csum += unpack("%16C*", $buf);
  }
  close($fh);
  $nsum = int($csum / 65535);
  $csum += $nsum;
  $csum %= 65535;


Any perl code suggestions would be appreciated.

Thanks,

-Aaron

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 20 Apr 1999 10:28:42 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Djgpp or Activestate ?
Message-Id: <371c48ca@newsread3.dircon.co.uk>

Hubert Toullec <Hubert.Toullec@wanadoo.fr> wrote:
> I am a DJGPP Tools user since several years now.
> 
> I plan to begin to use the perl language but before, I would appreciate to
> have some advice on which distribution to use : the DJGPP or the ACTIVESTATE
> one ?
> 
> As far as I know, the present release level is 5.005_02 for DJGPP and a bit
> higher for ACTIVESTATE.
> 
> At identical release level, what are the differences between these two
> distributions ?
> 


If you are on a Win32 Platform (as opposed to DOS/Win3.1*) then you probably
want to use the ActiveState distribution. djgpp works really well to a point
but there is no network support for instance - but because it will run on
the sixteen bit platforms with the appropriate extender where necessary
it is still hanging in there.

> What about add-ons (perlscript, etc) and are they usable on both
> distributions ?
> 

ActivePerl is fairly well supported for modules that can be installed
via the Perl Package Manager program - djgpp will require you to
install your modules in the usual way which will most probably require
the full djgpp development kit and sundry other tools.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: 20 Apr 1999 02:15:38 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Eliminate to another array
Message-Id: <x7so9ves1h.fsf@home.sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  LR> In article <MPG.1185abd93965e5fe9898e6@nntp.hpl.hp.com> on Mon, 19
  LR> Apr 1999 22:09:29 -0700, Larry Rosler <lr@hpl.hp.com> says...  ...
  >> @a0 = map { /^aaa/ ? do { push @a1, $_; () } : $_ } @a0;

  LR> I like Uri's grep much better (but somewhat simplified, IMO):

  LR>   @a0 = grep !/^aaa/ || (push(@a1, $_), 0), @a0;

that is sort of what i was aiming at but my brain couldn't reduce the
boolean logic. once i got it to work, i posted it. i never thought about
?: as it seemed like too much work. i just needed a way to make the push
return false.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Tue, 20 Apr 1999 11:31:07 +0400
From: "Arzhan I. Kinzhalin" <kai@sparc.spb.su>
Subject: Re: FAQ 3.27: Where can I learn about CGI or Web programming in Perl?
Message-Id: <Pine.GSO.4.02.9904201129130.20806-100000@minerva.sparc.spb.su>

On 20 Apr 1999, Tom Christiansen wrote:

->
->        CGI FAQ
->            http://www.webthing.com/page.cgi/cgifaq
->

This link seems to be broken - requsted document was not found on this server.
Should it be revised? :)

xcore



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

Date: Tue, 20 Apr 1999 06:19:23 GMT
From: Ronny <ronald_f@my-dejanews.com>
Subject: Re: Globdammit!!!
Message-Id: <7fh695$t6f$1@nnrp1.dejanews.com>

In article <7ffu5e$ser@news.service.uci.edu>,
  "Gabriel Richards" <grichard@uci.edu> wrote:
> Does glob not work right on win32 systems?

As an alternative to the recommendations David gave in this thread, you
could also install KGlob (available on CPAN), which offers ksh-globbing
w/o the need of a shell.

Ronald
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 20 Apr 1999 07:19:22 GMT
From: markaw2091@my-dejanews.com
Subject: Looping with Tk
Message-Id: <7fh9pl$vtm$1@nnrp1.dejanews.com>

Hi There,

I am trying to do some work with a SQL Server Error Log. Basically, I want to
be able to refresh my current view of the log every 5 minutes. (For the
purposes of this code I am doing the refresh every 1000ms.) Basically, I am
using Tk to show the current errorlog and on reading it in am performing some
basic work to colour-code the text (Pretty straight forward really.

The problem I have (and can't seem to find the answer to) is how do I
instruct Perl to reload the file after the timeout? I have tried to use to
subroutines - one to open the file and the other to close the file but this
appears to be where I am having problems. This is my first venture into
working with Tk. Here is the code I am currently working with:

use strict;
use Tk;

my $top = MainWindow->new;
$top->title('MAW SQL Error Log Status');

my $text = $top->ROText( qw/-width 100 -height 40 /);
$text->tagConfigure("blue-text", -foreground => 'blue');
$text->tagConfigure("red-text", -foreground => 'red');
$text->tagConfigure("black-text", -foreground => 'black');
$text->pack;

my $timer = $text->repeat(1000, \&PresentFile);
$timer = $text->repeat(1000, \&CloseFile);
MainLoop;

sub PresentFile {
	open FLE, "errorlog" || die "Could not open file: $!";
	while (<FLE>) {
		if ($_ =~ m/.*err.*/i) {
			$text->insert('end', "$_", "red-text");
		} elsif ($_ =~ m/.*dump.*/i) {
			$text->insert('end', "$_", "black-text");
		} else {
			$text->insert('end', "$_", "blue-text");
		}
	}
}

sub CloseFile {
	close FLE;
}

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 20 Apr 1999 06:16:10 GMT
From: Ronny <ronald_f@my-dejanews.com>
To: j_joy@my-dejanews.com
Subject: Re: obtaining user's PATH statement
Message-Id: <7fh635$t5e$1@nnrp1.dejanews.com>

(This message mailed and posted)

In article <7fggae$asb$1@nnrp1.dejanews.com>,
  J. Joy <j_joy@my-dejanews.com> wrote:
> I am trying to write a checker which will eval a given Unix user's environment
> and return various problems with it.  To that end I would like to be able to
> obtain the user's path (PATH) as it would be if they logged in so I could see
> if has a "." in it, or what all they have included, that sort of thing.

$ENV{PATH} gives the PATH as a string. You can use the 'split' function to
make an array of elements, each one containing one PATH element.

Hope that helps.

Ronald
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 20 Apr 1999 10:36:30 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl 'split' function in C??
Message-Id: <371c4a9e@newsread3.dircon.co.uk>

Krusty276 <krusty276@aol.com> wrote:
> Does anyone have one, or know of a site that has the split funtion of Perl
> converted to C?   Sorry I'm just lazy, and wanna save sometime before I start
> working on this?

Er yes the Perl source code has ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: Tue, 20 Apr 1999 11:56:53 +0200
From: =?iso-8859-1?Q?J=FCrgen?= Ibelgaufts <ibelgaufts@gfc-net.de>
Subject: Re: Perl pipe under OS/2 broken?
Message-Id: <371C4F65.22A30BD0@gfc-net.de>



Ilya Zakharevich wrote:
> 

> Time to look into the docs.
 
Thank you for pointing me to the obvious ;-)

> If you want to ask shell to run 'dir' shell command, you need to do it
> explicitly:
> 
>   open F, 'cmd -c dir';
> 
> (as it is documented).

I finally got it to work with 'cmd /c dir'. Here is some
additional information that I find useful to make the code
portable between Windows and OS/2.

I found it necessary to quote the command itself, because a
statement like

open F, 'cmd /c dir *';

will lead to a SYS3175 access violation under OS/2, and 

open F, 'cmd /c dir a*';

prints out the filenames, but adds a file statistics to every
single file, while

open F, 'cmd /d "dir a*"';

prints the same output like the command line entry dir a* does.

Is there some kind of magic globbing under OS/2 before Perl or
EMX hands the command over to cmd.exe? Is it possible to turn it
off?

Regards,

Juergen


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

Date: 20 Apr 1999 02:26:15 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl Script to append data to text file
Message-Id: <x7ogkjerjs.fsf@home.sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  >> I think what you need is a good book, I'm a beginner as well and
  >> found a really easy book about perl. I would consider it the
  >> "coloring book" of perl, but it covers all fundementals.
  >> 
  >> PERL & CGI by Elisabeth Castro almost right out of the book page
  >> 193

  LR> Well, for sure it is sick-sick-sick.

i am of the conclusion that if newbies find a perl book easy, it must be
a bad book. not that perl is hard, but writing about it in a so-called
easy style always seems to be frought with bugs. if you can't grok the
llama or camel, you might not be in the right profession of vocation.

oh, why is our field so easy to enter? how many newbies are there in
medicine or accounting?

hey, that disease was covered in "liver infections for dummies". just pump
him full of amoxycillin. it seems to work on my dog.

stand aside from that collapsed man, i can do a triple bypass on him
with my swiss army knife and my fountain pen (shades of danny kaye's
walter mitty!). i read about it in "learn cardiac surgery and
needlepoint in 21 days".

:-)

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Tue, 20 Apr 1999 06:06:44 GMT
From: Ronny <ronald_f@my-dejanews.com>
Subject: Re: Perl, VB, or Java???
Message-Id: <7fh5hf$smk$1@nnrp1.dejanews.com>

In article <01be8ab1$8ac45640$4d96bad1@jdurkin>,
  "Jim Durkin" <jdurkin@gw.total-web.net> wrote:
> I need to constantly
> monitor the output of call records being generated by a switch.
> These records are being spooled to a network management station (NT
> Server with IIS).  Multiple files will be created.  These records are
> delimited by
> commas and contain data that determine the performance and error status (if
> any) of voice calls.  I need to look at certain fields of each record
> and determine if an event needs to be generated to a my network management
> software (NNM).  In addition, I
> plan to massage the data and make it available on the Internet.  I have a
> couple of questions:
>
> 1.  What language do you recommend to perform this task?  (Perl for NT,
> Java, or VB?)

You did not mention how you have to monitor the switch, and what flavor of
events you have to generate, so I suppose you already know that it can be
done easily with all languages (and if these interfaces are not extremely
exotic, than this should be indeed the case). I never worked with VB, but
using this language would lock you into the Windows world, while Java and
Perl allow you to be flexible in switching the operating system.

Perl has good pattern matching facilities builtin, so I would personally use
this language. OTOH, if you want to use OO design tools for your task (like
Rational Rose), Java has the advantage that it is supported by many. Actually,
I don't know if there exists at all an OO design tool that is able to generate
Perl code.

>
> 2.  Should I feed the records into a database, such as an SQL server?
> Then, utilize SQL to access the pertinent data?

If you want to formulate various queries on your data, this could be an
advantage.
If you simply want to store the records based on some key, and retrieve them
using the key, you could also use the DBM module that comes free with Perl.
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 20 Apr 1999 07:29:02 GMT
From: agniora@usa.net
Subject: Problem with writing to file.
Message-Id: <7fhabo$1e9$1@nnrp1.dejanews.com>

why doesnt this script here work?

open OUTFILE, ">upal.txt";
print OUTFILE "HI";
printf OUTFILE ("Hello  %5.0f %5.0f\n",9375,93257392);

it creates a file called upal.txt but theres nothing in the file.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 20 Apr 1999 08:55:33 +0000
From: Michael Cameron <Michael.Cameron@nospam.technologist.com>
To: agniora@usa.net
Subject: Re: Problem with writing to file.
Message-Id: <371C4105.257C6EAA@nospam.technologist.com>

agniora@usa.net wrote:

> why doesnt this script here work?
>
> open OUTFILE, ">upal.txt";
> print OUTFILE "HI";
> printf OUTFILE ("Hello  %5.0f %5.0f\n",9375,93257392);
>
> it creates a file called upal.txt but theres nothing in the file.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

One change (adding the shebang line which I assume you have, why not post
the *whole* script)
It works fine for me using perl, version 5.004_04 built for i386-linux.
See:

[mcameron@synteks mcameron]$ cat test.pl
#!/usr/bin/perl
open OUTFILE, ">upal.txt";
print OUTFILE "HI";
printf OUTFILE ("Hello  %5.0f %5.0f\n",9375,93257392);
[mcameron@synteks mcameron]$ test.pl
[mcameron@synteks mcameron]$ cat upal.txt
HIHello   9375 93257392
[mcameron@synteks mcameron]$

You may need to post more detail to get more help...

HTH,
Michael Cameron



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

Date: Tue, 20 Apr 1999 08:42:18 +0000
From: Alexander Harth <harth@rz.uni-frankfurt.de>
Subject: Re: Scripting language with LFN support?
Message-Id: <371C3DEA.5FFA07C@rz.uni-frankfurt.de>

> > I'd probably pick perl as well, but my brother keeps raving about
> > python.  Both of those are available on Win32 and Unix platforms.
> > Perl is probably a bit more widespread default...
> 
> Both Perl and Python are good choices, IMHO.  But your preference
> will depend on your prior experiences in computing, your CS coursework,
> and your natural tendencies as a programmer and as a person.
> 
> You may want to try both, and decide which fits better with your
> own personal style.  I prefer Perl [well duh], but some people
> love the consistent interface of Python [and hence hate Perl].

I think one more criteria for selecting the programming language 
is the ready to use stuff which still exists. I dont know about 
python, but for perl exist many tools in the CPAN archives.

Yours
Alexander


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

Date: Tue, 20 Apr 1999 00:01:15 -0700
From: "Counsel.Net" <webmaster@counsel.net>
Subject: scriptlet to add line breaks at even multiples?
Message-Id: <371C263B.A747D8FA@counsel.net>

Hi all,

Is there a simple solution for adding linebreaks on long fields?  I have
a field fed by a web form which I want to wrap at about 80 characters. 
Wrapping the field via the HTML input textarea is not an option here.  I
figure I want the data to wrap at the first word break less than 80
characters for each line.  Is there a simple substitution operation I
can do on this data that will do this for me?

Thanks,

Bob Reap
==


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

Date: Mon, 19 Apr 1999 23:22:17 -0700
From: Anthony Baratta <Anthony@Baratta.com>
Subject: Sorting Hashes of Arrays....
Message-Id: <371C1D19.CB740B54@Baratta.com>

Howdy...

Here is the data....ID, Name, Address, City (being pulled from an mSQL
Database)

What I am looking for is the best way to store this info in an Array,
Hash, Hash of Arrays - whatever allows me to pull the data out ordered
by City and Name.

Would I be better off using the 'order by' option with the SQL select
statement when I retrieve the data and then iterating through the list
with a for loop? Or is there some automagical sort option with a Hash of
Arrays that allow me to sort by the City and Name fields?

Any thoughts would be appreciated.

-- 
Anthony Baratta
President
KeyBoard Jockeys
                    South Park Speaks Version 3 is here!!!
                       http://www.baratta.com/southpark
                              Powered by Tsunami


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

Date: Tue, 20 Apr 1999 11:53:25 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Sorting Hashes of Arrays....
Message-Id: <7fhil6$e11$1@news.mch.sbs.de>

In article <371C1D19.CB740B54@Baratta.com>, Anthony Baratta <Anthony@Baratta.com> wrote:
>Howdy...
>
>Here is the data....ID, Name, Address, City (being pulled from an mSQL
>Database)
>
>What I am looking for is the best way to store this info in an Array,
>Hash, Hash of Arrays - whatever allows me to pull the data out ordered
>by City and Name.
>
>Would I be better off using the 'order by' option with the SQL select
>statement when I retrieve the data and then iterating through the list
>with a for loop? Or is there some automagical sort option with a Hash of
>Arrays that allow me to sort by the City and Name fields?
>
>Any thoughts would be appreciated.
>

AFAIK, mSQL is probably more efficient in ordering the data before you
pull it out. Since you only have one table, you can put the data in a simple 
hash afterwards (with unique ID), or even an array (with record no.).
>From similar tests, I'd say, just try it out both ways and time it. Results 
will depend on the number of resulting records, the database schema, your 
platform, how often you need to run this (or how often your data changes)...

You might even (oh horror), consider dumping the database in CSV format
and use 'sort' on Unix :-)

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: Tue, 20 Apr 1999 07:58:39 GMT
From: Daniel Pfeiffer <occitan@esperanto.org>
Subject: T-shirt with potential Perl-logo
Message-Id: <7fhc3d$2q1$1@nnrp1.dejanews.com>

Saluton retanoj!

During my holidays in the Dominican Republic (well -- paradise), I saw
several people with a T-shirt, that I didn't have too much trouble getting
for myself. I guess most Perlies would recognize it as having a Perl-logo: it
shows an @-sign, where the a is replaced by a camel whose hind leg leads to
the spiral. On the back it has the same logo in big, plus a slogan "where
it's @".  Besides a copyright ) 1997 RJRTC and an indication "made in China"
there's no clue as to what it's really about.

best regards -- Daniel
--
Perl |berall:
Perl everywhere:	http://beam.to/iPerl/
Perl ^cien:

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 20 Apr 1999 09:49:53 GMT
From: ran@netgate.net    (Ran)
Subject: Re: Top 10 newbie errors?
Message-Id: <924601793.248.100@news.remarQ.com>

In <371bf46a.3254335@news.roalok1.mi.home.com>, clintp@geeksalad.org (Clinton Pierce) writes:

>But using a B&D language can spoil the wonder in simply pasting a
>little bit of code from here-and-there and making the computer do what
>you want.  

It can also spoil the "wonder" of trying to figure out why:

   for ($i = 0; $i < $lim; $l++)

"just puts the computer in a loop",  when a "use strict" would've caused
a "Hey,  what's this '$l' thingie?" before the problem arose.

>Sometimes it's best to ignore the man behind the curtain.

There is no man behind the curtain:  there's a hunk of 
specially-processed sand,  mindlessly acting out a script written for it
by people who probably weren't even aware of the existence of our 
hypothetical newbie programmer.  Despite the fact that the script called
"perl" includes some well-chosen defaults that reduce its tendency to do
completely-off-the-wall (so to speak) things when presented with 
ambiguous input,  the system has a level of actual intelligence that
makes the average 3-year-old look like Steven Hawking.

>New programmers have to worry about semicolons, $@&%, and whether
>their brackets match up.

They also have to worry about small typos hidden in a still-unfamiliar 
background that screw up their attempts to Just Do One Simple Thing.

>Let them have "use strict", when they need it.

Which would be "Until the ESP::DWIM module gets out of beta"...

Ran




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

Date: Mon, 19 Apr 1999 23:20:35 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Wanna post, need programmer help
Message-Id: <MPG.1185bc92b7a3867e9898e9@nntp.hpl.hp.com>

In article <7fh2dg$j97$1@client2.news.psi.net> on 20 Apr 1999 05:13:20 
GMT, Abigail <abigail@fnx.com> says...
> jeanb (jean_barry@my-dejanews.com) wrote on MMLVII September MCMXCIII in
> <URL:news:7fg92b$4eo$1@nnrp1.dejanews.com>:
> \\ Can someone tell me what's going on.
> 
> Well, Tammy-Lee and Johnny got married; forced by their parents because
 ...
> End of this weeks summary of comp.perl.lang.misc. 
> 
> Next week, same perlchannel, same perltime.

:-)

This may well be Abigail's longest (and most informative?) post, ever.

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


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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