[11837] in Perl-Users-Digest
Perl-Users Digest, Issue: 5437 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 21 06:07:22 1999
Date: Wed, 21 Apr 99 03:00:25 -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 Wed, 21 Apr 1999 Volume: 8 Number: 5437
Today's topics:
Re: Any visual editor for Perl: Win32? <jwilson@ic.ac.uk>
Re: Checksums from hell (Bart Lateur)
Re: FAQ 3.26: Why don't perl one-liners work on my DOS/ (Arved Sandstrom)
Headers posted from forms <M.Kanski@if.pw.edu.pl>
Help: Tk markaw2091@my-dejanews.com
Re: Help: Tk <ebohlman@netcom.com>
Re: How can I execute non cgi PERL script under NT? <wyzelli@yahoo.com>
Re: How to interface with C (Thomas Eichmann)
HTTP Error while calling CGI-Script (written in Perl) <bhaverajesh@hotmail.com>
Re: invoking by "fire and forget" (Andrea LN Spinelli)
Re: is it possible "UPDATE tables SET ... WHERE ... "? <gellyfish@gellyfish.com>
Re: Is it possible to have "..." appear while processin <wells@cedarnet.org>
Re: Is it REALLY impossible to install Perl on Windoze? <paladin@uvic.ca>
Re: Is it REALLY impossible to install Perl on Windoze? (Bart Lateur)
Re: Monitoring the state of a serial port HELLLPPPPP vincev@pdq.net
Net::Ping problem <abelem@awi-bremerhaven.de>
Re: Perl 'split' function in C?? (Bart Lateur)
Re: Perl fo win95 <c4jgurney@my-dejanews.com>
Re: Please Help !!!!! <gellyfish@gellyfish.com>
Re: Problem with writing to file. agniora@usa.net
Re: SNMP <philip.smeuninx@be.uunet.net>
Re: Sorting Hashes of Arrays.... <Anthony@Baratta.com>
Suggestions and oneliners for Perl-talk? <Thunderbear@bigfoot.com>
Re: Unix files in MacPerl (Arved Sandstrom)
use Win32::ODBC causes script to hang in browser (Jason Q.)
Re: use Win32::ODBC causes script to hang in browser (Jason Q.)
Re: Wanna post, need programmer help <gellyfish@gellyfish.com>
Re: Web-Based Uploading of Files <Anthony@Baratta.com>
Which cgi tool should i use ? <austin95002887@yahoo.com>
Re: Writing to syslog on Linux (Marc Haber)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 21 Apr 1999 09:34:14 GMT
From: "Jeff Wilson" <jwilson@ic.ac.uk>
Subject: Re: Any visual editor for Perl: Win32?
Message-Id: <01be8bda$1f4a5890$d53ec69b@leicester>
I use PFE on WinNT, it's not Perl specific but it does all I need. Its free
from
http://www.lancs.ac.uk/people/cpaap/pfe/pfefiles.htm
--
Jeff Wilson
London ~ UK
Jim Durkin <jdurkin@gw.total-web.net> wrote in article
<01be8b6f$dfbe6460$4d96bad1@jdurkin>...
> Hi,
>
> I'm a newbie to Perl. Any visual editor commonly used with Perl on
windows
> NT?
>
> Also, can you guide me to any good websites that have network related
Perl
> scripts?
>
> Thanks in advance,
>
> Jim Durkin
>
------------------------------
Date: Wed, 21 Apr 1999 08:26:37 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Checksums from hell
Message-Id: <372288ea.5641676@news.skynet.be>
aaronsca@hotmail.com wrote:
> 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.
If on PC, did you use binmode() on the input filehandle? If not, sysread
and read do the conversion of CR+LF to "\n" (=chr(10)) automatically.
That would throw anything off.
Bart.
------------------------------
Date: Wed, 21 Apr 1999 06:35:29 -0300
From: Arved_37@chebucto.ns.ca (Arved Sandstrom)
Subject: Re: FAQ 3.26: Why don't perl one-liners work on my DOS/Mac/VMS system?
Message-Id: <Arved_37-2104990635290001@dyip-110.chebucto.ns.ca>
In article <371c01d2@cs.colorado.edu>, perlfaq-suggestions@perl.com (Tom
and Gnat) wrote:
> # Mac
> print "Hello world\n"
> (then Run "Myscript" or Shift-Command-R)
>
There is also a menu option for running a single Unix command line using
the MacPerl *application*.
>
> Under the Mac, it depends which environment you are using. The
> MacPerl shell, or MPW, is much like Unix shells in its support for
> several quoting variants, except that it makes free use of the
> Mac's non-ASCII characters as control characters.
>
You shouldn't ever have to use the MPW weird characters anywhere *except*
exterior to the perl -e '...' statement proper; e.g. file specifications
and what have you.
Arved
------------------------------
Date: Wed, 21 Apr 1999 11:12:41 +0200
From: "M.R.Kanski" <M.Kanski@if.pw.edu.pl>
Subject: Headers posted from forms
Message-Id: <hVgT2.2531$811.48717@news.tpnet.pl>
Hi!
I want to know all headers sent from my browser to server. How to do it?
Is it enough just to look in environment variables on the server and then
compare content of
$ENV{'HTTP_REFERER'} with header Http-referer? Aren't there any headers not
included in these variables, that I can missed?
Regards!
Maciej R. Kanski
------------------------------
Date: Wed, 21 Apr 1999 08:48:57 GMT
From: markaw2091@my-dejanews.com
Subject: Help: Tk
Message-Id: <7fk3dp$ie3$1@nnrp1.dejanews.com>
Hi there,
I am taking my first venture into Tk with perl. The applet which is being
written quite simply displays the SQL Server Errorlog in colour. However, I
want it to refresh itself every 2 minutes. I can't seem to work out how to get
the refresh to work. here is the code script which I am working with:
As you will see, the problem is centred around putting the $top ->update; in
the right place so that it keeps on looping. Any help would be greatly
appreciated:
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);
$top ->update;
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");
}
}
close FLE;
}
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 21 Apr 1999 09:17:10 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Help: Tk
Message-Id: <ebohlmanFAJ8Gn.KE1@netcom.com>
markaw2091@my-dejanews.com wrote:
: I am taking my first venture into Tk with perl. The applet which is being
: written quite simply displays the SQL Server Errorlog in colour. However, I
: want it to refresh itself every 2 minutes. I can't seem to work out how to get
: the refresh to work. here is the code script which I am working with:
: As you will see, the problem is centred around putting the $top ->update; in
: the right place so that it keeps on looping. Any help would be greatly
: appreciated:
It needs to go at the end of PresentFile, preferably with a check that
new text was actually written to the display.
------------------------------
Date: Wed, 21 Apr 1999 16:06:58 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: How can I execute non cgi PERL script under NT?
Message-Id: <emeT2.13$OA2.5585@vic.nntp.telstra.net>
David Efflandt wrote in message ...
>On Tue, 20 Apr 1999 15:12:40 -0500, Alejandro Eluchans
><alejandro.eluchans@umb.edu> wrote:
>>I got Perl Builder for NT and it works great.
>>
>>Now, I need to run my PERL scripts (under Win NT) independently of any
>>web server or PERL utility.
>>Maybe using DOS line command (like UNIX) or maybe double clicking on a
>>(.exe) icon?
>>How do I get the PERL interpreter to "compile" my script?
>
>I never used NT, but in Win95 is is as simple as associating the '.pl'
>file extension with perl.exe. Then you simply double click on the file in
>Explorer (the file thing, not MSIE) and perl runs it. Of course you
>cannot enter any parameters that way, but you can get input from STDIN.
>
>But I gave up on that long ago and run it in Linux instead, where
>everything works as intended.
>
I simply create an icon which points to perl.exe then the script I want. I
find it is better to have all the paths described explicitly so you are not
depending on system variables which can vary.
ie the command line I use for one (stored in a shortcut) is:
C:\Perl\5.00502\bin\MSWin32-x86-object\perl.exe c:\perl\account.pl
This works fine
Wyzelli
------------------------------
Date: Wed, 21 Apr 1999 06:46:01 GMT
From: th.eichmann@gmx.net (Thomas Eichmann)
Subject: Re: How to interface with C
Message-Id: <371d731f.4263056@news.eunet.ch>
Yes it's possible.
perldoc perlxs
perldoc perlxstut
another possibility is SWIG (search for it at www.perl.com).
On Wed, 21 Apr 1999 05:08:05 GMT, duggaraju@excite.com wrote:
>Hi all, I would like to know if it is possible to call a C function
>from a perl script as I require it badly. If it is not possible what are the
>other alternatives.
>
>thanks in advance,
>prakash.
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 21 Apr 1999 08:34:06 GMT
From: Rajesh Bhave <bhaverajesh@hotmail.com>
Subject: HTTP Error while calling CGI-Script (written in Perl)
Message-Id: <7fk2hv$hrs$1@nnrp1.dejanews.com>
I have a CGI script which uses CGI.pm and prints key-value pairs for each
element of associative array. It works fine upto some number of elements;
but, gives error while calling CGI script when the number of elements
exceeded. I am sure there is no problem in the CGI script by checking the
previous elements and by passing rest of elements (not with those working
fine) seperately to CGI script; the result is fine (this makes sure that CGI
script is fine). Eror I receive when the number of elements exceed is as
below:
HTTP/1.0 404 Object Not Found (The system cannot find the path specified. )
I require URGENT help on this issue. I need to release my software in 3 days
time. Any help is highly appreciated.
Thanks and Regards,
Rajesh Bhave
Consultant at Hewlett Packard-India Software Operations, Bangalore, India
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 21 Apr 1999 09:37:12 GMT
From: aspinelli@ismes.it (Andrea LN Spinelli)
Subject: Re: invoking by "fire and forget"
Message-Id: <371d97cc.14360545@news.iol.it>
On Mon, 19 Apr 1999 17:49:46 GMT, e_broyles <e_broyles@yahoo.com>
wrote:
>Does this mean that there is no way to get a child process that continues to
>run even if the parent process dies or stops intentionally?
I think you made several errors in you original post,
(not quoting which perl are you using, not
posting your code or a simplified version)
but as I saw you being kicked in the face, I empathised
with you and now I try to put this thread towards a constructive
conclusion.
I tried the following code (copied from the Win32::Process docs,
with minor changes)
---file is q.pl---
use Win32::Process;
sub ErrorReport{
print Win32::FormatMessage( Win32::GetLastError() );
}
Win32::Process::Create($ProcessObj,
"c:\\windows\\notepad.exe",
"notepad c:\\tmp\\q.pl",
0,
NORMAL_PRIORITY_CLASS,
".")|| die ErrorReport();
I tried it on my Win95 home machine, because I am ill at home, but
I am absolutely sure it works on my office WinNT box.
Now, if I launch this thing with
perl q.pl
I see notepad pop up on my desktop, then q.pl exits,
and notepad continues to work. Now, his means, IMHO,
that your question at the beginning of this post has a
'no' answer: you _can_ spawn a process which continues
to run even after the father has died.
Now, what is your _real_ problem? Since you did
not post your code, I have only hypoteses:
a. you tried using 'system', which is not absolutely what you
need
b. you used Win32::Process, with incorrect arguments.
The incorrect argument is presumably the 5th. I cannot experiment
here at home, but I suggest you to open the source code
of win32::process (on my box it is in
c:\bin\perl\site\lib\win32\process.pm) and
see the list of constants towards the beginning (it
starts with
CREATE_DEFAULT_ERROR_MODE
CREATE_NEW_CONSOLE
CREATE_NEW_PROCESS_GROUP
CREATE_NO_WINDOW
....
Now you can experiment with those values (I
think a good guess might be DETACHED_PROCESS)
The, and this is the most important thing I ask you,
_please_ post what you came out with on this group.
See you
Andrea
------------------------------
Date: 21 Apr 1999 09:56:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: is it possible "UPDATE tables SET ... WHERE ... "?
Message-Id: <371d92a6@newsread3.dircon.co.uk>
Park, Jong-Pork <okmail@hanmail.net> wrote:
> I tried for this. but failed.
>
> $sth=$dbh->prepare("
> UPDATE table1, table2 SET name='Name', address='somewhere' WHERE table1.ID = table2.ID
> ");
> $sth->execute;
>
How failed ?
You should check that 'prepare' succeed and print $dbh->errmsg if it did not.
Beyond that it is impossible to say anything as you dont say what Database
you are using and have not told us in what way this not working. Doris
is good but not that good.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Wed, 21 Apr 1999 08:47:16 +0000
From: Steve Wells <wells@cedarnet.org>
Subject: Re: Is it possible to have "..." appear while processing?
Message-Id: <371D9094.1B16D5CF@cedarnet.org>
Bart Lateur wrote:
>
> Steve Wells wrote:
>
> > unless ($answer =~ # this works case insensitvely for
> > # y, yes, yup, yeah, yep and (ye, yu, yus and yuah too)
> > /^[Yy](?:[Ee]|[Uu])?(?:[Ss])?(?:[Aa][Hh])?(?:[Pp])?$/);
> >
>
> You really dispise this?
>
> /^y[eu]?s(?:ah)?p?$/i
> or
> /^(?:y|yes|yup|yeah|yep)$/i
>
> or even
>
> (lc $answer) =~ /^y[eu]?s(?:ah)?p?$/
>
> Which ALL are more easy to grasp?
>
> Bart.
Bart -
You're right. I tend to avoid /i if I can help it but in this case
it doesn't matter much. I suppose I like the last one best but the
second one is probably easiest to understand I think combining the
two and yielding:
(lc $answer) =~ /^y(?:es|up|eah|ep)?$/
is probably your best bet as it's easy to read and efficient.
There is certainly more than one way to do it,
STEVE
--
-----------
Stephen D. Wells
http://expert.cc.purdue.edu/~bgannon/booksearch/
------------------------------
Date: Tue, 20 Apr 1999 23:07:45 -0700
From: Draco Paladin <paladin@uvic.ca>
Subject: Re: Is it REALLY impossible to install Perl on Windoze???
Message-Id: <Pine.A41.4.05.9904202305270.14598-100000@unix3.UVic.CA>
On Wed, 21 Apr 1999 agniora@usa.net wrote:
> In article <MPG.1186ed807b2b64c2989691@news.supernews.com>,
> mjw@bahnhof.se wrote:
>
> hmm... i once had trouble with ActivePerl and later i found out that it runs
> out of hard disk spaces. it takes something above 100megs it seems. have u
> checked ur hard disk space?
You are off by almost an order of magnitude. I just checked my
ActiveState install (build 507) and it is ~17-18 megs. I haven't tried to
install the newest build yet (515 IIRC) but I can't see it adding 80 megs
to the install size.
--
Mother is the name for GOD on the lips and
hearts of all children. - Eric Draven
------------------------------
Date: Wed, 21 Apr 1999 08:26:39 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Is it REALLY impossible to install Perl on Windoze???
Message-Id: <372389e0.5887685@news.skynet.be>
Draco Paladin wrote:
>You are off by almost an order of magnitude. I just checked my
>ActiveState install (build 507) and it is ~17-18 megs. I haven't tried to
>install the newest build yet (515 IIRC) but I can't see it adding 80 megs
>to the install size.
That depends on the harddisk's sector size. Most of the space needed for
Perl is just air, as most files are small compared to current sector
sizes.
Bart.
------------------------------
Date: Wed, 21 Apr 1999 05:50:28 GMT
From: vincev@pdq.net
Subject: Re: Monitoring the state of a serial port HELLLPPPPP
Message-Id: <371d6643.446524889@news.pdq.net>
I am in the same situations, but still searching for clues...
I have checked that faq, already. And no, that faq offers
no insights on opening a serial port connection. If you
found any other infos, plezzz post them ....
thanks..
On Wed, 07 Apr 1999 15:32:40 GMT, gellyfish@gellyfish.com (Jonathan
Stowe) wrote:
>On Wed, 07 Apr 1999 16:08:43 +0100, Lucio Godoy
><lucio@corp.netcom.net.uk> wrote:
>
>>plz hellllllppppppp
>>
>>Lucio Godoy wrote:
>>>
>>> Hi All;
>>>
>>> I would like to monitor the state of my serial port, for instance:
>>>
>>> if port is high or 1 do something and when the port is low or 0 do
>>> something else.
>>>
>>> But i dont know how to interact with the serial ports. I use a linux
>>> box, /dev/ttyS0.
>>>
>>> How can i do that, plz ?
>>>
>
>Ok calm down - I would go and read the perlfaq8 manpage wherein it
>hath a section entitled:
>
>=head2 How do I read and write the serial port?
>
>which goes into some detail on this matter.
>
>/J\
------------------------------
Date: Wed, 21 Apr 1999 10:43:15 +0200
From: "Andre L. Belem" <abelem@awi-bremerhaven.de>
Subject: Net::Ping problem
Message-Id: <371D8FA3.BF571980@awi-bremerhaven.de>
Hi Perl friends,
I'm using the module Net::Ping to test hosts, doing exactly what the
Perl Cookbook recommend, but it's not working.
Look my script:
#!/bios4/user1/LWperl5/bin/perl -w
use strict;
use Net::Ping;
# <---------------- here test if SeaWiFS and WWW-AWI are alive
$alive = Net::Ping->new("tcp"); # not root! use tcp
(defined $alive)
or die "Something wrong with Net::Ping procedure: $!\n";
if ($alive->ping("www.awi-bremerhaven.de")) {
print "AWI-WWW is alive\n";
} else {
print "AWI-WWW may be down\n";
}
$alive->close;
Here is the response when I try to execute it:
[bios4] /home/bios1/abelem/www-bios4 :just.pl
Global symbol "$alive" requires explicit package name at just.pl line 8.
Execution of just.pl aborted due to compilation errors.
So...I'm a beginner and I don't understand what means "explicit package
name !".
Could someone help me ??
Thanks in advance
Andre
--
Andre L. Belem
Alfred-Wegener Insitut f|r Polar- und Meeresforschung
Postfach 12 01 61
D-27515 Bremerhaven
Phone: +49-471-4831-809
FAX : +49-471-4831-425
Take an Ice Tour at http://www.awi-bremerhaven.de/Eistour/index-e.html
Also very interesting is
http://www.awi-bremerhaven.de/Eistour/seawifs/index-e.html
------------------------------
Date: Wed, 21 Apr 1999 08:26:34 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl 'split' function in C??
Message-Id: <37218884.5540010@news.skynet.be>
Krusty276 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?
Source code for Perl. Or maybe even the source for Awk.
Bart.
------------------------------
Date: Wed, 21 Apr 1999 08:20:31 GMT
From: Jeremy Gurney <c4jgurney@my-dejanews.com>
Subject: Re: Perl fo win95
Message-Id: <7fk1od$h53$1@nnrp1.dejanews.com>
In article <fgbT2.233$h35.3286@newsfeed.slurp.net>,
"Igor Daudt" <igdaudt@conex.com.br> wrote:
> Do you know where can I download full version of perl for win95?? I'd
> like to install that in my computer...
>
> Igor Daudt
> igdaudt@conex.com.br
Good choice.
http://www.ActiveState.com/ActivePerl/
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 21 Apr 1999 09:29:47 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Please Help !!!!!
Message-Id: <371d8c7b@newsread3.dircon.co.uk>
Jasjit Singh <jasjit@teleport.com> wrote:
> Thats wrong it actually should be
>
> $email = "someone@somewhere.someplace";
In string, @somewhere now must be written as \@somewhere at -e line 1,
near "someone@somewhere"
Execution of -e aborted due to compilation errors.
Please test your code before you post or distinguish at as being untested
somehow.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Wed, 21 Apr 1999 07:17:32 GMT
From: agniora@usa.net
Subject: Re: Problem with writing to file.
Message-Id: <7fju2a$d8h$1@nnrp1.dejanews.com>
can u all please look at my 2nd posting on this thread. i emphasized my
problem a lot over there. thanks :) agniora
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 21 Apr 1999 11:20:28 +0200
From: "Philip Smeuninx" <philip.smeuninx@be.uunet.net>
Subject: Re: SNMP
Message-Id: <7fk58d$ap4$1@xenon.inbe.net>
I tried the following :(host, community and oid are definied!):
{
my $session = SNMP::Session->new($host, $community);
my $vars = SNMP::VarList->new($oid);
if ($session->get($vars)) {
($bindings) = $session->decode_get_response ($session->{pdu_buffer});
while ($bindings ne '') {
($binding,$bindings) = &decode_sequence ($bindings);
($oid,$value) = &decode_by_template ($binding, "%O%@");
print $pretty_oids{$oid}," => ",
&pretty_print ($value), "\n"; }
}
else {
die "No response from agent on $host";
}
I always get "No response from agent on ...", but when I type at the
command line :
"snmpget host community system.sysDescr.0"
I get an answer!?
Do you know what is wrong in my routine?
Many thanks in front,
Philip
Yaroslav Buga wrote in message <7fidel$oi0$1@MU.icmp.lviv.ua>...
>Just go to:
>
>http://www.switch.ch/misc/leinen/snmp/perl/
>
>
>
>
>Philip Smeuninx wrote in message <7fi7i7$nb7$1@nickel.uunet.be>...
>>Hello,
>>
>>How can I send SNMPGETS in perl???
>>
>>Philip
>>
>>
>
>
------------------------------
Date: Wed, 21 Apr 1999 01:27:54 -0700
From: Anthony Baratta <Anthony@Baratta.com>
Subject: Re: Sorting Hashes of Arrays....
Message-Id: <371D8C0A.E4011339@Baratta.com>
I rummaged through the examples in the FAQ and didn't understand them. I
did figure out a way to do what I want - but would like to understand
the examples given for sorting Hash on their values.
The examples are basically what's in the Camel Book...Chapter 4. e.g.
# print the whole thing sorted by number of members and name
1 foreach $family ( sort { @{$HoL{$b}} <=> @{$HoL{$a}} } keys %HoL ) {
2 print "$family: ", join(",", sort @{ $HoL{$family} }), "\n";
3 }
I understand how line 2 works. Sorting the 'list' contained withing
$HoL{$family} 'horizontally' just before print out. But I don't
understand Line 1 - What compare is this doing here... @{$HoL{$b}} <=>
@{$HoL{$a}} ??
Does this take each line of the $HoL{$family} and compare it to the one
above it for sorting? So that a Hash of Array like this...
%HoL = (
flinstones => [ "fred", "barney" ],
simpsons => [ "homer", "marge", "bart"" ],
jetsons => [ "george", "jane", "elroy" ],
);
Would print out like...
flinstones: barney, fred
jetsons: elroy, george, jane
simpsons: bart, homer, marge
And what if I had a Hash of Array like this.....
%HoL = (
StoreID1 => [ "A Store Name", "A Street Address", "A City", "A State",
"A Zip" ],
StoreID2 => [ "C Store Name", "C Street Address", "C City", "C State",
"C Zip" ],
StoreID3 => [ "B Store Name", "B Street Address", "B City", "B State",
"B Zip" ],
StoreID4 => [ "D Store Name", "D Street Address", "A City", "A State",
"A Zip" ],
);
How would I sort on City then Store Name between StoreIDs (vertically)
and print out the info that order? So my print out looks like this....
"A Store Name", "A Street Address", "A City", "A State", "A Zip"
"D Store Name", "D Street Address", "A City", "A State", "A Zip"
"B Store Name", "B Street Address", "B City", "B State", "B Zip"
"C Store Name", "C Street Address", "C City", "C State", "C Zip"
Thanks in advance.
--
Anthony Baratta
President
KeyBoard Jockeys
South Park Speaks Version 3 is here!!!
http://www.baratta.com/southpark
Powered by Tsunami
------------------------------
Date: Wed, 21 Apr 1999 10:58:01 +0200
From: Thorbjoern Ravn Andersen <Thunderbear@bigfoot.com>
Subject: Suggestions and oneliners for Perl-talk?
Message-Id: <371D9319.BE313067@bigfoot.com>
I have the pleasure to talk in our local Linux user group on Tuesday
about Perl.
Since this is an excellent opportunity to show the possibilities with
Perl, I would like some ideas for what I should tell and demonstrate in
the 2-3 hours I have available (expected audience is people who do know
how to program but does not know perl), and I am intending to mention
the following:
o regular expressions
o dynamic arrays
o hashes
but there must be additional "power tools" within perl which would be
suitable for the uninitiated.
I would also like some one-liners to spice up the show :-) I am looking
for stuff for everyday use (like convert all filenames to lowercase) but
also show-offs like "Crack in one line of Perl".
Any good suggestions?
Thanks in advance for any help :-)
--
Thorbjxrn Ravn Andersen "...plus...Tubular Bells!"
http://www.bigfoot.com/~Thunderbear
------------------------------
Date: Wed, 21 Apr 1999 06:41:54 -0300
From: Arved_37@chebucto.ns.ca (Arved Sandstrom)
Subject: Re: Unix files in MacPerl
Message-Id: <Arved_37-2104990641540001@dyip-110.chebucto.ns.ca>
In article <slrn7hp1g5.pqs.fl_aggie@stat.fsu.edu>,
fl_aggie@thepentagon.com wrote:
>
> Major overkill...if Jason will simply set his ftp client to transfer his
> perl code in ASCII mode and not binary, this "problem" will go away.
>
A more general solution still cries out for some utility scripts of the
sort Tom Christiansen has written, and which most any MacPerl user has a
few of, too.
Using Alpha or BBEdit is a time-waster for batch conversion. Plus, I get
PC and UNIX format files from everywhere, not just via FTP. There is
absolutely *nothing* to identify them as text except my knowledge of what
they are. So some batch-oriented MacPerl droplets for line-end conversions
(and others for setting creator/file type) are just the ticket.
Arved
------------------------------
Date: Wed, 21 Apr 1999 06:49:33 GMT
From: pigs_can_fly@mindless.com (Jason Q.)
Subject: use Win32::ODBC causes script to hang in browser
Message-Id: <371f74c6.30058315@news.cyberway.com.sg>
Hi
I'm learning to access an MS Access database using Perl and
Win32::ODBC.
The script works fine when I run it from the command prompt. However,
when I try to run it on Netscape and IE, the script fails to run and I
get a "Trasferring data from 127.0.0.1" message on the status bar and
eventually "Document contains no data".
I have found out that the line
use Win32:ODBC;
is the cause. Why don't the browsers recognise this line? And what
must be done so that the script will run?
Any help would be appreciated. Thanks
JQ
------------------------------
Date: Wed, 21 Apr 1999 07:15:25 GMT
From: pigs_can_fly@mindless.com (Jason Q.)
Subject: Re: use Win32::ODBC causes script to hang in browser
Message-Id: <37217acd.31602487@news.cyberway.com.sg>
Ooops. a typo there:
>use Win32:ODBC;
use Win32::ODBC;
JQ
------------------------------
Date: 21 Apr 1999 10:10:43 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Wanna post, need programmer help
Message-Id: <371d9613@newsread3.dircon.co.uk>
Wyzelli <wyzelli@yahoo.com> wrote:
> And this ridiculous followup doesn't waste just as much (actually more)
> bandwidth and NG server space? ;-)
>
> Followed by this one which makes me as bad as you now... heh
>
> Where is the book of rules on NG posting syntax?
>
> In your head?
>
The newsgroup:
news.announce.newusers
Unfortunately nowadays there are too many people posting that
dont even know that group exists and why and thats way people
get pickier over matters of netiquette.
/J\
------------------------------
Date: Wed, 21 Apr 1999 01:01:51 -0700
From: Anthony Baratta <Anthony@Baratta.com>
Subject: Re: Web-Based Uploading of Files
Message-Id: <371D85EF.975D0B33@Baratta.com>
Toh Sek Lune wrote:
>
> Just want to find out is there any way in perl to pass the files
> specified in the form fileupload object to be mailed as attachment to
> the specified recipient?
Its not too complicated, I use cgi-lib.pl to take care of most of the
complications of accepting uploads. You can get cgi-lib.pl from
http://cgi-lib.stanford.edu/cgi-lib/
He has a few example scripts/pages you can snag to figure out how to do
it.
--
Anthony Baratta
President
KeyBoard Jockeys
South Park Speaks Version 3 is here!!!
http://www.baratta.com/southpark
Powered by Tsunami
------------------------------
Date: Wed, 21 Apr 1999 15:24:21 +0800
From: "Austin Ming" <austin95002887@yahoo.com>
Subject: Which cgi tool should i use ?
Message-Id: <7fjuee$l2f$1@justice.csc.cuhk.edu.hk>
I am a beginner of CGI.
I enccounter a problem as i do not know which software should i use to run
cgi.
Because, different people use different software.
Any CGI expert please give me a reommendation.
[ActivePerl 515] , [ Apache HTTP Server v1.3.6 ] , [ Sambar 4.1 ]
Among these softwre, which one is the best to run CGI ??
------------------------------
Date: Wed, 21 Apr 1999 08:49:51 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: Re: Writing to syslog on Linux
Message-Id: <7fk3el$mfe$13@news.rz.uni-karlsruhe.de>
njc@dmc.uucp (Neil Cherry) wrote:
>Writing a message to syslog. It executes, but no errors and no
>entry. But one interesting thing happened today when I upgraded to
>Linux 2.2.5. Dmesg report no /dev/log. I think I need a new ksyslog or
>something under 2.2.5. That still doesn't explain what happens with
>2.2.1.
Sys::syslog uses TCP/UDP (can't remember which and don't have a UNIX
system available in this hotel room). So you gotta run your syslogd to
accept network connections (man syslogd, it's a command line option).
Be sure to firewall that port (513?) to prevent possible
Denial-Of-Service-Attacks if you run syslogd receiving network
connections.
Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
------------------------------
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 5437
**************************************