[10883] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4484 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 23 03:07:16 1998

Date: Wed, 23 Dec 98 00:00:42 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 23 Dec 1998     Volume: 8 Number: 4484

Today's topics:
    Re: Another replacement question: <groans@mailexcite.com>
        Cannot build: egcs _fails_ on 5.005_02 & NT4 <mds-resource@mediaone.net>
    Re: CGIwrap error What's up? (Ronald J Kimball)
    Re: CHMOD a file before writing to it.. (Randal L. Schwartz)
        Help!! SIGNAL doesn't work on UserAgent (Ted Huang)
    Re: Help!! SIGNAL doesn't work on UserAgent (Andrew Allen)
    Re: Installing Perl on Windows 95 or Windows 98 <ajonsson@csi.com>
        jpl info mehta@mama.indstate.edu
    Re: numbers in base 36 (Abigail)
    Re: One Level, Two Level, Blue Level, Purple Level (Ronald J Kimball)
    Re: Perl 5.005_002 and berkeley db problems (Fluffy)
    Re: please help with if statement syntax medi@cybershell.com
    Re: posting form data to 2 scripts at once <off-duty@entheosengineering.com>
    Re: replacement question <groans@mailexcite.com>
    Re: Retrospective on comp.lang.perl.moderated? (Ronald J Kimball)
    Re: Reversed hash is truncated (Ronald J Kimball)
    Re: Running Perl for Win32 -- Beginner Question <ajonsson@csi.com>
        What to do next? <bellears@deakin.edu.au>
    Re: what's wrong with this bit of code? :) <off-duty@entheosengineering.com>
    Re: what's wrong with this bit of code? :) (Martien Verbruggen)
    Re: what's wrong with this bit of code? :) (brian d foy)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 23 Dec 1998 00:31:09 -0800
From: me <groans@mailexcite.com>
To: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Another replacement question:
Message-Id: <3680AA4D.A11D9B1@mailexcite.com>

Hi!
Thank you for the response.

Eric Bohlman wrote:

> me <groans@mailexcite.com> wrote:
> : Lets also say I want to add a "/" to the end of the string so it looks
> : like this:
>
> : <FORM name=mfrm method=GET
> : action="http://mammoth.psnw.com:5364/http://www.altavista.com/cgi-bin/query/">
>
> : Note that there are several other tags like this one on the page that do
> : not end with a trailing "/" so matching exact text is impossible.  How
> : do I tell Perl to look for the end of a URL (not the end of the line)
> : and add a "/"?
>
> Perl doesn't have any concept of a URL, so you'll need to use some code
> that does.  I'd suggest using the HTML::Parser module to split your HTML
> up into its logical structures, such as attributes (which is where you're
> going to find URLs) and making the substitutions on them.  It's possible
> that HTML::Filter, which is a subclass of HTML::Parser, will be easier to
> use; check its docs.

Hmmm . . . SOmeone else gave me the same advice for a slightly related question . .
 .

>
> Do *not* try to parse HTML yourself using regular expressions unless
> you're only parsing HTML that you wrote yourself; most such "solutions"
> fail on non-obvious-but-legal constructs that are often seen in HTML from
> the Outside World.

Yeah, this has been a problem.  I have already done it though.  I can reverse it,
but I have already set it up to parse, but it is not as effective as it can be . . .
I will take a look at the html parse module tonight and see what I can do with it.
I have a book on coding with perl modules, specifically with the one you refer to,
but for some reason I have never been able to sucessfully get them (the modules) to
work . . .

Thanks again,
~Prime



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

Date: Tue, 22 Dec 1998 23:36:08 -0600
From: "Michael D. Schleif" <mds-resource@mediaone.net>
Subject: Cannot build: egcs _fails_ on 5.005_02 & NT4
Message-Id: <36808148.E12496FE@mediaone.net>

OK, what am I doing wrong?

msNT4, sp4, perl5.005_02, stable.zip

gcc 2.8.1 => builds, tests and functions: OK

egcs 1.1 => will _not_ completely build (see below)

NOTE: I have tried the following patch _without_ difference in my
results.

--- win32.h.~1 Wed Sep 09 10:22:48 1998
+++ win32.h    Wed Sep 09 12:53:14 1998
@@ -27,6 +27,7 @@ typedef long long __int64;
 /* GCC does not do __declspec() - render it a nop
  * and turn on options to avoid importing data
  */
+#  undef __declspec
 #  define __declspec(x)
 #  ifndef PERL_OBJECT
 #    define PERL_GLOBAL_STRUCT
@@ -213,7 +214,6 @@ struct mgvtbl {
                       \

 typedef long          uid_t;
 typedef long          gid_t;
-#define _environ      environ

##########

D:\p500502\win32>dmake
del /f config.h
Could Not Find D:\p500502\win32\config.h
copy config_H.gc config.h
        1 file(s) copied.
gcc -c  -I..\lib\CORE -I.\include -I. -I.. -DWIN32   -DPERLDLL
-DPERL_CORE -g -O2   -operlglob.o perlglob.c
gcc  -Ld:\egcs-1.1\lib  -o ..\perlglob.exe perlglob.o  -ladvapi32
-luser32 -lnetapi32 -lwsock32                 -lmingw32 -lgcc -lmoldname
-lcrtdll -lkernel32
if not exist ".\mini" mkdir ".\mini"
gcc -c -I..\lib\CORE -I.\include -I. -I.. -DWIN32   -DPERLDLL
-DPERL_CORE -g -O2  -o.\mini\av.o ..\av.c
In file included from ..\lib\CORE\config.h:2100,
                 from ..\perl.h:137,
                 from ..\av.c:16:
 ..\lib\CORE\win32.h:30: warning: `__declspec' redefined
*Initialization*:1: warning: this is the location of the previous
definition
In file included from ..\lib\CORE\config.h:2100,
                 from ..\perl.h:137,
                 from ..\av.c:16:
 ..\lib\CORE\win32.h:216: warning: `_environ' redefined
d:\egcs-1.1\lib\gcc-lib\i386-mingw32\egcs-2.91.57\..\..\..\..\i386-mingw32\include\stdlib.h:87:
warning: this is the location of the previous definition
gcc -c -I..\lib\CORE -I.\include -I. -I.. -DWIN32   -DPERLDLL
-DPERL_CORE -g -O2  -o.\mini\byterun.o ..\byterun.c

##########
 ... much warnings ...
##########

gcc -c -I..\lib\CORE -I.\include -I. -I.. -DWIN32   -DPERLDLL
-DPERL_CORE -g -O2  -o.\mini\win32.o win32.c
In file included from ..\lib\CORE\config.h:2100,
                 from ..\lib\CORE\perl.h:137,
                 from win32.c:39:
 ..\lib\CORE\win32.h:30: warning: `__declspec' redefined
*Initialization*:1: warning: this is the location of the previous
definition
In file included from ..\lib\CORE\config.h:2100,
                 from ..\lib\CORE\perl.h:137,
                 from win32.c:39:
 ..\lib\CORE\win32.h:216: warning: `_environ' redefined
d:\egcs-1.1\lib\gcc-lib\i386-mingw32\egcs-2.91.57\..\..\..\..\i386-mingw32\include\stdlib.h:87:
warning: this is the location of the previous definition
In file included from
d:\egcs-1.1\lib\gcc-lib\i386-mingw32\egcs-2.91.57\..\..\..\..\i386-mingw32\include\windows.h:39,
                 from win32.c:17:
d:\egcs-1.1\lib\gcc-lib\i386-mingw32\egcs-2.91.57\..\..\..\..\i386-mingw32\include\Windows32/Base.h:268:
warning: redefinition of `TCHAR'
d:\egcs-1.1\lib\gcc-lib\i386-mingw32\egcs-2.91.57\..\..\..\..\i386-mingw32\include\tchar.h:143:
warning: `TCHAR' previously declared here
win32.c: In function `win32_environ':
win32.c:1345: `_environ' undeclared (first use in this function)
win32.c:1345: (Each undeclared identifier is reported only once
win32.c:1345: for each function it appears in.)
win32.c: In function `win32_fsetpos':
win32.c:1574: warning: passing arg 2 of `fsetpos' discards `const' from
pointer
target type
dmake.exe:  Error code 1, while making '.\mini\win32.o'

##########

##########
Success with gcc
##########

D:\p500502\win32>\perl5\5.00502\bin\mswin32-x86\perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 02) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86
    uname=''
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-g -O2 ', gccversion=
    cppflags='-DWIN32'
    ccflags ='-g -O2  -DWIN32   '
    stdchar='char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -Ld:\mingW32\lib '
    libpth=d:\mingW32\lib
    libs= -ladvapi32 -luser32 -lnetapi32 -lwsock32 -lmingw32 -lgcc
-lmoldname -l
crtdll -lkernel32
    libc=-lcrtdll, so=dll, useshrplib=yes, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-mdll  -Ld:\mingW32\lib '


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY
  Built under MSWin32
  Compiled at Dec 22 1998 23:14:39
  @INC:
    D:\perl5\5.00502\lib/MSWin32-x86
    D:\perl5\5.00502\lib
    D:\perl5\site\5.00502\lib
    D:\perl5\site\lib
    .

-- 

Best Regards,

mds
mds resource
888.250.3987

"Dare to fix things before they break . . . "

"Our capacity for understanding is inversely proportional to how much we
think we know.  The more I know, the more I know I don't know . . . "


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

Date: Tue, 22 Dec 1998 23:30:56 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: CGIwrap error What's up?
Message-Id: <1dkgmo8.19mbcju1rg27b4N@bay1-8.quincy.ziplink.net>

Cody <chidr@ix.netcom.com> wrote:

> Learning perl/cgi from a teach yourself book and am having
> problems running my first script.  I followed all the
> directions in the book and have ftp'd the file correctly to
> my cgi-bin.  The darn thing won't run from a browser
> though.  I keep getting this error.

Which error???


Without seeing the actual error message, I can only suggest checking the
following:

Did you test the script locally first to make sure it compiles
successfully?  Produces expected output?

Did you FTP the script in text mode?

Did you set the permissions to make it world readable and executable?

Did you follow your ISP's directions on using cgiwrap?

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Wed, 23 Dec 1998 04:17:07 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: CHMOD a file before writing to it..
Message-Id: <m1pv9bwkwa.fsf@halfdome.holdit.com>

>>>>> "Tony" == Tony  <tspencer@exconet.co.uk> writes:

Tony> Anyone know how I can CHMOD a file 666 before writting  to it and then CHMOD
Tony> it 644 after it has been written to using Perl.
Tony> The code I use to write to the file is...

Tony> sub log {

There's a built-in function named log().  I hope you use &log all the time. :)

Tony> open(wordfile,">>/home/public_html/cgi-bin/dict1/$in{'file'}");

What if $in{file} is "../../../../../etc/passwd"?

baaaaaad news.

And filehandles are generally uppercase.

Tony> { 
Tony> print wordfile "$in{'word'}\n";
Tony> close (wordfile);
Tony> }


Tony> This works fine if I manually set the file permissions to 666,
Tony> but would like to keep it at 644 under normal curcumstances.  I
Tony> need to know where to add the code to CHMOD the file before
Tony> writing and then CHMOD again after writing to it.

You can't chmod it if you don't own it.  And if you own it, there's
not a heckuva lot of difference between 0644 and 0666 for modes.

Tony>   I thought
Tony> perhaps include it in the sub log before opening the file, but
Tony> no matter what I try it does not work.  Thanks Tony

Do you own the file?  What does $! say after a failure?

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Wed, 23 Dec 1998 12:30:31 +0800
From: ted@mail.sinanet.com (Ted Huang)
Subject: Help!! SIGNAL doesn't work on UserAgent
Message-Id: <ted-ya023480002312981230310001@news.seed.net.tw>
Keywords: timeout signal alarm perl useragent request


Hi!

I am writing a PERL script to check if a URL is active. I use Signal to
timeout the URL request. However, Signal seems not work on UserAgent. The
following is my scirpt.

<pre>

#!/usr/bin/perl

use LWP::UserAgent;

$SIG{ALRM} = sub { die "timeout" };

my $ua = new LWP::UserAgent;
my $req, $res;

$url = 'http://msdn.aide.gov.tw/84/84main.htm';
for($i = 0; $i < 5; $i++) {
        eval {
               #set timeout to 3 seconds
                alarm(3);
                print("Try $i...\n");

               #Create a request
                $req = new HTTP::Request 'GET' => $url;

               # request the URL
                $res = $ua->request($req);

                alarm(0);
                print("-- $i --\n");
        };
        chomp($@);
        print("$@ - $i done\n");

        if($res->is_success) {
                print("access sucess..\n");
        } else {
                print("access fail\n");
        }
}

</pre>

When the script go to 

$res = $ua->request($req);

Signal will not be sent and the statement still waiting and doesn't
timeout. However, if I add

sleep(10);

before

$res = $ua->request($req);

The Signal works fine. So, I guess I must miss something to handle the
Signal. Anybody can help? Thank you very much.

--Ted


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

Date: 23 Dec 1998 06:10:18 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Help!! SIGNAL doesn't work on UserAgent
Message-Id: <75q1ga$o5v$1@fcnews.fc.hp.com>

Ted Huang (ted@mail.sinanet.com) wrote:

: Hi!

: I am writing a PERL script to check if a URL is active. I use Signal to
: timeout the URL request. However, Signal seems not work on UserAgent. The
: following is my scirpt.

<snipped a bunch of complicated alarm stuff while fetching a web page>

Is this what you want to do?

  $ua=new LWP::UserAgent;
  $ua->timeout(3);
  ...proceed on as usual...

Andrew


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

Date: Wed, 23 Dec 1998 00:02:19 -0600
From: "AJ" <ajonsson@csi.com>
Subject: Re: Installing Perl on Windows 95 or Windows 98
Message-Id: <egYuMnjL#GA.189@nih2naab.prod2.compuserve.com>

Perl actually works okay on Win95.  You can just get the Win32 port
off of www.perl.com or cpan and just follow the included instructions.
Also, there is the wonderful "LEARNING PERL ON WIN32 SYSTEMS" from O'reilly,
and there are some hints on how to set things up.  I had pretty good luck,
even programmed some scripts on
Win95, and then transfered the code to  HP-UX (Hewlitt-Packard Unix).
 It makes Wintel box pretty powerful.

AJ


fguarner wrote in message <75n7s6$p8@sjx-ixn10.ix.netcom.com>...
>I am fascinated with learning perl, but I don't have a clue how get an
>compatible version. I've read some discouraging stuff about installing perl
>on Windows 95. Is there a version out there somewhere thats semi easy to
>install and works.
>
>Please email me at fguarner@ix.netcom.com
>
>
>
>
>




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

Date: Wed, 23 Dec 1998 04:02:03 GMT
From: mehta@mama.indstate.edu
Subject: jpl info
Message-Id: <75ppvr$jbb$1@nnrp1.dejanews.com>

12/22/98

any binary for winnt with jpl available? any tutorials?

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


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

Date: 23 Dec 1998 05:01:26 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: numbers in base 36
Message-Id: <75ptf6$cro$1@client3.news.psi.net>

Jarkko Hietaniemi (jhi@alpha.hut.fi) wrote on MCMXXXIX September MCMXCIII
in <URL:news:oeen24fhqkw.fsf@alpha.hut.fi>:
++ 
++ abigail@fnx.com (Abigail) writes:
++ 
++ > droby@copyright.com (droby@copyright.com) wrote on MCMXXXIX September
++ > MCMXCIII in <URL:news:75od2e$d29$1@nnrp1.dejanews.com>:
++ > ++ In article <75luud$ces$1@nnrp1.dejanews.com>,
++ > ++   ptimmins@netserv.unmc.edu wrote:
++ > ++ >
++ > ++ > I can't get past 60*789**105 on any of the systems I have access to,
++ > ++ > let alone 569*789**328, so I'll ignore that dig :) ... or is there some
++ > ++ > way to derive it, rather than actual numerical computation?
++ > ++ 
++ > ++ I suspect it requires actual numerical computation with BigInts.
++ > ++ 
++ > ++ Here's mine, and it works on a Pentium 166 running Linux 2.0.36.
++ > 
++ > [ 55 line solution deleted ]
++ > 
++ > Here's a one liner, with no need for Perl:
++ > 
++ > $ echo "obase = 789; 123 ^ 456" | bc
++ 
++ Cheating!  My original question wanted the answer in Java.  Somebody
++ said "Java" and "in any base"...


I guess you can use some kind of pipe object in Java and communicate
with bc.

But that wouldn't be a one liner any more. And I love one liners.


Abigail


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

Date: Tue, 22 Dec 1998 23:30:58 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: One Level, Two Level, Blue Level, Purple Level
Message-Id: <1dkgna0.11ubg13rk7doN@bay1-8.quincy.ziplink.net>

Bart Lateur <bart.lateur@skynet.be> wrote:

> beable@my-dejanews.com wrote:
> 
> > I went to www.perl.com and it said to look
> >on CSPAN. SO I WATCHED CSPAN FOR TWELVE STRAIGHT HOURS
> >AND ALL IT HAD WAS ....
> 
> You're sure it's not CPAN (without the "S")? You can simply get there
> through www.perl.com .

Wait...  It's not PECAN?  You mean that I drove all the way to the
grocery store, spent 20 minutes looking for pecans, finally left with a
can of mixed nuts, and spent 2 hours picking out all the pecans...
 ...FOR NOTHING??  *&^%$#@!

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 23 Dec 1998 06:10:34 GMT
From: meowing@banet.net (Fluffy)
Subject: Re: Perl 5.005_002 and berkeley db problems
Message-Id: <slrn7812ai.to0.meowing@meowhost.meow.invalid>

bostic@bostic.com <bostic@bostic.com> wrote:
> I've now exchanged email with Colin.  I believe that the version
> of Berkeley DB in which he found problems was 1.85.  Version 1.85
> was academic software released around 1992, was never supported,
> and is widely known to have problems.  (See
>         http://www.sleepycat.com/Berkeley DB.185.html
> for further information.)

Looks like Deja News ate your URL or something.  In real life, people
can try: <URL:http://www.sleepycat.com/db.185.html>

> The current, 2.X versions of Berkeley DB have none of these problems,
> whether used with Perl or not, and whether used with the DB_File or
> BerkeleyDB Perl modules.

Thanks for putting up that information.  The "db is b0rken" meme Just
Won't Die, and that page looks like just what's needed to calm the
squeamish.
-- 
"FEAST!"
      --Alice


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

Date: Wed, 23 Dec 1998 04:21:42 GMT
From: medi@cybershell.com
Subject: Re: please help with if statement syntax
Message-Id: <75pr4l$k8m$1@nnrp1.dejanews.com>

In article <75nn57$prl$1@news.us.world.net>,
  "amy" <asibal@paclink.com> wrote:
> I'm trying to process some html form data.  I have a test of 9 questions
> (radio buttons) and each question has a rank of 1-5.  So my scores range
> from 9-45.  I am having trouble with the conditional statement.  I have five
> possible answers. I would like my statement to read
>                             if ($sum_of_test_score = 1 or 2 or 3 or 4
> ....9){
>                                         conditon #1
>                                 } elsif ($sum_of_test_score = 10 or 11 or
> 12...){
>                                         conditon #2
>                                  }
> and so on and so on until my five different outcomes were accounted for in
> the if statement.
> I have not been able to determine what the proper syntax would be.  I have
> tried almost everything I could think of.  Please help?
> Markus
> asibal@paclink.com
>
>
Well...disregarding the problem doamin, the syntax of such an if would be

if ( $Sum <= 9 )
{
   Statement_1;
}
elsif ( $Sum > 9 && $sum <= 20 )
{
   Statement_2;
}
and so forth...which is of course assuming order in the possible outcomes.
Else you'd have to create an enumarated list and test.

But it looks to me like you'll have more than 5 possible outcomes.
Basically you have the following matrix

Q  1 2 3 4 5
1  x x x x x
2  x x x x x
 ...
9  x x x x x

Case-1, where all nine questions are 1, hence sum = 9
Case-2, where all nine questions are 2, hence sum = 18
Case-3, where all nine questions are 3, hence sum = 27
 ...
Case-5, where all nine questions are 5, hence sum = 45
And so forth...I forgot my combintorial math, but you
are looking at a combination where order does not matter.
Look up the equation...it is some ratio of some factorial
something...but it is more than 5 cases.

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


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

Date: Tue, 22 Dec 1998 19:32:07 +0000
From: Rich Grise <off-duty@entheosengineering.com>
Subject: Re: posting form data to 2 scripts at once
Message-Id: <367FF3B7.5861EF15@entheosengineering.com>

Harvey Brodzki wrote:
> 
> Is there a way to write a little script that can post form data
> to 2 different scripts on different servers?
[...]
> All help is appreciated.
> Harvey

Yeah. Submit it to an intermediate script that then sends it
to formmail.pl and to the other script.
-- 
Rich Grise
off-duty@entheosengineering.com
(No need to futz with my e-mail: I have a "delete" button!)


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

Date: Wed, 23 Dec 1998 00:27:09 -0800
From: me <groans@mailexcite.com>
Subject: Re: replacement question
Message-Id: <3680A95D.4F193EED@mailexcite.com>

Hola,

Clay Irving wrote:

> In <367D45F0.525068B7@mailexcite.com> me <groans@mailexcite.com> writes:
>
> >Thanks for responding.  I have not had too much success with LWP and the
> >modules(each time my script references one, it says that the module needs
> >other modules.  When I put them where they are supposed to be, it tells
> >me I need even more.  SOme I have not been able to find, so I just gave up).
> >Perhaps I will take this time to revisit them . . . Thanks again!
>
> Next time you revisit them, use the CPAN module (included in the Perl
> distribution) to install other modules -- You'll be happier for it. :)

What makes it better?  I should know this but I don't because I have had bad
experiences with modules and have not used them . . .
~Prime





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

Date: Tue, 22 Dec 1998 23:30:59 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <1dkgo12.7jxyt1jpaj7vN@bay1-8.quincy.ziplink.net>

Excession <daccles@bad.spam.no.spam.pcug.org.au> wrote:

> When the EFNET #perl channel denizens were confronted (on a few occasions)
> with the 'hmm, well why didn't the .misc newsgroup die as expected', their
> response was remarkable silence.

Maybe you expected .misc to die, but no one else did.  Given that your
question contained an incorrect assumption (a la "Have you stopped
beating your wife?") how did you expect people to answer it?

Actually, maybe your question was met with silence because people were
ignoring you.  Not surprising, if your behavior on #perl is anything
like your behavior in that post.  ;-)

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Tue, 22 Dec 1998 23:31:00 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Reversed hash is truncated
Message-Id: <1dkgobc.9cn3zn12v9mroN@bay1-8.quincy.ziplink.net>

Robert Gwynne <nospam_gwynne@utkux.utk.edu> wrote:

> I'm trying to modify the code for processing everyword in a file found on
> page 280 of the Perl Cookbook so that it prints out a sorted list of values
> by keys instead of keys by values. If I reverse the hash, the resulting hash
> ends up being truncated. Consequently, I don't get a list of all of the
> key/value pairs that SHOULD be in the list.

You may need to read up on hashes in Perl's documentation or the Camel
book.

Hashes are data structures where each unique key maps to a specific
value.  You cannot have a hash with two occurences of the same key.  If
you add to a hash a new key and value, and that key was already present
in the hash, the previous value will be replaced with the new value.

Thus:

%hashA = (a=>1, b=>2, c=>1);  # good - 3 unique keys
%hashB = reverse %hashA;      # not good - 1 appears twice as a key

%hashB will either be (1=>a, 2=>b) or (1=>c, 2=>b), depending on the
'order' of the keys in %hashA.


I see that a solution to your problem that avoids this issue has already
been posted.  I hope this information will be useful to you in the
future!

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Wed, 23 Dec 1998 00:22:13 -0600
From: "AJ" <ajonsson@csi.com>
Subject: Re: Running Perl for Win32 -- Beginner Question
Message-Id: <e5kGVyjL#GA.84@nih2naab.prod2.compuserve.com>

It sounds like you're running in DOS mode when trying to execute Perl.  Are
you restarting in DOS mode first?  If you start just a command prompt that
does not emulate DOS mode, you should be able to run Win32 Perl.  I usually
use the DOS window from MSoffice and I can run Perl fine.  You basically
need a DOS shell created from \windows\command\command.com while in windows.

Stephen C. Smith wrote in message <367d6ca4.3683721@news>...
> I bought a few books yesterday on Perl so I could learn this
>language.  One of them was "Perl for Dummies" (yes, I got the O'Reilly
>books too, so don't give me that look).  In the "Dummies" book was the
>ActivePerl version 5 from ActiveState.  I've gone to AS's Web site and
>updated to the current version for Win32.  (I'm running on Win 95 and
>I've installed DCOM from the Microsoft Web site.)
> When I try to run anything, even just a one-line "print"
>statement, the results appear on screen and then the DOS window
>disappears.  I gather that I have to run Perl in a DOS window; but
>when I try to execute Perl from a prompt in a DOS window I get the
>message "Cannot run in MS-DOS mode."  So I run Perl from the Win 85
>explorer, which opens us a DOS window.  But any lines of code I
>execute with Ctrl-Z, the results just flash on the screen and the DOS
>window closes, so I don't really see the results.
> How do I get the results to stay on the screen, i.e. the DOS
>window doesn't close?  I've tried all sorts of way to tell Win 95 not
>to close the window on exit, but so far none have worked.
> Thanks in advance,
> Stephen
>
>
>Visit the "Anaheim Angels and Lake Elsinore Storm" Web Site
>http://www.halostorm.com




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

Date: Wed, 23 Dec 1998 13:49:07 +1100
From: Mick <bellears@deakin.edu.au>
Subject: What to do next?
Message-Id: <36805A23.41F61EBB@deakin.edu.au>

Hi,
I have the following code segment from my file-upload page.
I have it checking to see if the file to be uploaded already exists,
which it does
fine, my problem is I'm not sure how to do the next part (Display a
screen to the
user asking them if they want to overwrite the file, or cancel the
upload!)
It's in Perl, so sorry for any cross postings :)
But it is a HTML question. - Sorry for the length too :)

if (length($thefilename)){
 my $path = "$dname/$thefilename";
 print STDERR "path is $path\n";

 if ( opendir ( DIRP , $dname ) )
        {
        my @files = grep !/^\./, readdir DIRP;
        closedir DIRP;

        my $f;
        my @remaining_files;

        if ( @files )
                {
                foreach $f ( @files )
                        {
                                unshift @remaining_files, $f;
                        }
                }

        if ( @remaining_files )
                {
                foreach $f ( sort @remaining_files )
                        {
                        my @result = stat "$dname/$f";
                        my $size = @result[7];
                        my $date = scalar localtime @result[9];
                        print "<TR>";

                        my $f_meta = $f;
                        $f_meta =~ s/ /%20/g;
    if ($f_meta eq $thefilename){
     print STDERR "File $f_meta eqs $thefilename\n";
     print "<h2>I have found that you have already uploaded the file
$f_meta</h2>";
     exit(1);
    }else{
     print STDERR "OK no match!\n";
    }
                        }
                }
        else
                {
                print STDERR "##############No Files1\n";
                }
        }
else
        {
        print STDERR "#######################No Files2\n";
        }

}

Thanks for any replies,

Mick



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

Date: Tue, 22 Dec 1998 19:36:41 +0000
From: Rich Grise <off-duty@entheosengineering.com>
Subject: Re: what's wrong with this bit of code? :)
Message-Id: <367FF4C9.22A2898D@entheosengineering.com>

Gavin Cato wrote:
> 
> This don't work! It compiles ok in perl but doesnt send a message, I can't
> see anything in the log by sendmail sayinf it has sent it / tried to. In
> short it's a mystery.
> 
> Any ideas guru's? :)
> 
> sub mailatt {
> 
> open MAIL, "|$sendmail -t -i";

Don't you have to tell sendmail where to send the mail to?

like, open MAIL, "|$sendmail -t -i $destination";

?????
-- 
Rich Grise
off-duty@entheosengineering.com
(No need to futz with my e-mail: I have a "delete" button!)


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

Date: Wed, 23 Dec 1998 05:40:47 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: what's wrong with this bit of code? :)
Message-Id: <zn%f2.118$jf.3403@nsw.nnrp.telstra.net>

In article <367FF4C9.22A2898D@entheosengineering.com>,
	Rich Grise <off-duty@entheosengineering.com> writes:

>> open MAIL, "|$sendmail -t -i";
> 
> Don't you have to tell sendmail where to send the mail to?
> 
> like, open MAIL, "|$sendmail -t -i $destination";

See another post of mine in response to one of yours about this exact
subject :)

the -t flag tells sendmail to parse the message for To:, Cc: and Bcc:
fields, and makes it ignore any addresses that were passed in as
arguments.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd.       | password?
NSW, Australia                      | 


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

Date: Wed, 23 Dec 1998 00:58:32 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: what's wrong with this bit of code? :)
Message-Id: <comdog-ya02408000R2312980058320001@news.panix.com>

In article <367FF4C9.22A2898D@entheosengineering.com>, Rich Grise <off-duty@entheosengineering.com> posted:

> Gavin Cato wrote:

> > open MAIL, "|$sendmail -t -i";
> 
> Don't you have to tell sendmail where to send the mail to?
> 
> like, open MAIL, "|$sendmail -t -i $destination";

notice the -t flag.

-- 
brian d foy                     <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't.  it doesn't matter either way.


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

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

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