[7553] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1179 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 15 10:09:32 1997

Date: Wed, 15 Oct 97 07:00:30 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 15 Oct 1997     Volume: 8 Number: 1179

Today's topics:
     [Q]: cgi/perl: Location <rganesan@cisco.com>
     Re: ARGV question (Tad McClellan)
     Re: Can I use Perl cgi script to control external progr (Jeremy D. Zawodny)
     Re: Cannot Use use (Lars Gregersen (c908239))
     Re: CGI / Perl / Win95 help ... (Jeremy D. Zawodny)
     Re: Creating Arrays on the fly (Toutatis)
     Re: Database Management in UNIX (Jim Esten)
     Re: Flock() (Tad McClellan)
     Re: Flock() (Ilya Zakharevich)
     FTP help... nothing@nowhere.com
     Re: global variable under "use strict" (Jeremy D. Zawodny)
     Re: How to do a questionnaire (Burt Lewis)
     How to go a particular line in a file? (John Robson)
     Perl and GDBM rick@www.bpa.nl
     Perl File Directory on NT <alexis@email.gcn.net.tw>
     Re: Perl File Directory on NT (Jeremy D. Zawodny)
     Perl GDBM and delete records rick@www.bpa.nl
     Perl OLE and MSWord (David Brewster)
     Re: Perl OLE and MSWord <schwartz@cs.tu-berlin.de>
     Programmers Needed-ATL (Steve Kohler)
     Sybperl failing on 'make test' (Keith Willis)
     Re: Sybperl failing on 'make test' (Keith Willis)
     Re: truncate() & FileHandle(s) (Peter Haworth)
     Re: Warnings when testing undefined variables with perl (Ken Irving)
     Re: Warnings when testing undefined variables with perl (Tad McClellan)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 15 Oct 1997 19:17:51 +0000
From: Ganesan Ramu <rganesan@cisco.com>
Subject: [Q]: cgi/perl: Location
Message-Id: <344516DF.6850@cisco.com>

Hi,

This is my Q:

A server gives an URL to its client and the client has to open the
URL with a *new* browser window.

By emitting "Location: URL" ( from servers cgi script), client opens
the url in its current browser window. Is there any way to give TARGET
with Location: URL? If not, can you help me in some other way to
implement the above.


Thanks in advance,
Ganesan Ramu


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

Date: Wed, 15 Oct 1997 06:05:03 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: ARGV question
Message-Id: <v08226.uj.ln@localhost>

Alan (ahecker@interport.net) wrote:
: Folks,

: I'm attempting to read some command line args into a program I'm
: writing. Now, it's my understanding that what will follow should work,
: given a command line that looks like:
: someprogram filename1 filename2 filename3.


: So, if I do:

: $count = 1;

Arrays in perl start at zero, not one. Make that:

   $count = 0;


: $len = @ARGV;
: until ($count == $len) {
:       open (IN, $ARGV[$count]);
:       #do some operations here
:       close (IN);
:       $count++;
: }

: Should the open statement work correctly or not? 


If you call it the correct number of times it should  ;-)

Just use foreach() as Brian suggested.


: And if not, 1) what
: will make it work the way I need it to--namely, opening the args from
: the command line, in order--and 

: 2) why doesn't mine work?


It works OK for filename2 and filename3, just not for filename1, right?

Then the reason is your starting index.



Ask perl to tell you why open() is not working:

   open (IN, $ARGV[$count]) || die "could not open '$ARGV[$count]'  $!";


: Sorry if this is bonehead, dirt simply stuff, but hey, I've been doing
: this a whole 2 weeks now! :-)


ALWAYS check the return value from open()


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Wed, 15 Oct 1997 12:06:43 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Can I use Perl cgi script to control external programme ???
Message-Id: <344ab15d.152525810@igate.hst.moc.com>

[cc'd automagically to original author]

On Wed, 15 Oct 1997 15:49:42 GMT, bslee@pl.jaring.my (B.S.LEE) wrote:

>Currently, I am setting up a windows NT server (ver 4.0). I am using
>Perl 5 to compose my cgi script. I want to use this cgi script to
>control or communicate with the external program( probably written in
>c++) which this external programme is trying to control the external
>device through the interfacing card.
>
>Can I do this under windows NT environment ?????  

Theoretically, yes.

>Can anybody give me some guides ?????

I'm afraid you'll need to be more specific. If you can, say, post a
Perl question (since this is a Perl newsgroup), we'd be glad to help.
Otherwise, if you're asking for someone to tell you how to design it,
you may be asking the wrong people.

What have/haven't you tried yet? Do you know Perl? Have you written
CGI scripts before? Is there a particular piece of this you don't
understand how to do? Are you looking for some good books/on-line
docs? (Hint: see the docs that come with Perl.)

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: 15 Oct 1997 10:30:34 GMT
From: matlg@bohr.gbar.dtu.dk (Lars Gregersen (c908239))
Subject: Re: Cannot Use use
Message-Id: <62260a$7oa$1@news.uni-c.dk>

Rick (rbrewer@ccmail.dsccc.com) wrote:
: Hello,
:     I am trying to make use of Perl modules but cannot get "use"
: to find the modules. Even when adding the command:
: push (@INC, "/usr/local/perl/lib");

I tend to get more luck out of using the 'lib' module. As in something 
like this:
use lib '/usr/local/perl/lib';
but since you have a problem with using use. You might not be able to 
use that one ;-)

: then
: use Carp;

:    I still get the same error:
: Can't locate Carp.pm in @INC at test.pl line 14.

This is not very good since Carp is a standard module. Does the file
Carp.m exist in the appropiate place. The appropiate place is also checked
with the command
perl -V
in the @INC section. If the file doesn't exist you might have to install
perl again.

You can also use perl -V to see the version of perl. An easier way to 
do this is by
perl -v 
I don't know when Carp wah created, but if you post your version number
I'm sure that somebody else will be able to use that information.

  Lars



-------------------------------------------
Lars Gregersen
Department of Chemical Engineering
Technical University of Denmark

E-mail: lg@kt.dtu.dk
Homepage: http://www.gbar.dtu.dk/~matlg/


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

Date: Wed, 15 Oct 1997 11:58:39 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: CGI / Perl / Win95 help ...
Message-Id: <3447af98.152072879@igate.hst.moc.com>

[cc'd automagically to original author]

On Wed, 15 Oct 1997 08:20:19 GMT, rexxchen@ms1.hinet.net (T2N2M0)
wrote:

> 5. In index.htm , I setup a link to a.pl .
>    BUT , when I tested , it did not work .
>
>I guess the problem is in a.pl .
>  The first line in a.pl is good for Unix plateform .
>  How is the coding rule in Win95 ???

Ah. It's a CGI problem, then.

To quote the ever-quotable Tom Phoenix:

---snip---

When you're having trouble with a CGI program in Perl, you should
first look at the please-don't-be-offended-by-the-name Idiot's Guide
to solving such problems. It's available on the perl.com web pages.

   http://www.perl.com/perl/
   http://www.perl.com/perl/faq/
   http://www.perl.com/perl/faq/idiots-guide.html

---snip---

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: 15 Oct 1997 10:06:00 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: Creating Arrays on the fly
Message-Id: <toutatis-ya023180001510971206010001@news.euro.net>

In article <3444548F.E7C2D86F@poolpros.com>, ryanr <ryanr@poolpros.com> wrote:

> How would I go about creating a 2 dimensional array on the fly?
> 
> right now I am creating my arrays, according to the way Tom Christiansen
> says in FMTEYEWTK, such as:
> @Table = ([1,2,3,4],
>                   [5,6,7,8],
>                   [9,0,1,2]);
> 
> This works o.k..   but what I would really like to do is read my values
> in from a file
> and build the array.  I realize that I would have to use push(), but I'm
> not sure how I would go about adding to the 2nd dimension..
> 
>     Ryan

Something like:

my @array;
my $file = '/etc/passwd';
open (F,$file) or die "Grrr, $!";
while (<F>){
   chop;
   push @array,[split /:/];
}
close (F);

-- 
Toutatis


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

Date: 15 Oct 1997 08:35:08 -0500
From: jesten@earth.execpc.com (Jim Esten)
Subject: Re: Database Management in UNIX
Message-Id: <622gqc$pu$1@earth.execpc.com>

Doug Seay (seay@absyss.fr) wrote:
: [posted and mailed]

: dominic@thiru.vetri.com wrote:
: > 
: > Hello Perlians,
: > 
: > I regret if it is a repeated question.

: Why bother checking the docs/FAQ.  No one else does.

: > So far I have been using Perl for Win32 in Win95 and Win NT machines.  In
: > that I was using Dave Roth's Win32::ODBC module without any problem. Now
: > I have to use something like a database management utility in my unix
: > system.
: > 
: > I need to do the following in my UNIX machine
: > 
: >   1. Create a new database with 5 fields (or more).
: > 
: >   2. Add record(s) to that new database file.
: > 
: >   3. Grep some records and modify it and update it in the database.
: > 
: >   4. Delete some records with some specific field name.
: > 
: >   5. Generate a report (something like using SQL statement).
: > 

You may want to have a look at Shishir Gundavarum's Sprite.pm - 
it is a module for creating and managing flat file text databases
using a subset of SQL commands... quite snappy, easy to use.

You can find it on CPAN, read about it in his book "CGI Programming
on the World Wide Web with Perl" (O'Reilly), and if you want, I'd 
be happy to send you an archive of a little bug tracking cgi program
I wrote that we use among in house developers that in based on 
Sprite.pm and also uses CGI.pm

Jim



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

Date: Wed, 15 Oct 1997 05:56:14 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Flock()
Message-Id: <eg7226.8j.ln@localhost>

ryanr (ryanr@poolpros.com) wrote:
: Is simply using flock() on a file, enough to keep multiple users from
: accessing it?


No.

It is an _advisory_ lock only. All programs that access the file
must *cooperate* in order for it to work.

Now, if the *only* program to access your counter file is your
counter script, then yes, it should be enough.


: I've heard otherwise, but can't remember what the reasons were.  Anyway,
: I have a counter program that opens a file and writes to it to store the
: count.  It has been working great for the last 17,000 hits, then
: suddenly it is at 200.  It used to reset itself all the time before I
: put in the flock(), and I thought everything was stable until yesterday!


Sounds like you have a bug.

Can't fix a bug in code we cannot see...



Does your code look a lot like the answer to this Frequently Asked
Question (from Perl FAQ, part 5) ?

   "I still don't get locking.  
    I just want to increment the number in the file.  
    How can I do this?"


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 15 Oct 1997 11:57:04 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Flock()
Message-Id: <622b2g$eb8$1@agate.berkeley.edu>

In article <eg7226.8j.ln@localhost>, Tad McClellan <tadmc@flash.net> wrote:
> ryanr (ryanr@poolpros.com) wrote:
> : Is simply using flock() on a file, enough to keep multiple users from
> : accessing it?
> 
> 
> No.
> 
> It is an _advisory_ lock only. All programs that access the file
> must *cooperate* in order for it to work.

If you are on *nix...  More recent OSes may have locks "in the
kernel", not added a kludge.

I did not check, but I think that Perl's flock() on OS/2 is mandatory.

Ilya


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

Date: Wed, 15 Oct 1997 13:12:11 GMT
From: nothing@nowhere.com
Subject: FTP help...
Message-Id: <622fif$6lu$1@news.gate.net>

        I'm learning Perl5 from waite.com's interactive course. Trying to run 
this lesson:

        #!/usr/local/bin/perl

        require 'ftplib.pl';

        ftp::open("cs-pub.bu.edu");
        ftp::cwd("irc/clients");
        ftp::binary;
        ftp::get("sirc-2.0.tar.gz");
        ftp::close;

And it tells me can't fine syscall.ph. How do I run h2ph.sh?

Also says can't find socket.pm


Question 2:

        I'm trying to ftp to my site to get my dir.(just for practice) Is this 
correct?

        run from dos command-line:


                ftp -s:perlscript.pl  ftp.myserver.com


               
        #!/usr/local/bin/perl
        ##perlscript

        open(MYDIR, "/user/myaccount") or die "Can't $!\n";   
        @files = readdir(MYDIR);
        
        close MYDIR;

        foreach $files(@files){
                print "$files\n";
}



##how do I tell the server my login ID and password?


Thank you....

Jeff

gljoe101@aol.com
        


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

Date: Wed, 15 Oct 1997 12:01:39 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: global variable under "use strict"
Message-Id: <3448b00e.152191029@igate.hst.moc.com>

[cc'd automagically to original author]

On 15 Oct 1997 11:01:46 +0200, Heiko Klein <hklein@ikp.uni-koeln.de>
wrote:

>Some global variables would do, but I like to use strict.

You can have "global" variables (depending on what you mean by global)
like this.

---cut---

#!/usr/local/bin/perl

use strict;

my $global_foo = 50;

&do_stuff or die "Can't find it.";

exit;

sub do_stuff {
	return(10) unless $global_foo;
}

---cut---

If that's *not* what you meant by having globals, then I apologize for
mis-understanding your question.

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: 15 Oct 1997 13:49:21 GMT
From: burt@ici.net (Burt Lewis)
Subject: Re: How to do a questionnaire
Message-Id: <622hl1$3a5$1@bashir.ici.net>

Christian,

Examples of this are available at many of the Perl related Websites.

Fire up your favorite search engine for Perl information and examples.

Good Luck

Burt Lewis

In article <3443DA2E.576A0B98@mks.net>, christian.dubuc@mks.net says...
>
>Hi there:
>
>Someone told me that PERL is the correct language to do what I want to
>do ! I am doing a web page with a questionnaire. There are about 10
>questions, each one with a choice of 4 answers (radio buttons). At the
>bottom of the page, I will put a submit button that will do this action:
>check every answers and display the result on a seperate page (how many
>good answers).
>
>Can somebody give me the code to do that ?
>
>Thanks
>
>Christian Dubuc
><christian.dubuc@mks.net>
>



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

Date: 15 Oct 1997 13:24:12 GMT
From: as646@FreeNet.Carleton.CA (John Robson)
Subject: How to go a particular line in a file?
Message-Id: <622g5s$gmf@freenet-news.carleton.ca>


The special variable $. automatically keeps track of the line read and
increments itself.
But it doesn't allow you to modify it, to assign a value to it (?!).

Suppose I open a file and want to jump directly to, for example, line 8, how
do I do this ?  Doing $. =+ 7 doesn't seem to work.



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

Date: Wed, 15 Oct 1997 08:41:54 -0600
From: rick@www.bpa.nl
Subject: Perl and GDBM
Message-Id: <876921934.3494@dejanews.com>

I had a problem using GDBM from perl: when running the script with
perl -w I got the following message:

Argument "bouwkundig" isn't numeric in entersub at
/usr/local/lib/perl5/GDBM_File.pm
line 69.

"bouwkundig" being actually the first argument of the sub in which the
tie
was executed:

#!/bin/perl -w

use GDBM_File;
&Test("bouwkundig");

sub Test {
my($arg) = @_;

tie (%TempCache, "GDBM_File", "xx", &GDBM_READER, 0644)
  or die "error\n";
  $Record = $TempCache{$Index};

untie(%TempCache);

}  # sub Test


Problem is that tie is called with &GDBM_READER instead of
&GDBM_READER().
The proper call is &GDBM_READER(). This seems to be wrong in all
documentation I found so far... (Thanks to Siebren van der Zee)

Rick Jansen
__
rick@www.bpa.nl   http://www.sara.nl/Rick.Jansen
_____________________________________________
S&H's a module and s&h's looking good

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


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

Date: Wed, 15 Oct 1997 18:57:38 +0800
From: Alexis Lin <alexis@email.gcn.net.tw>
Subject: Perl File Directory on NT
Message-Id: <3444A1A1.1EFDE31B@email.gcn.net.tw>

Hello Everyone:

Please give me a solution if you know the following question. Thank a
lot.
I have written a Perl program as a CGI script for MS IIS3.0.
I use a command like "require '../path.pl' " to read path.pl file, but I
got an error message said "Can't locate the file".
Is there any solution to solve this trouble?

Thanks.

Alexis




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

Date: Wed, 15 Oct 1997 12:04:22 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Perl File Directory on NT
Message-Id: <3449b0bc.152365169@igate.hst.moc.com>

[cc'd automagically to original author]

On Wed, 15 Oct 1997 18:57:38 +0800, Alexis Lin
<alexis@email.gcn.net.tw> wrote:

>Hello Everyone:
>
>Please give me a solution if you know the following question. Thank a
>lot.
>I have written a Perl program as a CGI script for MS IIS3.0.
>I use a command like "require '../path.pl' " to read path.pl file, but I
>got an error message said "Can't locate the file".
>Is there any solution to solve this trouble?

That's because ".." is probably not referring to the directory that
you think it is. Do you know what the current working directory (CWD)
of your script is when the server runs it? You may want to create a
quick script to verity/change you ideas about where that is.

Have you checked file permissions?

Barring that, I'll quote Tom Phoenix and say:

---snip---
When you're having trouble with a CGI program in Perl, you should
first look at the please-don't-be-offended-by-the-name Idiot's Guide
to solving such problems. It's available on the perl.com web pages. 

   http://www.perl.com/perl/
   http://www.perl.com/perl/faq/
   http://www.perl.com/perl/faq/idiots-guide.html
---snip---

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Wed, 15 Oct 1997 08:41:59 -0600
From: rick@www.bpa.nl
Subject: Perl GDBM and delete records
Message-Id: <876922507.3728@dejanews.com>

Apparently deleting records from a GDBM hash within an each loop
does not work. It works for the FIRST record, but after deleting
that first record the each-loop exits. For a regular hash this does
work fine (deleting entries from a hash is explicitly permitted,
adding entries is not). Anyone a solution with GDBM?

Example below.


#!/bin/perl

use GDBM_File;

# Create new DB
tie (%Data, "GDBM_File", "x", &GDBM_NEWDB(), 0644);
untie %Data;

#--------------------

# Fill DB
tie (%Data, "GDBM_File", "x", &GDBM_WRITER(), 0644);
  $Data{1} = 1;
  $Data{2} = 2;
  $Data{3} = 3;
  $Data{4} = 4;
untie %Data;

print "data after creation:\n";
tie (%Data, "GDBM_File", "x", &GDBM_READER(), 0644);
  while (($i,$v) = each %Data) {
    print "$i $v\n";
  }
untie %Data;

#--------------------

# Delete all records
tie (%Data, "GDBM_File", "x", &GDBM_WRITER(), 0644);
  while (($i,$v) = each %Data) {
    delete($Data{$i});
  }
untie %Data;

print "\nAfter deling all records data is now::\n";
tie (%Data, "GDBM_File", "x", &GDBM_READER(), 0644);
while (($i,$v) = each %Data) {
  print "$i $v\n";
}
untie %Data;

#--------------------

sub ErrNExit {

print @_;
exit;

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


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

Date: 15 Oct 1997 11:10:30 GMT
From: david@internation.co.uk (David Brewster)
Subject: Perl OLE and MSWord
Message-Id: <6228b6$ass$1@alpha.ftech.net>
Keywords: perl ole word

Hi

Simple program:

use OLE;
$wd = CreateObject OLE 'Word.Basic'
             or warn "Couldn't create new instance of word baseic!!";
$wd->Open( 'testfile' );

It opens Word, but it doesn't appear on the taskbar (using Win95) and
I only know it has opened word because if I cntrl-alt-del it there is
a word process going. It also closes after the perl script finishes.

How do I actually open a full Microsoft Word window ?

Thanks
David


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

Date: 15 Oct 1997 13:36:24 GMT
From: Martin Schwartz <schwartz@cs.tu-berlin.de>
Subject: Re: Perl OLE and MSWord
Message-Id: <622gso$1tu$1@news.cs.tu-berlin.de>

Hello David,

: use OLE;
: $wd = CreateObject OLE 'Word.Basic'
:              or warn "Couldn't create new instance of word baseic!!";
: $wd->Open( 'testfile' );

: How do I actually open a full Microsoft Word window ?

Upps, I'm sorry that I cannot check this out, but I would expect you'd
have to create a 'Word.Document' object. Would you?

(Untested) regards,

Martin

-- 
// Le degre zero de l'ecriture? Zero probleme!


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

Date: 15 Oct 1997 10:47:50 GMT
From: skohler@mindspring.com (Steve Kohler)
Subject: Programmers Needed-ATL
Message-Id: <62270m$ngu@camel15.mindspring.com>

Perl Programmers/Developers needed in Atlanta, GA
to develop e-commerce apps for NYSE companies.

Established company with over 100 clients.

Top dollar paid for quality work.

Flexible working arrangements.

Please contact:

Steve Kohler
skohler@apparelex.com
www.apparelex.com
1 800 241 2463



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

Date: Wed, 15 Oct 1997 11:25:33 GMT
From: keith_willis.junk@non-hp-unitedkingdom-om1.om.hp.com (Keith Willis)
Subject: Sybperl failing on 'make test'
Message-Id: <3445a6ae.437684627@news>


Could someone suggest why I am having this problem with Sybperl?  It
builds fine, then falls over part way through 'make test'.  All
assistance gratefully received.

For information, perl is version 5.004_01

My machine is:

HP-UX kingkong B.10.20 A 9000/897 1986872232 two-user license

My compiler is gcc version 2.7.2.3

The error message is:
----------------------------------------------------------------------
make[1]: Entering directory `/disk7/gnu/sybperl-2.08/CTlib'
PERL_DL_NONLAZY=1 /usr/local/bin/perl -I.././blib/arch -I.././blib/lib
-I/usr/local/lib/perl5/PA-RISC1.1/5.00401 -I/usr/local/lib/perl5 -e
'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests
@ARGV;' t/*.t
t/ctlib............./usr/lib/dld.sl: Unresolved symbol: bsd_tcp (code)
from /sybase/lib/libtcl.sl
Can't load '.././blib/arch/auto/Sybase/CTlib/CTlib.sl' for module
Sybase::CTlib: No such file or directory at
/usr/local/lib/perl5/PA-RISC1.1/5.00401/DynaLoader.pm line 155.

at t/ctlib.t line 8
BEGIN failed--compilation aborted at t/ctlib.t line 8.
dubious
        Test returned status 2 (wstat 512)
DIED. FAILED tests 1-30
        Failed 30/30 tests, 0.00% okay
t/cursor............/usr/lib/dld.sl: Unresolved symbol: bsd_tcp (code)
from /sybase/lib/libtcl.sl
Can't load '.././blib/arch/auto/Sybase/CTlib/CTlib.sl' for module
Sybase::CTlib: No such file or directory at
/usr/local/lib/perl5/PA-RISC1.1/5.00401/DynaLoader.pm line 155.

at t/cursor.t line 12
BEGIN failed--compilation aborted at t/cursor.t line 12.
dubious
        Test returned status 2 (wstat 512)
DIED. FAILED tests 1-22
        Failed 22/22 tests, 0.00% okay
Failed Test  Status Wstat Total Fail  Failed  List of failed
------------------------------------------------------------------------------
t/ctlib.t         2   512    30   30 100.00%  1-30
t/cursor.t        2   512    22   22 100.00%  1-22
Failed 2/2 test scripts, 0.00% okay. 52/52 subtests failed, 0.00%
okay.
make[1]: *** [test_dynamic] Error 2
make[1]: Leaving directory `/disk7/gnu/sybperl-2.08/CTlib'
make: *** [test] Error 2

----------------------------------------------------------------------
The above message reflects my own views, not those of Hewlett Packard.
When emailing me, please note that there is no '.junk' in my address.


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

Date: Wed, 15 Oct 1997 11:43:39 GMT
From: keith_willis.junk@non-hp-unitedkingdom-om1.om.hp.com (Keith Willis)
Subject: Re: Sybperl failing on 'make test'
Message-Id: <3446aa5f.438629726@news>

On Wed, 15 Oct 1997 11:25:33 GMT,
keith_willis.junk@non-hp-unitedkingdom-om1.om.hp.com (Keith Willis)
wrote:

>Could someone suggest why I am having this problem with Sybperl?  It
>builds fine, then falls over part way through 'make test'.  All
>assistance gratefully received.

Damn!!

I just spotted it.  In ./CONFIG I have to set EXTRA_LIBS=-linsck for
HP-UX.  I _hate_ it when that happens :-(

Sorry, people.

----------------------------------------------------------------------
The above message reflects my own views, not those of Hewlett Packard.
When emailing me, please note that there is no '.junk' in my address.


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

Date: 15 Oct 1997 12:20:09 GMT
From: pmh@ioppublishing.com (Peter Haworth)
Subject: Re: truncate() & FileHandle(s)
Message-Id: <622cdp$1sm$1@newton.ioppublishing.com>

In article <61n5tj$g9@ector.cs.purdue.edu>,
	Todd O'Boyle <oboyle@cs.purdue.edu> writes:
> I need to truncate a file that I have a FileHandle on.  perl's
> truncate() does not work, sending me a "No such file or directory" ($!)
> when I pass it 
> 
> my $fh = new FileHandle 'filename', 'r+';
> truncate($fh,0);

I seem to remember that I had this problem at one point, and that upgrading
perl helped. I don't remember which version of perl had the problem though.

-- 
	Peter Haworth	pmh@edison.ioppublishing.com
In terms of visual processing, humans aren't good at counting above one.
	-- Larry Wall


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

Date: 15 Oct 1997 02:23:36 GMT
From: systech@polarnet.com (Ken Irving)
Subject: Re: Warnings when testing undefined variables with perl -w
Message-Id: <6219f8$mja$1@news2.cais.com>

I just asked a question with the same answer. $^W controls 
warnings, and can be turned off when desired. See perlfaq7 and 
perlvar manpages.

Ken

In article <3444303d.9545515@news.demon.co.uk>, dan@gulch.demon.co.uk says...
>
>I am writing a script which, when run using perl -w, generates a
>number of warnings.
>
>All of the lines generating warning are ones where I am testing to see
>if a variable has a defined value, e.g.
>    my $parent = undef;
>    if ($parent = $self->{ALLITEMS}[$#{$self->{ALLITEMS}}]) {
>        .... code here....
>    }
>
>This generates the warning "Use of uninitialized value at....."
>
>Is there a standard workaround for this, or am I stuck with a screen
>full of warnings (or am I doing it all wrong?)
>
>Thanks.
>
>Dan Sumption
>http://www.hardnet.co.uk/dan/

-- 
Ken Irving, SysTech Control, systech@polarnet.com, 907.456.1694



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

Date: Wed, 15 Oct 1997 07:59:28 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Warnings when testing undefined variables with perl -w
Message-Id: <gne226.uu4.ln@localhost>

Ken Irving (systech@polarnet.com) wrote:
: I just asked a question with the same answer. $^W controls 
: warnings, and can be turned off when desired. See perlfaq7 and 
: perlvar manpages.


Whoa, whoa, whoa!

Don't go willy-nilly turning off warnings.

Only turn them off when you are *sure* you don't want them. To be sure,
you must fully understand why they are there.

The solution for the below problem is NOT to disable the warning.


I have never yet encountered a situation where I needed to use $^W ...



: In article <3444303d.9545515@news.demon.co.uk>, dan@gulch.demon.co.uk says...
: >
: >I am writing a script which, when run using perl -w, generates a
: >number of warnings.
: >
: >All of the lines generating warning are ones where I am testing to see
: >if a variable has a defined value, e.g.
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The if() clause below is NOT checking to see if $parent has a
defined value.

It is checking to see if it has a true value. 

Different things.


: >    my $parent = undef;
: >    if ($parent = $self->{ALLITEMS}[$#{$self->{ALLITEMS}}]) {

If $parent is defined to be zero or the empty string, this test
will fail (because they meet perl's idea of "false")

use defined() to see if something is defined  ;-)


   if (defined($parent = $self->{ALLITEMS}[$#{$self->{ALLITEMS}}])) {


: >        .... code here....
: >    }
: >
: >This generates the warning "Use of uninitialized value at....."
: >
: >Is there a standard workaround for this, or am I stuck with a screen
: >full of warnings (or am I doing it all wrong?)


You're doing it only kinda wrong  ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

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

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