[7163] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 788 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 28 20:05:21 1997

Date: Mon, 28 Jul 97 17: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           Mon, 28 Jul 1997     Volume: 8 Number: 788

Today's topics:
     Re: bincancel:6 large binaries:AR1261:@@NCM (Richard E. Depew)
     Can filehandles be stored in a hash? (Michael Borowiec)
     Re: Can't turn off -w in script (Jeff Stampes)
     cgi bbs or guestbook <c641421@showme.missouri.edu>
     CGI server internal error <PAUL_YAN@non-hp-paloalto-om15.om.hp.com>
     Re: different server cgi (Tad McClellan)
     Re: everything I've read on PERL and NT makes sense, bu nasser@internetaddress.com
     Re: Executing Shell commands in Perl <burleigh@hackberry.chem.niu.edu>
     export variables <srani@uu.net>
     Re: Extremely peculiar behavior in a loop in a subrouti <clark@s3i.com>
     Re: Extremely peculiar behavior in a loop in a subrouti <merlyn@stonehenge.com>
     Re: function pointer dereferencing <merlyn@stonehenge.com>
     Re: I still can't install perl5 <rra@stanford.edu>
     Parsing line by line <shahjn@cig.mot.com>
     perl on Win32 - fork() (Andrew Cheyne)
     Perl Script with Netscape 4.01 <cyberkid@tamos.gmu.edu>
     Perl5.004 installation problems on AIX 4.1 Thomas_Santamaria@ushc.com
     Re: Question: How to execute a program and read results <rmangi@tgix.com>
     Sorting IP's (Dennis Mercer)
     Statements executed out of order? <deforres@acs.ucalgary.ca>
     Re: tied hashes (Charles DeRykus)
     Re: Unix time, local time, year 2000 question. <sibsib@hotmail.com>
     Re: Unix time, local time, year 2000 question. <merlyn@stonehenge.com>
     using substr inside regexp for substitutions (Larry Riddle)
     Re: What is involved with lib-www???? (Mark A. Lehmann)
     win32 $? or GetExitCode does not work? <brian_zhouNOSPAM@sid.hp.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 28 Jul 97 19:11:14 GMT
From: red@redpoll.mrfs.oh.us (Richard E. Depew)
Subject: Re: bincancel:6 large binaries:AR1261:@@NCM
Message-Id: <ARMM-Report-1261.a@redpoll.mrfs.oh.us>
Keywords: ARMM - Automated Retroactive Minimal Moderation

Large binary posts do not belong in unmoderated discussion groups.

Please read this entire message, the Bincancel FAQ, and the complete
report (see below) before following up to or responding to this article.

As a service to, and with the cooperation of, other news administrators,
I run a program that searches for, and issues advisory cancels for,
large binaries in the akr, biz, comp, humanities, misc, news, nz, rec,
sci, soc, and talk hierarchies.

I have issued 6 cancels for large binary files (average size 190,798
characters - total size 1,144,786 characters) posted to 7 different
unmoderated discussion groups in the comp and rec hierarchies (with
cross-posts into alt groups) as follows:
   1 rec.audio.marketplace
	alt.home-theater.marketplace
	rec.video.marketplace
   1 rec.arts.fine
   1 rec.antiques.marketplace
   1 comp.os.ms-windows.win95.setup
   1 comp.lang.perl.misc
   1 comp.lang.java.programmer

The unnumbered newsgroups in the list are not separate posts, but
are cross-postings of the articles represented by the preceeding
numbered items.  Cross-posting may lead to cancels in non-targeted
groups as a consequence of the way cross-posts work.  A cross-posted
article has only one Message-ID.  When it is canceled from one
group it is canceled from all groups.

This pointer is being posted to each affected group listed above.
Follow-ups are directed to news.admin.net-abuse.usenet.

If you want to see exactly which file was deleted from a particular
group, read the full report in news.admin.net-abuse.bulletins.  The
full report can also be found in news.lists.filters and alt.retromod.
Look for AR1261 in the subject, or, if your reader supports it,
use <URL:news:ARMM-Report-1261@redpoll.mrfs.oh.us>.

The criteria used to search for this batch of large binaries were:
   NEWSGROUPS: Unmoderated groups in the akr, biz, comp, humanities, 
               misc, news, rec, nz, sci, soc, and talk hierarchies
               (except for comp.binaries.apple2, comp.bugs.2bsd, and
               rec.games.bolo)
   BINARY: base64, binhex, uuencode, and xbtoa encoded files, etc.
   SIZE: > 100,000 characters [(size * (# of parts - .5)), if multi-part]

For more information about binary cancels, see the bincancel FAQ,
<URL:http://www.southcom.com.au/~geniac/binfaq.txt>. 

Please direct public feedback to news.admin.net-abuse.usenet and private
feedback to red@redpoll.mrfs.oh.us.  In the interests of preventing
cross-posted flame wars, please honor the followup-to header and do
*not* cross-post your reply to multiple groups.  Thank you for your
cooperation.

Best wishes,
Dick
-- 
Richard E. Depew, Munroe Falls, OH    red@redpoll.mrfs.oh.us (home)
It's over, and can't be helped, and that's one consolation, as they
  always say in Turkey, when they cut the wrong man's head off'' 
  -- Charles Dickens, _The Pickwick Papers_


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

Date: 28 Jul 1997 14:58:22 -0500
From: mikebo@MCS.COM (Michael Borowiec)
Subject: Can filehandles be stored in a hash?
Message-Id: <5ritku$nd5$1@Mars.mcs.net>

I have a script which will open many hundreds out output files.
I would like to be able to do an open, then store the filehandle
in a hash, indexed by a component of the filename, like so:

> unless (defined($openhash{$filename})) {
> 	open($handle, "> $dbdir/$filename") ||
> 		die("Cannot open $dbdir/$filename: $!");
> 	$openhash{$filename} = $handle;
> }

then later...

> print($openhash{$filename} "some stuff\n");

However, when I try to do this I get:
String found where operator expected at ./script line XXX,
    near "} "some stuff\n""
        (Missing operator before  "some stuff\n"?)
Signal SEGV: No such file or directory
Abort(coredump)

I tried using scalar() around the de-referenced filehandle, but I get
the same error. Suggestions?

> print(scalar($openhash{$filename}) "some stuff\n");
Argh!
- Mike


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

Date: 28 Jul 1997 19:14:41 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: Can't turn off -w in script
Message-Id: <5rir31$96l$1@neocad.com>

Brett Denner (Brett.W.Denner@lmtas.lmco.com) wrote:
: If I try to run the following line:

:     perl -w -e '1 if $a = 0'

: I get the following warning:

:     Found = in conditional, should be == at -e line 1.

: When I turn off a local copy of the -w flag as such:
:  
:     perl -w -e 'local ($^W) = 0; 1 if $a = 0;'

: I get the same warning.

: Doesn't setting a local copy of $^W to 0 turn off the -w flag for the
: current block? 

I would imagine that the warnings generated by -w are compile-time
warnings, and the behavior of setting $^W only controls run-time
warnings.

Someone correct me if I'm sadly mistaken.

Jeff

--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com


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

Date: Mon, 28 Jul 1997 13:53:32 -0500
From: Kevin Kozlen <c641421@showme.missouri.edu>
Subject: cgi bbs or guestbook
Message-Id: <33DCEAAC.DF0@showme.missouri.edu>

I am a student who has an account on an NT server. I am looking for a
bbs or guestbook script to use on my webpage. The only scripts that I
have been able to find scripts that only work on a Unix system. Please
help.


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

Date: Mon, 28 Jul 1997 15:50:50 -0700
From: PAUL YAN <PAUL_YAN@non-hp-paloalto-om15.om.hp.com>
Subject: CGI server internal error
Message-Id: <33DD224A.371C@non-hp-paloalto-om15.om.hp.com>

Hello, gurus:
	I just wanna write a script that print out the webpage but the server
always give the error like :
			
				Server Error

This server has encountered an internal error which prevents it from
fulfilling your request. The most likely cause is a misconfiguration.
Please ask the administrator to look for messages in the server's error
log. 

and errors log is :

[28/Jul/1997:09:46:32] failure: for host xxx.xxx.xxx.xxx trying to GET
/cgi-bin/showEvent.pl, cgi-parse-output reports: the CGI program
/opt/ns-http/docs/cgi-bin/showEvent.pl did not produce a valid header
(name without value: got line "<html>
")

myscript is :

#!/usr/local/bin/perl

$Version = "Demo alpha 1.0";

# if ($ENV{'QUERY_STRING'} =~ /Month=(\d+)\&Date=(\d+)\&Year=(\d+)/) {
#        &DisplayEvent($1, $2, $3);
# }

&DisplayEvent();

exit;
# End of Main
sub DisplayEvent {
        local($Month,$Date, $Year)=@_;
        $Month = $Month + 1;
        &printHTMLheader;

        open(FH, '/root/http/docs/test/event');
        while (<FH>) {
                chop;
                print '<P>'.$_.'<BR></P>';
                print "\n";
        }
        &printHTMLfooter;
}

sub printHTMLheader {
        print 'Content-type: text/html';
        print "\n";
        print '<HTML>';
        print "\n";
        print '<BODY BGCOLOR="#FFFFFF" text="#000000">';
        print "\n";
}

sub printHTMLfooter {
        print '</BODY>';
        print "\n";
        print '</HTML>';
        print "\n";
}


What is wrong with it ? I need a hand !


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

Date: Sun, 27 Jul 1997 20:59:47 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: different server cgi
Message-Id: <jeugr5.3q3.ln@localhost>

Jeremy Skarr (jskarr@netins.net) wrote:
: Is there a script that allows
: <!--#include virtual="http://. . . . " -->
: to work on another server?  I really needed one and couldn't figure out
: how to get one working.


Please post only Perl questions here.

This is the Perl newsgroup.

You may find someone who can help you in one of the newsgroups that
has some connection to WWW programming.


Maybe one of these:

comp.infosystems.www.advocacy
comp.infosystems.www.announce
comp.infosystems.www.authoring.cgi
comp.infosystems.www.authoring.html
comp.infosystems.www.authoring.images
comp.infosystems.www.authoring.misc
comp.infosystems.www.browsers.mac
comp.infosystems.www.browsers.misc
comp.infosystems.www.browsers.ms-windows
comp.infosystems.www.browsers.x
comp.infosystems.www.misc
comp.infosystems.www.servers.mac
comp.infosystems.www.servers.misc
comp.infosystems.www.servers.ms-windows
comp.infosystems.www.servers.unix
comp.infosystems.www.providers
comp.infosystems.www
comp.infosystems.www.users


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Mon, 28 Jul 1997 16:03:41 -0600
From: nasser@internetaddress.com
Subject: Re: everything I've read on PERL and NT makes sense, but...
Message-Id: <870095540.15156@dejanews.com>

In article <33DA15B9.DCC7003E@icstrategies.com>,
  Harry Schechter <harry@icstrategies.com> wrote:
>
> I am trying to run PERL scripts on an NT machine running NS Fasttrack.
> The perl scripts *seem* to be associated with PERL. That is, they run
> from the command line (if you include the extension: test.pl <enter>).
> However, when I try to call them from netscape on any machine, I get a
> not found error. This is also evident in the server eror logs with this
> message:
>

I am not a perl expert and am new at it too.  But I ran to the same
problem on NT as well and it took me a while to figure it out.	The
problem is that when your server tries to resolve the extension *.pl and
invoke perl.exe it does NOT look into your path.  So most probably when
you set your association in the file manager you typed "perl.exe" which
is fine if perl.exe is on the path when you run it from command line, but
the server cannot find it.  So what you should be doing is change the
association to include the absolute path to perl.exe.

I hope this helps.  It worked for me.

Cheers, .....Nasser

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Mon, 28 Jul 1997 17:26:00 -0500
From: Darin Burleigh <burleigh@hackberry.chem.niu.edu>
Subject: Re: Executing Shell commands in Perl
Message-Id: <33DD1C78.7567@hackberry.chem.niu.edu>

wchrist@flagmail.wr.usgs.gov wrote:
> 
> I am trying to execute shell commands in Perl with no success.  The
> shell version of what I am trying to do is as follows:
> 
> #!/bin/sh
> 
> taetm << done
> isisdoc FROMPDF=test.pdf
> exit
> done
> 
> How do I translate this to perl?  Taetm is an application, and isisdoc
> is a program run under this application.  The FROMPDF=test.pdf is an
> argument passed to isisdoc, with the exit call terminating the taetm
> application after isisdoc is finished running.
> 
> I have tried to execute this in perl with both the system() call and
> the Shell module.  Any help in this matter would be greatly appreciated!
> 

it helps if you show us what you tried, and specifically what
error messages you got.

your arguments are:
$args = "isisdoc FROMPDF=test.pdf\nexit\n";
can you do
system "taetm $args"; 
 ??
how about

$cmd = <<CMD;
taetm << done
isisdoc FROMPDF=test.pdf
exit
done
CMD

system "$cmd";
-- 
==========================================================
 - darin
burleigh@hackberry.chem.niu.edu
\\//\\//.\\//\\//.\\//\\//. http://hackberry.chem.niu.edu/HOME/dcb/
 '2 kinds of green, look out!' - dieter rot


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

Date: Mon, 28 Jul 1997 17:59:18 -0400
From: Seema Rani <srani@uu.net>
Subject: export variables
Message-Id: <33DD1636.167EB0E7@uu.net>

Is there a way to export variables in perl.
like (export xyz) in shell programming.

Thanks


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

Date: 28 Jul 1997 16:07:00 -0400
From: Clark Dorman <clark@s3i.com>
Subject: Re: Extremely peculiar behavior in a loop in a subroutine
Message-Id: <dzpr7q6u3.fsf@s3i.com>


Charles Herold <cherold@pathfinder.com> writes:
> Please look at the subroutine below.  

I did.

> The problem is the if statement. 

I don't think so.

> At first, where I now have "$level = 0" I had "next", but that exited
> the entire subroutine with the message:
> 
> Exiting subroutine via next at final line 139, <STDIN> chunk 2 (#1)
> Exiting subroutine via next at final line 139, <STDIN> chunk 2.

I believe that perl is trying to tell you that "next" doesn't really
mean what you think it means in this context.  You might think that it
would mean that it should go back to the top of the do loop, but it
doesn't.
 
> So then I changed it to what you see below.  Now in all my years of
> programming it has always been my experience that setting a test
> variable to a number guaranteed to fail will cause the conditional test
> to fail, but in this case if the user enters something that doesn't
> begin with a digit, $level is set to 0 and 0 is returned.
> 
> Why?

Because you have an && where you want an ||.
 
> sub getNumber
> {
>   local ($maxNum) = @_;
>   local($level);
> 
>  do {
>     $level = <STDIN>;
>     if ($level !~ /^\d/) {
>       print "please enter a number\n";
>       $level = 0;
>     }
>   } while ($level < 1 && $level > $maxNum);
                        ^^
                        ||
                      Right here, should be ||.
> 
>   $level;
> }

Also:
	1.  use "my" vice "local"
	2.  use "chomp $level" to get rid of that pesky return and look for
		$level !~ /^\d*$/
	3.  This is vulnerable to someone typing "3c" since it only
	    checks the first value.
	4.  Personal programming technique:  use an explicit return value.

For what it's worth, I'd do:

sub getNumber {
   my ( $maxNum ) = @_;
   my ( $level );
   
   $level = <STDIN>;
   chomp $level;
   while ( $level !~ /^\d*$/ or 
	   $level < 1        or
	   $level > $maxNum) {
      print "Please enter a number \n";
      $level = <STDIN>;
      chomp $level;	
   }
   return $level;
}

But, aren't we doing a numerical check with the $level < 1  and isn't 
	that bad?
No, I don't think so since the test gets short-circuited by the "or".

Aren't we being repetitive with the multiple <STDIN>'s and chomps?
Yes, but clarity beats conciseness any day in my book.

To get rid of the repetitive stuff, you can use a label and use
"redo".  In fact, you might want to take a look at redo function in perlfunc. 

sub getNumber {
   my ( $maxNum ) = @_;
   my ( $level );

 LOOP: {
      $level = <STDIN>;
      chomp $level;
      if ($level !~ /^\d*$/) {
	 print "please enter a number\n";
	 redo LOOP;
      }
      redo LOOP if $level < 1;
      redo LOOP if $level > $maxNum;
   }
   return $level;
}

-- 
Clark



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

Date: 28 Jul 1997 14:35:05 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: cherold@pathfinder.com
Subject: Re: Extremely peculiar behavior in a loop in a subroutine
Message-Id: <8chgdeyi5y.fsf@gadget.cscaper.com>

>>>>> "Charles" == Charles Herold <cherold@pathfinder.com> writes:

Charles> Please look at the subroutine below.  The problem is the if statement. 
Charles> At first, where I now have "$level = 0" I had "next", but that exited
Charles> the entire subroutine with the message:

Charles> Exiting subroutine via next at final line 139, <STDIN> chunk 2 (#1)
Charles> Exiting subroutine via next at final line 139, <STDIN> chunk 2.

"do ... while" loops are not real loops.  They're a bizarre
combination of a do {} and a backwards while.

As such, they cannot support last/next/redo without breaking older
code.

Charles>  do {
Charles>     $level = <STDIN>;
Charles>     if ($level !~ /^\d/) {
Charles>       print "please enter a number\n";
Charles>       $level = 0;
Charles>     }
Charles>   } while ($level < 1 && $level > $maxNum);

I'd write this as:

	{
		$level = <STDIN>;
		last if $level >= 1 and $level <= $maxNum;
		print "please enter a number again\n";
		redo;
	}

Yes.  A naked block.  Not a do-while block.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 399 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
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@ora.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: 28 Jul 1997 14:19:21 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: pete@horus.cix.vapethis.co.uk
Subject: Re: function pointer dereferencing
Message-Id: <8cn2n6yiw6.fsf@gadget.cscaper.com>

>>>>> "Pete" == Pete Jordan <pete@horus.cix.vapethis.co.uk> writes:

Pete> In article <Pine.GSO.3.96.970716220329.18795D-100000@kelly.teleport.com>,
Pete> rootbeer@teleport.com (Tom Phoenix) wrote:

>> So, this syntax is now a feature in version 5.004.
>> 
>> $result = $coderef->($parameter, $another);

Pete> Woo! And not only that, but:

Pete> 	#!/usr/bin/perl

Pete> 	foo(sub {print 'hello, ', join(', ', @_), "!\n"});

Pete> 	sub foo {
Pete> 	  my $bar=shift;

Pete> 	  $bar->('Tom', 'Randal', 'Larry');
Pete> 	}

Pete> works too. Anyone remember Algol68?

You didn't take that far enough:

	sub {
		print "hello, ", (join ", ", @_), "!\n";
	} -> qw(Tom Randal Larry);

Eeek.  It works.  So now we have a do-block that understands
return:

	$a = sub {
		...;
		...;
		return $blah if $cond;
		...;
	} -> ();

Eeek.  Eeek.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 399 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
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@ora.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: 28 Jul 1997 16:38:57 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: I still can't install perl5
Message-Id: <m3n2n67nn2.fsf@windlord.Stanford.EDU>

Ling Hua <hua@mary.cs.fsu.edu> writes:

> I am trying to install perl5.004_01 on to SVR4 (unisys).  When doing
> "make depend", I noticed some warning message, but the program still
> finished. The "make" didn't, I got

>      make: fatal error: line 510: syntax error

> I checked to see that the Makefile has only less than 500 lines, so some
> clue is definitely needed for me to go on.  During the "sh configure", I
> simply chose the default values.

I have no idea if this is the source of your problem or not, but one of
the things I *always* install on any new system is GNU make.  I don't
trust vendor make, and a lot of makefiles are written expecting GNU make,
whereas very few require special vendor features.

You may want to try doing that (it's available from prep.ai.mit.edu in
/pub/gnu with the rest of the GNU software) and seeing if it helps any.

-- 
#!/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: Mon, 28 Jul 1997 14:06:34 -0500
From: "Junaid Shah [C]" <shahjn@cig.mot.com>
Subject: Parsing line by line
Message-Id: <33DCEDBA.41C67EA6@cig.mot.com>

Hi,

I would like to parse a file process each line and before reading the
next line be able to delete the current line from the file. Only I don't
know how to go about doing it.

Many Thanks...

ps: I know how to parse line by line it's the deleting part that I do
not know...

-- 
----------------------------------------------------------
  Junaid Shah     Ph:(847)632-7040    Fax:(847)632-6733
  Enabling Technologies, Motorola Inc.
----------------------------------------------------------


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

Date: 28 Jul 1997 20:14:02 GMT
From: stud6x19@bnr.ca (Andrew Cheyne)
Subject: perl on Win32 - fork()
Message-Id: <5riuia$b6s@bmtlh10.bnr.ca>

Hello..

   I am porting a Unix perl script to perl for Win32 and keep
getting an error message stating that fork is unspoorted. IS
this true? Is it available anywhere else? 

Please cc respinses by email to : stud6x19@nortel.ca

Thanks,
Andrew

---
Andrew Cheyne
Nortel Montreal


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

Date: 28 Jul 1997 15:18:16 GMT
From: Anthony Danh <cyberkid@tamos.gmu.edu>
Subject: Perl Script with Netscape 4.01
Message-Id: <5rid7o$u07@portal.gmu.edu>
Keywords: Perl, Netscape

Hi..
	Does anyone know why a perl script which ran perfectly with
Netscape 3.X or lower, but could not run with Netsape 4.01?

Thanks

Anthony
cyberkid@tamos.gmu.edu



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

Date: Mon, 28 Jul 1997 15:02:19 -0600
From: Thomas_Santamaria@ushc.com
Subject: Perl5.004 installation problems on AIX 4.1
Message-Id: <870119306.6789@dejanews.com>

I was trying to install Perl5 on a local AIX box and did not have much
luck when trying to run the tests.  In particular when I run make test
(or TEST -v), I get the following;

FAILED on test 0
Failed 1 test script out of 155, 0.00% okay.
   ### Since not all tests were successful, you may want to run some
   ### of them individually and examine any diagnostic messages they
   ### produce.  See the INSTALL document's section on "make test".
u=0.11  s=0.03  cu=0.05  cs=0.04  scripts=0  tests=0

Not knowing how exactly to respond, I have also tried to run "harness"
with the following results;

Failed Test  Status Wstat Total Fail  Failed  List of failed
------------------------------------------------------------------------------
comp/script.t                 3    2  66.67%  1, 3
io/argv.t                     5    3  60.00%  1-3
io/dup.t                      6    1  16.67%  5
io/pipe.t                    10    1  10.00%  10
lib/dirhand.t                 5    2  40.00%  2-3
lib/io_dup.t                  6    1  16.67%  5
lib/io_taint.t               ??   ??       %  ??
op/exec.t                     8    2  25.00%  1, 5
op/glob.t                     6    1  16.67%  3
op/magic.t                   30    3  10.00%  1, 15-16
op/misc.t                    45   45 100.00%  1-45
op/readdir.t                  3    1  33.33%  3
op/runlevel.t                 8    8 100.00%  1-8
op/taint.t                   ??   ??       %  ??
pragma/locale.t              ??   ??       %  ??
pragma/strict.t              47   47 100.00%  1-47
pragma/subs.t                 6    6 100.00%  1-6
Failed 17/151 test scripts, 88.74% okay. 123/4069 subtests failed, 96.98% okay.

Can someone advise me what to do next?	I downloaded Perl to try and
learn it on my own, but it seems as though I can't get out of the chute. 
What can I do about the failed tests?  Are my results "good enough"?

Please respond via e-mail, if possible.

Thanks for your help.
Tom

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Mon, 28 Jul 1997 15:53:35 -0400
From: Rick Mangi <rmangi@tgix.com>
To: greg@infinicom.com
Subject: Re: Question: How to execute a program and read results
Message-Id: <33DCF8BF.8204D2E5@tgix.com>

well you obviously have net access, and your question is rediculously
well documented with at least 3 different methods of solving it, so...

RTFFAQ:

ftp://ftp.digital.com/pub/plan/perl/CPAN/doc/manual/html/pod/perlfaq8.html


a@123.com wrote:

> This may seem extremely easy and straightforward, and is probably
> documented
> in a number of perl books I have (in PA), but I'm in NE and all I have
> is the
> 2nd edition camel book and the solution has escaped me.
>
> What I'd like to do is something that should be fairly easy. For
> example,
> execute the command "/usr/bin/finger username" and I want to be able
> to get
> the output of that command.
>
> Can someone help me out here?  Thanks
>
> Greg



--
_______________________________________________________________

Rick Mangi                                  Tel: (212) 972-2030
Thaumaturgix, Inc.                          Fax: (212) 972-2003
310 Madison Avenue, Suite 704               rmangi@tgix.com
New York, NY 10017                          http://www.tgix.com
          thau'ma-tur-gy, n. the working of miracles
  "Perl is a state of mind as much as it is a language grammar"
_______________________________________________________________





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

Date: 28 Jul 1997 20:51:19 GMT
From: dmercer@Glue.umd.edu (Dennis Mercer)
Subject: Sorting IP's
Message-Id: <5rj0o7$uj5$1@hecate.umd.edu>

I've got a quick perl question... Anyone here know of a way to sort IP's?
The only thing I can think of is to grep the IP's from my database... It's
a database of all our servers, and when I try to sort it by IP, it is
slow, because it has to grep such a long range of numbers...  If anyone
has any suggestions, please let me know...

dennis



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

Date: Mon, 28 Jul 1997 12:28:07 -0600
From: Euan Forrester <deforres@acs.ucalgary.ca>
Subject: Statements executed out of order?
Message-Id: <5rioei$e4i@ds2.acs.ucalgary.ca>

I'm having a very strange problem. In part of my script, I append two
files together to create a new file, close all three files, and use unlink
to delete the two old files.

Then I open the new one for reading, print it to STDOUT, close it, and use
unlink again to delete it.

At least, that's what's supposed to happen. In reality, I get a "requested
URL not found" error on my browser. I assume this is coming from the MIME
'Location:' tag I print just before the file.

What's wierd is that if I comment out the last unlink command, it works
fine. But, this command occurs AFTER the file is supposedly opened,
printed, and closed again! Can anyone tell me what's going on here? Thanks
in advance. Cheers!



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

Date: Mon, 28 Jul 1997 19:31:54 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: tied hashes
Message-Id: <EE1nL6.913@bcstec.ca.boeing.com>

In article <p3zk9ihphvb.fsf@gummy.cs.indiana.edu>,
jason almeter  <jla@gummy.cs.indiana.edu> wrote:
 > 
 > I have an application where it would be useful to be able to use
 > 'wantarray' in FETCH of an object tied to a hash.  Any ideas?
 > 
 > Info...
 > 
 > perl 5.003 on AXP VMS
 > wantarray seems to be always 0 inside FETCH
 > 
 > I can get...
 > 
 > 	*glob = $foo{bar};
 > 
 > 	$x = $glob;
 > 	($y, $z) = @glob;
 > 
 > to work, but would rather provide something like...
 > 	
 > 	$x = $foo{$bar};
 > 		and
 > 	($y, $z) = $foo{$bar};
 > 
 > to my users.
 > 


This won't work on a tied hash reference because wantarray 
returns "the context of the currently executing subroutine".

Since the ref. is itself modeled as a hash, would something 
like this work or do you have something else in mind?

     my $x = keys %{$foo{$bar}};     
     my ($y, $z) = keys %{$foo{$bar}};



HTH,
--
Charles DeRykus
ced@carios2.ca.boeing.com


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

Date: Mon, 28 Jul 1997 15:45:01 -0400
From: Scott Blanksteen <sibsib@hotmail.com>
Subject: Re: Unix time, local time, year 2000 question.
Message-Id: <33DCF6BD.15400F5B@hotmail.com>

Lynn Walton wrote:
> Meanwhile, I have written code under the assumption that it would just
> return the 2 digits 00 ?   Does anyone know this for sure?

It will most definitely return '100' in the year 2000.

Scott

-- 
Scott I. Blanksteen
sib (at) worldnet (dot) att (dot) net


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

Date: 28 Jul 1997 16:16:21 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Lynn Walton <wwalton@ee.net>
Subject: Re: Unix time, local time, year 2000 question.
Message-Id: <8cbu3mydh6.fsf@gadget.cscaper.com>

>>>>> "Lynn" == Lynn Walton <wwalton@ee.net> writes:

Lynn> I was surprised, when I stumbled upon a sentence I hadn't
Lynn> noticed before in the camel book (p. 185) where it says "the
Lynn> year field returned from localtime has had 1,900 subtracted from
Lynn> it."  I guess I had thought that the first 2 digits were just
Lynn> dropped.  If the book is correct, I would expect it to return
Lynn> the number 100 in the year 2000.

I'd say the book has a pretty good chance at being correct, being
coauthored by Larry and all. :-)

Lynn> Meanwhile, I have written code under the assumption that it
Lynn> would just return the 2 digits 00 ?  Does anyone know this for
Lynn> sure?

Yes, there are people that know for sure. :-)

Lynn> And for a trivia question, does anyone know when the 32bit
Lynn> number for unix time will overflow?  When it does, will the
Lynn> function time return a valid number (although it will not be the
Lynn> number of seconds since Jan 1 1970 anymore) or will it return
Lynn> undefined?

    $ perl -e 'print scalar gmtime 1 << 31'
    Fri Dec 13 20:45:52 1901

Hmm.  That's not what I wanted.  And look, it's a Friday the 13th. :-)

    $ perl -e 'print scalar gmtime ((1 << 31) - 1)'
    Tue Jan 19 03:14:07 2038

Ah.  That's the number I was expecting.

Year 2038.  And what Perl does on such a time, I can only
speculate. :-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 399 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
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@ora.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: Mon, 28 Jul 1997 15:32:12 -0400
From: LRiddle@ness.agnesscott.edu (Larry Riddle)
Subject: using substr inside regexp for substitutions
Message-Id: <LRiddle-2807971532120001@168.28.233.61>

I am just learning Perl and am having trouble trying to do the following
(I have checked the FAQ lists and a Perl reference without success).

I would like to take an expression like

<a href="abcdefghijk.htm">

and truncate the htm file name to just 8 characters to get

<a href="abcdefgh.htm">. I want to do something like

s/\"(.+)\.htm\b/\"substr(\1,1,8)\.htm/g;

but this substitutes the entire expression substr(\1,1,8) rather than
evaluating the substr function and substituting the result. The
substitution also needs to work on expressions like

<a href="http://www.xxx.yyy/zzz/abcdefghijk.htm">

and just truncate the abcdefghijk part to 8 letters. The method above
doesn't work on this because it picks up everything from the first
quotemark, not just the abcdefghijk.htm part. Any help would be
appreciated. Please respond by email also if you send a response back to
the newsgroup. Thank you.

Larry Riddle  LRiddle@ness.agnesscott.edu

-- 
Larry Riddle, Chair | larry.riddle@asc.scottlan.edu
Mathematics Dept    | 404-638-6222, 404-638-6177 (fax)
Agnes Scott College | http://www.scottlan.edu/academic/ 
Decatur, GA 30030   |         math/welcome.htm


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

Date: 28 Jul 1997 12:19:31 -0500
From: mlehmann@prismnet.com (Mark A. Lehmann)
Subject: Re: What is involved with lib-www????
Message-Id: <5bpvs3m6vw.fsf@smokey.prismnet.com>

Well the best option is to get "Web Cliet Programming" by Clinton Wong
published by O'Reilly and Assocaites.  This takes you through the lib-www
code in a traditional O'Reilly style.

To install, get lib-www.  type 'perl Makefile.PL' and wait for some error
messages to tell you what other packages are needed.  Then get those
packages.  Then type 'perl Makefile.PL' in your lib-www distribution again.
Some of the packages the lib-www wants to use contain C code so you will need
a compiler if those modules are missing.

Also you might want to use the CPAN module.  I haven't tried the lib-www
installation from it, but my GUESS is that you would do the following:

   perl MCPAN -e shell
   CPAN> install Bundle::LWP

jlfitz@webmarquee.com (Jeffrey L. Fitzgerald) writes:

> 
> 
> I would like to use some of the lib-www items but do not know how to go 
> about setting it up.
> 
> 	Is this a ready to go out of the archive kinda thing? Or does it 
> need to be installed, etc. Any help greatly appreciated...

-- 
Mark Lehmann.


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

Date: Mon, 28 Jul 1997 15:57:02 -0700
From: Brian Zhou <brian_zhouNOSPAM@sid.hp.com>
Subject: win32 $? or GetExitCode does not work?
Message-Id: <33DD23BE.731@sid.hp.com>

Hi all,

How can you get the return code from another process on Win32?

I have tried

	close pipe w/ $?
	Win32::Process GetExitCode()

but none of them seems to work. I always get a return code of 0!

MKS ksh can get the exit code, even DOS batch ERRORLEVEL can get
it right. What a shame Perl cannot.

I'm using ActiveWare Perl for Win32 build 306 on Windows 95.

Any one know what's wrong?

Thanks,

-Brian


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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