[9807] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3400 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 9 12:07:17 1998

Date: Sun, 9 Aug 98 09:00:23 -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           Sun, 9 Aug 1998     Volume: 8 Number: 3400

Today's topics:
    Re: Access, ODBC and Linux (Alfred Reibenschuh)
        Advanced Perl Programmer Needed (Sara Young)
    Re: Can't make flock work as described... <jimbo@soundimages.co.uk>
    Re: comp.lang.perl.announce redux (Florian Kuehnert)
    Re: comp.lang.perl.announce redux (Florian Kuehnert)
        Encryption webmaster@schnibitz.hypermart.net
    Re: Encryption (Honza Pazdziora)
    Re: File already opened by another process? (Florian Kuehnert)
    Re: File already opened by another process? <rra@stanford.edu>
        Is this an unstable version? <phil@aireus.net>
    Re: Is this an unstable version? <perlguy@inlink.com>
    Re: Is this an unstable version? (Michael J Gebis)
    Re: math error <T.Bridgwater@mindgear.com>
    Re: mirroring CPAN thru socks proxy? <dereks@fc.hp.com>
    Re: Perl for Win32 Question <JKRY3025@comenius.ms.mff.cuni.cz>
        Redefining routines <mortensi@idt.ntnu.no>
    Re: Redefining routines (M.J.T. Guy)
    Re: Returning hashes of hashes (Larry Hunter)
    Re: sorting hash by values <ljz@asfast.com>
    Re: sorting hash by values <tonylabb@infonline.net>
    Re: sorting hash by values <tonylabb@infonline.net>
    Re: sorting hash by values <jdw@dev.tivoli.com>
    Re: Underwood Typewriter and the backslash (Miguel Cruz)
    Re: Underwood Typewriter and the backslash (Jeffrey Drumm)
        Win32 - win95: dir *.log with no files of this type in  <posern@informatik.uni-marburg.de>
    Re: Win95 Server and Perl CGI Scripts (Martin Vorlaender)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sun, 09 Aug 1998 13:05:04 GMT
From: Reibenschuh@Interdrive.com (Alfred Reibenschuh)
Subject: Re: Access, ODBC and Linux
Message-Id: <35cd9a30.3639593@news.tuwien.ac.at>

On 7 Aug 1998 17:28:21 GMT, scott@softbase.com wrote:

>Stiphane Dupille (sdupille@yahoo.com) wrote:
>
>> 	I try to access Access database on WinNT from a linux
>> workstation.
>
>Isn't going to happen. Access is not a database like Oracle and DB2
>which can be accessed over a network. Access is a single-machine
>small-time database not meant for client/server applications.  (That
>doesn't stop people from *thinking* Access is capable of doing more
>than it does, but anyone who tries to use it for anything other than a
>mailing list will quickly discover the truth!)


As far as my experiences reach:

connecting from Windows NT 4.0
	        +Apache 1.3.1
	        +perl 5.005
	        +DBI/DBD-ODBC
	        +Informix CLI-ODBC

	     to IBM AiX 4.1.5
                +Informix Dynamic Server
                 with Universal Data Option

was done with little difficulty once VC++ 5.0 is already installed.

even the other way provided little resistance:

connecting from IBM AiX 4.1.5
	        +perl 5.005
	        +DBI/DBD-ODBC
	        +iODBC

	     to Windows NT 4.0
                +MSJet ODBC for Accesss 97
	         or Excel 97

i could even connect back to the Informix Server 
(which is IMHO a bad idea since DBI/DBD-Informix is a lot faster)

try looking for iODBC which already runs on many un*x platforms under:
     
       http://users.ids.net/~bjepson/freeODBC/


but my solution to the problem may be a lot more interresting:

if you are running linux, give postgres a try. install postODBC
under the NT box and let access write to the postODBC database 
rather than its own slow fileaccess.


i hope this makes some sense to you people out there ....

--fredo
-- Alfred Reibenschuh


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

Date: 9 Aug 1998 06:10:54 GMT
From: syoung@actcom.co.il (Sara Young)
Subject: Advanced Perl Programmer Needed
Message-Id: <6qjehe$has$1@lnews.actcom.co.il>

Advanced Perl Programmer Needed.

Fun, creative firm in Washington, D.C. seeks talented and
enthusiastic team player to help create, revise and innovate
financial-related Perl programs for the Web.

Qualifications include: B.S. in Computer Science or Engineering,
advanced knowledge of Perl, and SQL, familiarity with Solaris,
excellent communication skills, and a sense of humor.  Familiarity 
with PHP is a plus.  Experience with heavy load web sites a must.  
Should be available on weekends to handle emergencies.

This is an off-site contract position.

Compensation: depending on experience.

Send inquiries to: syoung@actcom.co.il.  Please include availability,
a resume, and list of URLs of sites that you have built.



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

Date: 09 Aug 1998 15:01:23 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: Can't make flock work as described...
Message-Id: <ubtpuz230.fsf@jimbosntserver.soundimages.co.uk>

"Ekenberg" <joreb@algonet.se> writes:

How about .plx? This was the suggested extention in Learning Perl on
Win32 Systems. As a result, .plx is what I use.

-- 
Jim Brewer
e-mailed courtesy copies are unappreciated, please refrain.


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

Date: 9 Aug 1998 11:14:22 GMT
From: sutok@gmx.de (Florian Kuehnert)
Subject: Re: comp.lang.perl.announce redux
Message-Id: <slrn6sr14d.1p0.sutok@babylon.in-berlin.de>

Birgitt Funk schrieb/wrote/icrivait/ha scritto:
>Perl:Einfuehrung, Anwendung, Referenz
>by Farid Hajii
>Addison-Wesely-Longman
>Haven't seen the book yet, Hajii is not a German last name per se,
>but the book is written in German and is not a translation from
>another language.

s/Hajii/Hajji/g

Yup, and this book is quite good. Never seen a better chapter about
"References". Unfortunately, the author wastes too much space with
explanations of Apache, HTTP 1.0/1.1, but nevertheless, the book is
worthy its 80DM (about $50).

  Florian


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

Date: 9 Aug 1998 11:17:55 GMT
From: sutok@gmx.de (Florian Kuehnert)
Subject: Re: comp.lang.perl.announce redux
Message-Id: <slrn6sr1b3.1p0.sutok@babylon.in-berlin.de>

Frank schrieb/wrote/icrivait/ha scritto:
>Wie dieses ischd: dr Moderador figd oi Link an dr Onderseide jedes
>Bfoschdens hinzu (hinzugfigd ibr en Berl-Endex, selbschdvrschddndlich) dr
>BabelFish AldaVischdas bassend hervorrufd, om a gewinschde Ibersedzong
>zu geba.

*ROTFL* 

Ich bin manchmal *wirklich* froh, dass ich in Berlin wohne.

  Florian


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

Date: Sun, 09 Aug 1998 00:13:48 -0700
From: webmaster@schnibitz.hypermart.net
Subject: Encryption
Message-Id: <35CD4C2C.292C81FE@schnibitz.hypermart.net>

Hello!
It is my understanding that there are certain perl mods that perform
certain types of encryption.  As some of you know, I have been working
on a perl-based HTTP proxy server*.  Netscape can encrypt its data using
SSL (secure socket layer) data transfers.  Here is what I would like to
be able to do, but I am not sure if it is possible.  A client with
Netscape, or whatever, uses the proxy, but wants the communication
between the browser and the proxy to be encrypted.  Can the proxy trick
the browser into invoking SSL?  Is it as simple as typing something like
https://somehost.org/ at the location field of the browser or would it
be more complicated?  If SSL can be invoked by using https://, I know
what I need to do and it is not a problem, but if not, I would be sorta
lost.
Also, do any of the perl mods handle the encryption used in SSL?  Or
would I have to write a library to handle it?  Anyhow, if you can answer
these questions or point me in the right direction, It would be greatly
appreciated.  Thanx in advance!

~Prime

P.S.
I would like to give a word of thanks to all of the responses to my
oddball questions so far.  I have been able to not only get the proxy
running, but it also filters rogue javascript and HTML.  It would
probably not be running so well, had I not recieved the advice that many
of you supplied.  Greatly appreciated!





*Yes I am aware of Mr. Schwartz's proxy, but for some trivial reason I
have not gotten it to work.



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

Date: Sun, 9 Aug 1998 13:10:47 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Encryption
Message-Id: <slrn6sr7um.fs.adelton@nemesis.fi.muni.cz>

On Sun, 09 Aug 1998 00:13:48 -0700, webmaster@schnibitz.hypermart.net <webmaster@schnibitz.hypermart.net> wrote:

[...]

> Also, do any of the perl mods handle the encryption used in SSL?  Or
> would I have to write a library to handle it?  Anyhow, if you can answer
> these questions or point me in the right direction, It would be greatly
> appreciated.  Thanx in advance!

bash$ perl -MCPAN -e shell
cpan> i /ssl/

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
Please note: won't be answering my email from Aug 10 to 14 -- will be gone.


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

Date: 9 Aug 1998 11:31:55 GMT
From: sutok@gmx.de (Florian Kuehnert)
Subject: Re: File already opened by another process?
Message-Id: <slrn6sr25b.1p0.sutok@babylon.in-berlin.de>

Bart Lateur schrieb/wrote/icrivait/ha scritto:
>Besides, RFC-821 (SMTP) constantly mentions CRLF as line terminators.
                   ^^^^

News are transmitted via NNTP. Look to RFC1036.

  Florian


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

Date: 09 Aug 1998 04:51:03 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: File already opened by another process?
Message-Id: <m3pveajrvc.fsf@windlord.Stanford.EDU>

Florian Kuehnert <sutok@gmx.de> writes:
> Bart Lateur schrieb/wrote/icrivait/ha scritto:

>> Besides, RFC-821 (SMTP) constantly mentions CRLF as line terminators.
>                    ^^^^

> News are transmitted via NNTP. Look to RFC1036.

That's the news format RFC.  The NNTP RFC is RFC 977, and it turns out
that news as well is transmitted using CRLF as line terminators.  But all
news articles are translated that way, and converted back to Unix line
termination automatically for those of us who use Unix newsreaders.  In
order for us to see extra CRs in news postings, the posts have to have
lines ending in CRCRLF, and in fact this is exactly what some broken PC
newsreaders occasionally generate.  :(

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


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

Date: Sat, 8 Aug 1998 22:37:01 -0700
From: "Philip Thomas" <phil@aireus.net>
Subject: Is this an unstable version?
Message-Id: <35cd357b.0@news.mediacity.com>

Hello all,

I just need to know is this an unstable version, and  if so would it be
recommend to upgrade to version 5 asap ?

kids2@home001>perl -v

This is perl, version 4.0

$RCSfile: perl.c,v $$Revision: 1.7.2.2 $$Date: 1998/03/12 19:27:47 $
Patch level: 36

Copyright (c) 1989, 1990, 1991, Larry Wall

Perl may be copied only under the terms of either the Artistic License or
the
GNU General Public License, which may be found in the Perl 4.0 source kit.

Thanks




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

Date: Sun, 09 Aug 1998 00:42:58 -0500
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Is this an unstable version?
Message-Id: <35CD36E2.C1277F11@inlink.com>

Philip Thomas wrote:
> 
> Hello all,
> 
> I just need to know is this an unstable version, and  if so would it 
> be recommend to upgrade to version 5 asap ?
> 
> kids2@home001>perl -v
> 
> This is perl, version 4.0
                        ^^^^

AAARRGH!  

Do not pass go, do not collect $200, upgrade to version 5.005 NOW!

I don't know if it is "unstable", but I do know that A LOT has changed
since version 5.x came around...

-- 
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: 9 Aug 1998 08:28:28 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Is this an unstable version?
Message-Id: <6qjmjc$5l7@mozo.cc.purdue.edu>

"Philip Thomas" <phil@aireus.net> writes:
}I just need to know is this an unstable version, and  if so would it be
}recommend to upgrade to version 5 asap ?

}kids2@home001>perl -v
}This is perl, version 4.0
}$RCSfile: perl.c,v $$Revision: 1.7.2.2 $$Date: 1998/03/12 19:27:47 $
}Patch level: 36

Yes, this is pretty stable, in the same sense that the pyramids are
stable.

You'll notice that your copy was copyright 1991--Hammer time!
"Home Alone" and "Pretty Woman" were two of the top ten movies.  Twin
Peaks was mystifying people all over the country.  Two Germanys became
one.  Operation Desert Shield became Operation Desert Storm.  John F.
Kennedy Jr. finally passed the New Your Bar Exam. 

(Sticklers for detail will note that Perl 4.036 came out in '93, but I
don't have a high school yearbook for 1993, so 1991 will have to do.)

In any case, do yourself a favor: upgrade.

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Sun, 09 Aug 1998 13:50:07 -0700
From: Tom Bridgwater <T.Bridgwater@mindgear.com>
Subject: Re: math error
Message-Id: <35CE0B7F.EC06360B@mindgear.com>

Nem W Schlecht wrote:
> 
> [courtesy copy e-mailed to author(s)]
[snip...]
> Very interesting.  It seems that with the 23/5 combination, it fails on
> *certain* numbers that are divisible by 5.  I added a loop around this
> function and ran it through 1000.  97 values failed in this range using the
> 23/5 comb.  The first 10 were 25, 45, 50, 55, 85, 90, 95, 100, 103, & 110.
> I'm running perl5.005.  Can you check these numbers and see if they fail
> for you as well?  There were a bunch of others as well (23/10 failed quite
> a bit as well).  It also seems that it only fails on numbers that are
> already whole.  It works on some whole numbers, but fails on others.  Quite
> odd.  I guess I would consider this a bug.

I tried those values as the denominator and they failed for me as well
(I assume 103 should have been 105). I then tested a whole bunch of
values, the results of which can be found at
http://www.mindgear.com/perlerr/MathErr.html

I don't really know what to make of the results, but I see that there is
definitely a pattern to this strangeness.

--TomB


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

Date: Sun, 09 Aug 1998 05:00:34 +0000
From: Derek <dereks@fc.hp.com>
Subject: Re: mirroring CPAN thru socks proxy?
Message-Id: <35CD2CF2.59DE4582@fc.hp.com>

Relying to my own post...

FYI (if anyone else cares):   A "socks version" of perl is indeed one which
has been soxified.  Once I got an up-to-date socks client library, I was
able to find this out by trial and error.  (Mostly error.)  I now have
mirror 2.8 mirroring CPAN just nicely.

Derek.

Derek wrote:

> Folks,
>
> I want to set up a local mirror of CPAN for internal use behind our
> firewall.  Ideally I'd like to use our socks gateway for this.
>
> The man page that comes with the mirror.pl program (at
> http://www.perl.com/CPAN-local/scripts/ftpstuff/mirror-2.8.tar.gz)
> explains how to use it with socks, provided you are using what it refers
> to as "a SOCKS version of perl".
>
> Does anybody know what "a SOCKS version of perl" means?  I've read every
> perl FAQ I can find and all the READMEs in the distribution, I've
> searcehd CPAN and the man pages, and found no clues.  Perhaps a "SOCKS
> version of perl" is just one that has been "soxified" using the tools
> that come with SOCKS distribution?
>
> Any help would be appreciated.
>
> Thanks,
> Derek.





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

Date: Sun, 09 Aug 1998 17:44:20 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: Perl for Win32 Question
Message-Id: <35CE4264.37F4@comenius.ms.mff.cuni.cz>

pat mercer wrote:
> 
> hello,
> 
>   I've got a question regarding ActiveState's Perl for Win32.
> Does anybody know the best way how to get the current directory?
> Does ActiveState have the following UNIX equivalent, $ENV{PWD} ?
> 
> thanks.
> 
> -pat mercer

!!! $ENV{PWD} is the current directory when the script was started.
It is not updated if you change the working directory later !!!

use Cwd;

print "\$ENV{PWD} = $ENV{PWD} , cwd = ",cwd,"\n";

chdir '/some/other'

print "\$ENV{PWD} = $ENV{PWD} , cwd = ",cwd,"\n";

HTH, Jenda


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

Date: 9 Aug 1998 12:42:30 GMT
From: Morten Simonsen <mortensi@idt.ntnu.no>
Subject: Redefining routines
Message-Id: <6qk5fm$b7r$1@due.unit.no>

Hi

I have 5 modules, A-E, where 

A require B
B require C,D,E
C require E
D require E

Should the require-state in C and D be left out?

If I have an extra module F which is required by all the modules,
should this only be explictly required in A?

Thanks for any answer

Morten Simonsen

P.S. If use require statement everywhere, I get "redefining
subroutine"-warning.


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

Date: 9 Aug 1998 14:12:03 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Redefining routines
Message-Id: <6qkanj$9oh$1@pegasus.csx.cam.ac.uk>

Morten Simonsen  <mortensi@idt.ntnu.no> wrote:
>Hi
>
>I have 5 modules, A-E, where 
>
>A require B
>B require C,D,E
>C require E
>D require E
>
>Should the require-state in C and D be left out?
>
>If I have an extra module F which is required by all the modules,
>should this only be explictly required in A?

Since require always checks if the module is already loaded, it never
does any harm to require modules more than once.

If you *know* that C will only ever be used in conjunction with B, the
require E; in module C is indeed redundant.   But it's better practice
to avoid making assumptions like that.   Then module C will be more
easily reusable.

>P.S. If use require statement everywhere, I get "redefining
>subroutine"-warning.

Since require only loads a particular piece of code once, this warning
must be being caused by something else.   Perhaps some two of your
modules define a subroutine of the same name in the same package.


Mike Guy


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

Date: 9 Aug 1998 13:11:27 GMT
From: lhunter@acm.org (Larry Hunter)
Subject: Re: Returning hashes of hashes
Message-Id: <6qk75v$qu7$1@hiram.io.com>

In article <35cac459.8275815@news.saix.net>, posenj@lancet.co.za says...
>
>However, the function returns an empty hash.
 ...
>  my %prefs    = @$prefsref;    # but this is empty!!!

You dereferenced a hash reference as an array. Try
  my %prefs=%$prefsref;
Or dereference the reference directly, and while you
are at it remember to dereference the element of the
top level hash since that element is a hash:
   print ${$prefsref->{0}}->{'type'}; 
(I didn't test the previous line - concur with the previous
reply about the code being suspiciously complicated.)
Check the section on references in Effective Perl Programming
for good description of references in multilevel data 
structures.

-- 
------------------------------------------------------------------------
Larry Hunter         lhunter@acm.org         http://www.io.com/~lhunter/



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

Date: 09 Aug 1998 07:55:56 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: sorting hash by values
Message-Id: <lthfzm74j7.fsf@asfast.com>

jjones@nospam.elementdesign.com (j) writes:

> I have a hash with a bunch of words as keys, and the number of times
> they occured in the file as values.
> 
> I want to sort the values and print them out, with their corresponding
> keys, in numerical order.
> 
> [ ... ]

Try this ...

 %hash = ( 'dick'  => 5,
           'jane'  => 7,
           'sally' => 2,
           'spot'  => 1,
           'tim'   => 0,
           'puff'  => 3 );

 foreach $key ( sort { $hash{$a} <=> $hash{$b} } keys %hash ) {
    print "$key\t$hash{$key}\n";
 }


-- 
 Lloyd Zusman   ljz@asfast.com
 perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'


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

Date: Sun, 09 Aug 1998 07:43:57 -0400
From: Tony Labbiento <tonylabb@infonline.net>
Subject: Re: sorting hash by values
Message-Id: <35CD8B7D.AF637E1B@infonline.net>

Try this:

#!/usr/bin/perl

sub mysort {
    my ($gtl);
    if ( $hash{$a} == $hash{b})
        $gtl = $a cmp $b;
    } else {
        $gtl = $hash{$a} <=> $hash{$b};
    }
    return $gtl;
}

@sortlist = sort mysort (keys %hash);
foreach (@sortlist) {
    print "$_ : $hash($_)\n";
}

j wrote:

> I have a hash with a bunch of words as keys, and the number of times
> they occured in the file as values.
>
> I want to sort the values and print them out, with their corresponding
> keys, in numerical order.
>
> I have no problem doing this with keys, but haven't the slightest idea
> how to do it with values.  Yes, I have looked at the perl faq, but
> that was no help.
>
> Any help appreciated...
> thanks!



--
   ****************************************
   *    Tony Labbiento                    *
   *    Infinity Online, Inc.             *
   ****************************************




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

Date: Sun, 09 Aug 1998 07:52:29 -0400
From: Tony Labbiento <tonylabb@infonline.net>
Subject: Re: sorting hash by values
Message-Id: <35CD8D7D.C083FE9D@infonline.net>

Sorry, caught my own mistake. You need an open brace { where indicated
below. This is right after the conditional.

Tony Labbiento wrote:

> Try this:
>
> #!/usr/bin/perl
>
> sub mysort {
>     my ($gtl);
>     if ( $hash{$a} == $hash{b})

------------------------------------^ {

>         $gtl = $a cmp $b;
>     } else {
>         $gtl = $hash{$a} <=> $hash{$b};
>     }
>     return $gtl;
> }
>
> @sortlist = sort mysort (keys %hash);
> foreach (@sortlist) {
>     print "$_ : $hash($_)\n";
> }
>
> j wrote:
>
> > I have a hash with a bunch of words as keys, and the number of times
> > they occured in the file as values.
> >
> > I want to sort the values and print them out, with their corresponding
> > keys, in numerical order.
> >
> > I have no problem doing this with keys, but haven't the slightest idea
> > how to do it with values.  Yes, I have looked at the perl faq, but
> > that was no help.
> >
> > Any help appreciated...
> > thanks!
>
> --
>    ****************************************
>    *    Tony Labbiento                    *
>    *    Infinity Online, Inc.             *
>    ****************************************



--
   ****************************************
   *    Tony Labbiento                    *
   *    Infinity Online, Inc.             *
   ****************************************




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

Date: 08 Aug 1998 22:21:03 -0500
From: "Jim Woodgate" <jdw@dev.tivoli.com>
Subject: Re: sorting hash by values
Message-Id: <ob4svmhmcg.fsf@alder.dev.tivoli.com>


jjones@nospam.elementdesign.com (j) writes:
> Yes, I have looked at the perl faq, but
> that was no help.

weird, I did a grep "sort by val" and found a hit right away.

Your answer is in both perlfunc and perlfaq4

(Here's the answer from perlfunc)
"              To sort an array by value, you'll need to use a
               sort() function.  Here's a descending numeric sort
               of a hash by its values:

                   foreach $key (sort { $hash{$b} <=> $hash{$a} } keys %hash) {
                       printf "%4d %s\n", $hash{$key}, $key;
                   }
"

-- 
Jim Woodgate 
Tivoli Systems
E-Mail: jdw@dev.tivoli.com


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

Date: 9 Aug 1998 00:40:03 GMT
From: mnc@diana.law.yale.edu (Miguel Cruz)
Subject: Re: Underwood Typewriter and the backslash
Message-Id: <6qir53$di$1@news.ycc.yale.edu>

Jeffrey Drumm <drummj@mail.mmc.org> wrote:
>No such special support has yet been added. The current workaround:
>
>1. Eject your source code from the editor by repeated use of the
>   dedicated carriage-return tool
>
>2. With the file visible and facing you, rotate it 180 degrees along the
>   vertical axis (the code should now be facing away from you)
>
>3. Now rotate the file 90 degrees clockwise
>
>4. Maintaining this orientation, Roll the file into the editor
>
>5. Position the section of code requiring the backslash under the cursor
>
>6. Enter a forward slash character

I attempted this on my Underwood and to my dismay, yet another forward slash
appeared. I called the company but was never able to get through to tech
support. Around my office we've just started using the following process:

1. Eject source code.

2. Locate one unit of PapeRAID (tm) brand Carbon Paper.

3. Place carbon unit behind source code, with carbon facing unformatted
surface of code unit.

4. Insert source code in the same orientation and position as it was in
prior to step 1.

5. Position cursor over where backslash is desired.

6. Hold small piece of /tmp storage (scratch paper) between source code and
striking key point of intact.

7. Enter one forward slash (/) character. It will be stored in /tmp and
mirrored by the carbon unit's RAID function.

8. Re-eject source code.

9. Adjust orientation of source file so that it is facing away from you and
rotated 180 degrees about in axis intersecting its plane.

10. Re-attach carbon unit as in step 3, this time with carbon facing
pre-formatted surface of code file.

11. Insert source code into editor. 

12. Use visual search function to locate the single backslash character.

13. In overtype mode, enter a forward slash in the exact same position.

14. Eject source unit, remove and discard carbon, replace source unit in
original orientation, continue with valuable work.

Does anyone know of a macro utility for the Underwood that would save me
from doing all these steps each time? Preferably something electrical. I
would be interested in exploring PunchCard (tm) technology if it is
appropriate to this process.

miguel


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

Date: Sun, 09 Aug 1998 15:44:05 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: Underwood Typewriter and the backslash
Message-Id: <35cec35f.701427990@news.mmc.org>

On 9 Aug 1998 00:40:03 GMT, mnc@diana.law.yale.edu (Miguel Cruz) wrote:

(snip)

JD> 3. Now rotate the file 90 degrees clockwise

(snip)

JD> 6. Enter a forward slash character

MC> I attempted this on my Underwood and to my dismay, yet another forward
MC> slash appeared. I called the company but was never able to get through
MC> to tech support. Around my office we've just started using the
MC> following process:

(snip)

I verified these instructions on my own Underwood, and found that if you
rotate the source code a full 180 degrees clockwise rather than the 90
specified, the behavior you reported surfaces.

It is, therefore, *extremely* important to follow these instructions to the
letter.

And for those of you who were dismayed to find that Perl would not compile
on the Underwood Portable (as reported on the front page of TPJ), I am
happy to report that it just isn't so. Perl compiles cleanly with the
completely undocmented upchuck (Underwood Portable C Hacking Und
Compilation Kit). A little tweaking of config.sh is all that is required.

Unfortunately, on that platform, 99.9% of Perl's operators and functions
have been implemented as no-ops. Even so, with Perl's amazing versatility
and expressiveness, it is still quite possible to build a full-featured
client-server DBMS in 4 lines of code. The development of same is left as
an exercise for the reader. ;-)

Now that success has been achieved with Perl on the Underwood, expect to
see hint files appear for *many* other platforms. Upcoming ports will
include the Mattel Close 'n' Play and Speak 'n' Spell environments, The
1956 Sunbeam two-slice Toaster, the WeedEater Model XT 20T String Trimmer,
and the 1879 Horstchen Player Piano[1].

And Microsoft says "Windows Everywhere" . . .

[1] All right, I made up the last one.

-- 
                           Jeffrey R. Drumm, Systems Integration Specialist
                                  Maine Medical Center Information Services
                                     420 Cumberland Ave, Portland, ME 04101
                                                        drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented." -me


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

Date: 9 Aug 1998 13:07:09 GMT
From: "K. Posern" <posern@informatik.uni-marburg.de>
Subject: Win32 - win95: dir *.log with no files of this type in the current directory
Message-Id: <35CD9EDD.8EA5D8CC@informatik.uni-marburg.de>

Hi.
I've got a problem with the following little program xxx.pl:
    #! /usr/bin/perl -w

    qx{dir *.log};
If I start it (with perl xxx.pl) it says:
  File not found.  (or in german "Datei nicht gefunden.")
And I am sure he starts perl and runs the program! - But it shouldn't
make any output ?!

Who could help me?!

Knuth.



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

Date: Sun, 09 Aug 1998 11:37:14 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Win95 Server and Perl CGI Scripts
Message-Id: <35cd6dca.524144494f47414741@radiogaga.harz.de>

[ posted and mailed ]

DMOtto2 (dmotto2@aol.com) wrote:
[...]
: Type in anything and click on search and you should get this error:
:         500 Server Error

:         The server encountered an internal error or misconfiguration and was
:         unable to complete your request.

:         Message: CGI output from C:/WebSite/perl/search.pl contained no blank
:            line separating header and data
[...]
: I am just a beginner with Perl, so try and keep it simple.

1. Open a DOS box. Type

    C:\> perl -c yourscript

  Read error messages and act upon them.
  Repeat until the compiler tells you "syntax OK".

2. Insert a line

    use CGI::Carp qw(fatalsToBrowser);

  near the top of your script (this assumes you have installed the libwww
  module -- else get it at CPAN [1] and install it).

  Call the script via the browser. Read error messages and act upon them.

Hope it helps,
  Martin

[1] http://www.perl.com/CPAN/authors/id/GAAS/libwww-perl-#.#.tar.gz
    (where #.# = version number)
--
                          | Martin Vorlaender | VMS & WNT programmer
 OpenVMS: Where do you    | work: mv@pdv-systeme.de
 want to BE today?        |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 3400
**************************************

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