[10649] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4241 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 17 17:07:32 1998

Date: Tue, 17 Nov 98 14:00:22 -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           Tue, 17 Nov 1998     Volume: 8 Number: 4241

Today's topics:
        $ENV uninitialized error (Bob Mariotti)
    Re: $ENV uninitialized error <uri@fastengines.com>
    Re: $ENV uninitialized error <nguyend7@msu.edu>
    Re: $ENV uninitialized error <r28629@email.sps.mot.com>
    Re: Can ActivePerl talk to a dll? DrDreff@my-dejanews.com
        Carp for email miko@idocs.com
    Re: cgi-lib.pl for file upload <rliu2@ford.com>
        Contacting Remote NIS Server Directly ??? <johnj.sasso@ps.ge.com>
    Re: create variable name from a variable in perl (Tad McClellan)
    Re: Cwd module <rootbeer@teleport.com>
    Re: Exec question! <yong@shell.com>
    Re: Exec question! <yong@shell.com>
    Re: File downloading <pkg@studbox.uni-stuttgart.de>
    Re: Help !!! I Need to delete icon from program manager <rootbeer@teleport.com>
    Re: help ftp yesterdays files - file testing? <arranp@datamail.co.nz>
        NDBM inconsistency <vmg@novator.com>
    Re: NDBM inconsistency (Bill Paul)
    Re: New directories <lordvorp@usa.net>
    Re: New directories (Ronald J Kimball)
    Re: Not to start a language war but.. meaw4@my-dejanews.com
        NT + Perl + redirection of output mcnay@my-dejanews.com
    Re: Oraperl (John D Groenveld)
    Re: Oraperl (John D Groenveld)
        Problem compiling with perl compiler B <kramer@techne.ca>
    Re: programing fun: tree: Map (Ronald J Kimball)
    Re: regexp query: s//g not global <rob.hardy@ndirect.co.uk>
    Re: Segmentation fault (coredump) ((was newbie - shell) <nguyend7@msu.edu>
    Re: Selena Sol's form_processor <gellyfish@btinternet.com>
    Re: substitute (Ronald J Kimball)
    Re: test for.t failure due to bad rounding (Ilya Zakharevich)
    Re: Wanted: Development Partner (Ronald J Kimball)
    Re: Win32::AdminMisc::UserSetMiscAttributes (Was Re: Wi <jimmr@evolution.org>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 18 Nov 1998 08:33:23 GMT
From: bobm@cunix.com (Bob Mariotti)
Subject: $ENV uninitialized error
Message-Id: <3652858e.29144839@news.tiac.net>

OK; ok; ok.

We've been trying to be good and use -w and use strict; in ALL our
perl programs in an effort to make them as syntactially correct as
possible.

However, how much time must we spend on an issue that was, in fact,
working properly without the use strict; but now stops.

The FAQ's don't give examples so they were no help.

So, can some of you Perl Guru's please comment/advise on the following
snipit

my $CUID=substr($ENV{'PATH_INFO'},0,3);

I get "use of uninitialized variable on this line no matter where I
use it.  The Perl docs state that the $ENV is an automatic associative
array to the environment.

Please, please, set us straight.....



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

Date: 17 Nov 1998 15:55:48 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: Re: $ENV uninitialized error
Message-Id: <sar1zn2f38r.fsf@camel.fastserv.com>

>>>>> "BM" == Bob Mariotti <bobm@cunix.com> writes:

  BM> OK; ok; ok.  We've been trying to be good and use -w and use
  BM> strict; in ALL our perl programs in an effort to make them as
  BM> syntactially correct as possible.

-w is nice, and use strict is nice.

syntactically correct is mandatory! :-) but -w and strict do not force
any syntactic changes.


  BM> my $CUID=substr($ENV{'PATH_INFO'},0,3);

  BM> I get "use of uninitialized variable on this line no matter where

it means what it says. you don't have PATH_INFO in the
environment. check first if it exists by using (guess what?)
exists. then if it is there use the env value. in general don't use
defined on hashes since the key may exist and have a value of undef.

what is happening is you are interpolating an undefined value in a
string, hence the warning. -w and strict are your friends, play nicely
with them.

so your code would be:

	if ( exists( $ENV{'PATH_INFO'} ) ) {

		$CUID=substr($ENV{'PATH_INFO'},0,3);
	}
	else {

		$CUID = 'i have no path' ;
	}

there are many variations on that theme.

BTW do you always know the path will have a 3 char prefix you want to
get? maybe a regex match might be safer than a substr.

hth,

uri

-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: 17 Nov 1998 21:02:17 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: $ENV uninitialized error
Message-Id: <72so8p$pps$1@msunews.cl.msu.edu>

Bob Mariotti <bobm@cunix.com> wrote:
: my $CUID=substr($ENV{'PATH_INFO'},0,3);
It' probably not the "my $CUID".  "$ENV{'PATH_INFO'}" may not exists.

try using "exists"
if (exists ($ENV{PATH_INFO}) {
    my $CUID = substr ($ENV{PATH_INFO}, 0, 3);
}

That should work better

: I get "use of uninitialized variable on this line no matter where I
: use it.  The Perl docs state that the $ENV is an automatic associative
: array to the environment.

%ENV is an automatic hash to the enviroment variables.  So do a 'env'
command at your unix prompt and see what keys are available for %ENV.

prompt$ perl -e 'print join "\n", keys %ENV

will dump everything that perl can see


: Please, please, set us straight.....
Us, who's us?


-- 
           Dan Nguyen            | There is only one happiness in
        nguyend7@msu.edu         |   life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 |                   -George Sand



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

Date: Tue, 17 Nov 1998 15:07:25 -0600
From: Tk Soh <r28629@email.sps.mot.com>
To: Bob Mariotti <bobm@cunix.com>
Subject: Re: $ENV uninitialized error
Message-Id: <3651E58D.6DC7D9F@email.sps.mot.com>

[posted to c.l.p.m and copy emailed]

Bob Mariotti wrote:
> 
> OK; ok; ok.
> 
> We've been trying to be good and use -w and use strict; in ALL our
> perl programs in an effort to make them as syntactially correct as
> possible.

Good; good; good.

> 
> However, how much time must we spend on an issue that was, in fact,
> working properly without the use strict; but now stops.

Spend all the time you have, if it stops working when 'use strict'.

> The FAQ's don't give examples so they were no help.
> 
> So, can some of you Perl Guru's please comment/advise on the following
> snipit
> 
> my $CUID=substr($ENV{'PATH_INFO'},0,3);
> 
> I get "use of uninitialized variable on this line no matter where I
> use it.  The Perl docs state that the $ENV is an automatic associative
> array to the environment.
> 
> Please, please, set us straight.....

are you sure $ENV{'PATH_INFO'} even exists?

     perldoc -f exists

BTW, you don't need the quotes around PATH_INFO.

HTH.

-TK


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

Date: Tue, 17 Nov 1998 19:04:57 GMT
From: DrDreff@my-dejanews.com
Subject: Re: Can ActivePerl talk to a dll?
Message-Id: <72shco$88k$1@nnrp1.dejanews.com>

In article <ebohlmanF2KJ4I.IvC@netcom.com>,
  Eric Bohlman <ebohlman@netcom.com> wrote:
> DrDreff@my-dejanews.com wrote:
> : I have been looking and looking all through the Faqs and messages and
nowhere
> : can I find a simple answer to this simple question....
>
> : How would I pass variables to an ActiveX dll with ActivePerl?
>
> You might try Win32::OLE if the particular ActiveX control is written
> appropriately.  Failing that you could try Win32::API.
>
Very cool... I will dig into those areas. Thank you for the pointer.

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


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

Date: Tue, 17 Nov 1998 19:20:03 GMT
From: miko@idocs.com
Subject: Carp for email
Message-Id: <72si92$90q$1@nnrp1.dejanews.com>

I'm writing a Perl script which is sometimes launched by qmail.  The problem
I'm having has two parts:

- I can't see the errors when they happen

- Until it gets an exit code it likes (0 or 99 are preferred), qmail keeps
trying the program over and over.

Does anybody know of some type of "EmailCarp" module, something that logs
errors or emails them to a given address, but always exits with a controlled
exit code?  I'm currently working on a hack by copying CGI::Carp, but I'd
rather use something tried and true.

-miko

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


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

Date: Tue, 17 Nov 1998 15:01:14 -0500
From: Roger Liu <rliu2@ford.com>
To: mikej@1185design.com
Subject: Re: cgi-lib.pl for file upload
Message-Id: <3651D609.1DE1DC8E@ford.com>

Mike;

I use the following code to test and extract my file name from PC and Unix
box.

# Filter / or \ to find file name
  if ($fnm =~ /([^\/\\]+)$/) {
    $fnm = $1;
    $fnm =~ s/^\.+//;
  }

You have to assign $fnm=$cgi_cfn{'upfile1'} before that.

Hopefully this will help.

Roger





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

Date: Tue, 17 Nov 1998 13:12:23 -0500
From: "John Sasso, Jr" <johnj.sasso@ps.ge.com>
Subject: Contacting Remote NIS Server Directly ???
Message-Id: <3651BC87.7C76@ps.ge.com>

I am trying to resolve a problem where we have about 6 sites across the
Eastern part of the US, each having their own NIS domain, and
interconnected via slow WAN links.  We have scripts that need to query
NIS info from remote domains, which means that programs such as
ypcat/ypmatch (even in the Perl NIS module) need to first broadcast out
to SunRPC port 111/UDP (portmapper) to bind to a remote NIS server. 
We'd prefer that broadcasts not go out onto the remote WAN links.


Does anyone know of any Perl 5 modules/programs which would allow you to
query YP map info from a specified, remote NIS server?  This would be
great, so it would eliminate the need to broadcast out over the WAN.

		--john


PS: In case anyone asks, yes we did consider creating an NIS slave at
each site that would be a slave for all respective NIS domains. 
However, this may turn out to be an administrative nightmare, even for a
simple task we want accomplished.


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

Date: Tue, 17 Nov 1998 06:45:21 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: create variable name from a variable in perl
Message-Id: <15rr27.4f4.ln@flash.net>

Brian Jackson (bjjackso@us.oracle.com) wrote:

: I have a list of items and want to create a new variable name that
: incorporates the name of the original variable.

: Example:

: let's say I have variables called $item1, $item2.  I want a new variable
: called $item1_blah and $item2_blah.


: basically I want to attach a predefined string name to the end of the
: variable, and still retain part of the original variable name in the new
: variable name.

: any thoguhts?

   Yes.


   1) don't do that

   2) if you insist, see "Symbolic references" in the perlref man page

   3) use a hash instead of Symbolic references


      $item1 = 'ITEM1';
      $hash{"${item1}_blah"} = 'some value';



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 17 Nov 1998 20:55:43 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Cwd module
Message-Id: <Pine.GSO.4.02A.9811171252320.27321-100000@user2.teleport.com>

On Tue, 17 Nov 1998, Ken Tang wrote:

> Is it possible that the Cwd module or function is disabled or not
> available

Yes, if perl isn't properly installed.

> When I use "use Cwd():" the program seems to terminate abnormally.

Check the error message in perldiag to see what's going on. If you don't
see an error message, your system (or something) is hiding it from you;
maybe it's in an error log somewhere. But, if something as standard as
'use Cwd;' doesn't work, you should probably complain that (a recent
version of) perl is not properly configured and installed. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 17 Nov 1998 12:09:41 -0600
From: yong <yong@shell.com>
To: jesper kempe <kempe@mtek.chalmers.se>
Subject: Re: Exec question!
Message-Id: <3651BBE5.40D04685@shell.com>

jesper kempe wrote:

> Ok, now to my real problem. In my very simple perl script I exec another
> program written i Visual basic. The problem is that when I exec the vb
> program the script pause and if i dont answer the user gets the
> "document contians no data" in his browser.
> Is there another way to execute  another program in perl?
>
> Hope you understand my problem and can help me.
>
> Any comments are appritiated...
>
>             /Jesper Kempe
>            http://malte.hemmet.s-hem.chalmers.se

I guess this is an interesting question. But I don't quite understand. Why
does your Perl script pause? What do you mean by "if I don't answer"? Answer
what? Can you show us the simple Perl script? What if you try fork and exec?

Yong



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

Date: Tue, 17 Nov 1998 11:39:58 -0600
From: yong <yong@shell.com>
To: jesper kempe <kempe@mtek.chalmers.se>
Subject: Re: Exec question!
Message-Id: <3651B4ED.D6EB0505@shell.com>

jesper kempe wrote:

> Ok, now to my real problem. In my very simple perl script I exec another
> program written i Visual basic. The problem is that when I exec the vb
> program the script pause and if i dont answer the user gets the
> "document contians no data" in his browser.
> Is there another way to execute  another program in perl?
>
> Hope you understand my problem and can help me.
>
> Any comments are appritiated...
>
>             /Jesper Kempe
>             http://malte.hemmet.s-hem.chalmers.se

I guess this is an interesting question. But I don't quite understand. Why
does your Perl script pause? What do you mean by "if I don't answer"? Answer
what? Can you show us the simple Perl script? What if you try fork and exec?

Yong



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

Date: Tue, 17 Nov 1998 22:31:13 +0100
From: Peter Gilbert <pkg@studbox.uni-stuttgart.de>
To: Ken Tang <ktlb@accessv.com>
Subject: Re: File downloading
Message-Id: <3651EB21.644737E@studbox.uni-stuttgart.de>

Ken Tang wrote:
> 
> Hi,
> 
> I'm trying to set up a secure file download site using Perl.
> I can set up a form which will have links to download each file,
> and have the files fed via a small perl program.  However the
> filename sent to the browser for saving the file to be downloaded
> becomes the name of the script instead of the name of the file.
> 
> Is there a way around this without revealing the URL of the actual file?
> 
> TIA.
> 
> K.T.

I solved this by changing the action value of the form with javascript to target
differently named versions of the script so the person downloads
/secret/file.zip through /cgi-bin/file.zip (sneakily a perl script) and the
filename is all pretty.  unfortunately I have limited access to my server and
had to upload the script to many different names, a better solution is to link
all the names to the same script, which then prevents the need to upload X times
for every change.

hope this helps
-Pete


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

Date: Tue, 17 Nov 1998 19:02:24 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help !!! I Need to delete icon from program manager in NT 351
Message-Id: <Pine.GSO.4.02A.9811171101220.27321-100000@user2.teleport.com>

On Tue, 17 Nov 1998 dingfelder@my-dejanews.com wrote:

> How do I get Perl to interact with the program manager to delete an
> icon ?

Check the docs for the program manager to find out how (and whether) other
processes can request that it delete an icon. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 18 Nov 1998 08:27:42 +1300
From: Arran Price <arranp@datamail.co.nz>
To: Martien Verbruggen <mgjv@comdyn.com.au>
Subject: Re: help ftp yesterdays files - file testing?
Message-Id: <3651CE2E.1A7D@datamail.co.nz>

Martien Verbruggen wrote:
> 
> In article <3650ACF3.3ED1@datamail.co.nz>,
>         Arran Price <arranp@datamail.co.nz> writes:
> 
> > I simply want to ftp any files that are arrived less than 24 hours ago.
> [snip]
> # perldoc perlfunc
> look at the -M file test
> or
> # perldoc -f stat
> # perldoc -f time
> 
> whatever time returns minus whatever stat returns as its 9th, tenth or
> 11th field (indices 8 9 10) would be the 'age' of a file in seconds.
> Divide by 3600 to get hours.
 
> <snip>
> If you look at the mtime, you'll probably have the most
> reliable one. It will give you the time at which the file was last
> modified, i.e. when it was last written to.
> 
> Martien
> --
> Martien Verbruggen                  |
> Webmaster www.tradingpost.com.au    | Hi, Dave here, what's the root
> Commercial Dynamics Pty. Ltd.       | password?
> NSW, Australia                      |

Martien,

I looked at -M first but couldnt work out how to use it on an array or
string.  When I posted to the newsgroups I was pointed at the date
functions in cpan.

How do you use the file test on something that isnt a file?
eg
$A="-rw-r--r--   1 arranp   staff      16625 Oct 15 14:07
uucp_intro.man";
when I tried to do the test it tends to look for a file called the above
rather than testing the contents of the string.

Im probably overlooking something basic but the standard takes only a
filename which it actually tests.
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
       $atime,$mtime,$ctime,$blksize,$blocks)
           = stat($filename);

basically I want to do a function on all the files that would match
find ./* -mtime -1

Any help appreciated.

cheers

Arran
My opinions are my own and do not reflect those of my employer.


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

Date: Tue, 17 Nov 1998 14:47:37 -0500
From: Victor <vmg@novator.com>
Subject: NDBM inconsistency
Message-Id: <3651D2D9.34560BE@novator.com>

Hello,

When I do a dbmopen() in a perl program on my FreeBSD machines,
the file that it expects to open or the file that it will create
has a .db extension.  On my Solaris 2.6 machines, the same program
tries to open or create two files with .pag and .dir extensions.
My Linux machines mimic Solaris.  This seems to be a SysV versus
BSD issue but I'm not sure.  The big problem is that I have all
of these operating systems trying to access these NDBM files on
an NFS server.  The files were originally created by the Solaris
machines, therefore my FreeBSD boxes cannot access these files.
Has anyone else run into this problem?  Any solutions?

Thank you,

Victor

p.s. Please reply via email too.


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

Date: 17 Nov 1998 21:37:15 GMT
From: wpaul@ctr.columbia.edu (Bill Paul)
Subject: Re: NDBM inconsistency
Message-Id: <72sqab$gvt$1@apakabar.cc.columbia.edu>

Daring to challenge the will of the almighty Leviam00se, Victor
(vmg@novator.com) had the courage to say:

: Hello,

: When I do a dbmopen() in a perl program on my FreeBSD machines,
: the file that it expects to open or the file that it will create
: has a .db extension.  On my Solaris 2.6 machines, the same program
: tries to open or create two files with .pag and .dir extensions.
: My Linux machines mimic Solaris.  This seems to be a SysV versus
: BSD issue but I'm not sure.  The big problem is that I have all
: of these operating systems trying to access these NDBM files on
: an NFS server.  The files were originally created by the Solaris
: machines, therefore my FreeBSD boxes cannot access these files.
: Has anyone else run into this problem?  Any solutions?

This is not a problem. It's a lack of understanding on your part.

There is a difference between 'a DB library that provides the same
programming interface as NDBM' and 'a DB library that works like NDBM.'
FreeBSD uses Berkeley DB, which contains an NBDM compatibility interface
for older programs, but which does _NOT_ use the same file format.
Berkeley DB in NDBM compat mode actually just uses the normal
Berkeley DB hash method behind the scenes.

What you should do is use Berkeley DB on both platforms. NDBM has
a byte-order limitation: NDBM files created on big-endian hosts
can't be read on little-endian hosts, and vice-versa. NDBM also has
several limitations in the number of records that will fit in a
database and the length of a single record. Berkeley DB doesn't have
the same limitations.

As for Linux, I doubt it's really using NDBM. More likely it's
using gdbm which is making pretend it's NDBM. I don't think the
file formats are compatible.

-Bill

--
=============================================================================
-Bill Paul            (212) 854-6020 | System Manager, Master of Unix-Fu
Work:         wpaul@ctr.columbia.edu | Center for Telecommunications Research
Home:  wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
=============================================================================
"Mulder, toads just fell from the sky!" "I guess their parachutes didn't open."
=============================================================================


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

Date: Tue, 17 Nov 1998 11:04:23 -0800
From: Lord Vorp <lordvorp@usa.net>
Subject: Re: New directories
Message-Id: <3651C8B7.10AF@usa.net>

Paul Wood wrote:
> 
> Thanks for the help with the regexp. Any ideas with the new dirs?
> 
> They are getting created with permissions of 0755 (even though i specify
> 0777), and have a an owner of "nobody". This means that i can't touch them
> once they've been made, and i can't chown them as i don't have write
> permissions.
> Can i either
> 1) Get the directories created under my name, or
> 2) Get them created with 0777 permissions?

You need to set the umask to 0.

Forgive me...I came in late to this thread, but:
mkdir $dirname or open ">$newfilename", however you call it in perl, is
ALWAYS affected by the umask.
The umask is designed to disable write access by default to "not-you". 
User nobody means your script is CGI, and your login is not 'nobody',
now is it? :-)

Simply put:
umask 0; # it's 022 by default, turning off the 'w' bit for group/all
         # so 777 & ~022 = 755 (I think)
&createfiles;


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

Date: Mon, 16 Nov 1998 23:29:26 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: New directories
Message-Id: <1dilzn0.a2fkjc1ur4cu8N@bay1-374.quincy.ziplink.net>

Paul Wood <john.wood@diamond.co.uk> wrote:

> They are getting created with permissions of 0755 (even though i specify
> 0777)

One word:  umask

The default umask is 022.

-- 
 _ / '  _      /         - aka -         rjk@coos.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, 17 Nov 1998 20:45:48 GMT
From: meaw4@my-dejanews.com
Subject: Re: Not to start a language war but..
Message-Id: <72sn9s$dp3$1@nnrp1.dejanews.com>


> Check p5p archive.  The only reason why JPL was not made public a
> couple of months ago was an absense of a volunteer to maintain it.  I
> think that somebody volunteereed several days ago, so it should appear
> in a free source form pretty soon.

Sorry for a simple question, but what/where is p5p archive?

Thanks,
Meaw

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


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

Date: Tue, 17 Nov 1998 20:42:36 GMT
From: mcnay@my-dejanews.com
Subject: NT + Perl + redirection of output
Message-Id: <72sn3s$deb$1@nnrp1.dejanews.com>

I am having problems with redirecting the output of a perl script into a file.
example:   update.plx -i xt -p 100 >>.update.log

The program runs fine without the redirection and the information that should
be going to file appears in the command window.  Then when I apply the
redirection, the file is created, but nothing is in it.

I suspect that the %* when the ftype entry is made is sucking up all the
command line and the redirection is being ignored.

Am I correct, or does anyone have a solution (other than opening a file inside
of the script to place the output).

In UNIX I am redirecting STDOUT and STDERR to the file in a cron job.  I am
trying to port the unix scripts to NT, with some standardization to help the
support people.

Ruth

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


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

Date: 17 Nov 1998 14:47:31 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Oraperl
Message-Id: <72sjsj$e37$1@tholian.cse.psu.edu>

I've used the Oraperl emulation in DBI/DBD::Oracle under WinNT.
John
groenveld@acm.org


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

Date: 17 Nov 1998 14:54:22 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Oraperl
Message-Id: <72sk9e$e4f$1@tholian.cse.psu.edu>

I've used the Oraperl emulation in DBI/DBD::Oracle under WinNT. Built
out of the box. Its available as an ActiveState package for those w/o
a compiler.

BTW: comp.databases.oracle is defunct, ask your news admin to add
comp.databases.oracle.* 
John
groenveld@acm.org


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

Date: Tue, 17 Nov 1998 14:09:06 -0500
From: "Bryan M. Kramer" <kramer@techne.ca>
Subject: Problem compiling with perl compiler B
Message-Id: <3651C9D2.F4263F2D@techne.ca>

I'm trying out the experimental compiler that comes with perl 5.005.

I'm getting the message

No definition for sub Getopt::Long::GetOptions
No definition for sub Getopt::Long::GetOptions (unable to autoload)

when compiling as below:

% perlcc parse-error-line-count.pl

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

Compiling parse-error-line-count.pl:
--------------------------------------------------------------------------------

Making C(parse-error-line-count.pl.c) for parse-error-line-count.pl!
/local/perl/bin/perl -I/local/perl/lib/5.00502/sun4-solaris
-I/local/perl/lib/5.00502 -I/local/perl/lib/site_perl/5.005/sun4-solaris
-I/local/perl/lib/site_perl/5.005 -I.
-MO=CC,-oparse-error-line-count.pl.c parse-error-line-count.pl
parse-error-line-count.pl syntax OK
No definition for sub Getopt::Long::GetOptions
No definition for sub Getopt::Long::GetOptions (unable to autoload)


The script works fine when run directly with perl. Is this a show
stopper
bug in the compiler or is there a workaround I can use? I don't have
time
to change my scripts to use a different get options.

Thanks




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

Date: Mon, 16 Nov 1998 23:29:31 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: programing fun: tree: Map
Message-Id: <1dim04g.uqmz1r1pbtb93N@bay1-374.quincy.ziplink.net>

Xah <xah@best.com> wrote:

> Here's "this week's" programing problem on trees. The problem is
programing the "Map" function. Here's the spec:


Woops, guess I was wrong.  *Next week's* programming problem will be
getting Xah to wrap his posts at 72 characters.

-- 
 _ / '  _      /         - aka -         rjk@coos.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, 17 Nov 1998 19:45:45 +0000
From: Rob Hardy <rob.hardy@ndirect.co.uk>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: regexp query: s//g not global
Message-Id: <3651D269.FD4C01BE@ndirect.co.uk>

Thanks for the reply, Tom.  I guess it's not what I intended as it
doesn't work properly :)

Here's some sample data and what I'd hope would happen (using the &x
defined previously, which just happens to convert to lowercase atm):

TEST -> test
TES'T -> tes't
TST -> TST
'TEST -> 'test
"TEST -> "test
TEST' -> test'
TEST" -> test"
TE1ST ->TE1ST
TST' -> TST'
TST" -> TST"

> Ahhhhh, now I see what it does. (And I see that it may not be what you
> intended. Perhaps you wanted to use \1 in two places?

I see your point.. but, as you can see from my sample data, the
opening/closing quotes don't have to match on the other side of the
word.

> And is $b saying
> what you intended it to say?)

It didn't seem to be.  It was only matching ^.  So if I change it to
(?=\s+|$), and tweak the regexp, it now works to my liking:

     s{
       (^|\s+)           # start with these
       (['"]?)           # either quote mark (in memory 1)
       (?!               # what's next can't be:
         [^AEIOUaeiou]+  # one or more characters other than vowels
         ['"]?           # an optional quote mark of either kind
         $b              # and that stuff from $b again
       )
       (                 # match and remember (in memory 2)
         [a-zA-Z]        # any of these letters
         [a-zA-Z']*      # zero or more of these
         ['"]?           # either quote mark
       )
       $b                # and that stuff from $b again
     }{
         $1.$2.&x($3)
     }gex;

Further improvements I plan is an optional ( before or after the
optional quotes at the beginning.  Similarly, an optional ) before or
after the quotes at the end.  And to write &x, which'll need $1 and $2
passed to it too..

Once again, thanks.
Rob.


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

Date: 17 Nov 1998 21:06:14 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: Segmentation fault (coredump) ((was newbie - shell))
Message-Id: <72sog6$pps$2@msunews.cl.msu.edu>

In comp.lang.perl.misc Mark Hamlin <mark.c.hamlin@bt.com> wrote:
: here is an example :

: #!/usr/llocal/bin/perl

try using #!/usr/local/bin/perl

: use Shell qw(rcp ls cat);
: print ls;


: I get the 'Segmentation Fault (coredump)' message, whats going on?
I fixed the #! problem and it worked fine.



-- 
           Dan Nguyen            | There is only one happiness in
        nguyend7@msu.edu         |   life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 |                   -George Sand



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

Date: 13 Nov 1998 09:25:21 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Selena Sol's form_processor
Message-Id: <72gtu1$1e2$1@gellyfish.btinternet.com>

On Fri, 13 Nov 1998 08:39:03 GMT Bart Lateur <bart.mediamind@ping.be> wrote:
> Jonathan Stowe wrote:
> 
>># First tell Perl to bypass the buffer. ...
>>$! = 1;
> 
> I bet you ment
> 
> 	$| = 1;
> 
> That's a vertical bar, not a exclamation mark.
> 
> 	Bart.

I bet I meant to type $! what Selena meant to type is another thing altogether.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: Mon, 16 Nov 1998 23:29:34 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: substitute
Message-Id: <1dim0m8.v2p8rl14q7q00N@bay1-374.quincy.ziplink.net>

Todd Kempf <kempf.todd@student.uni-tuebingen.de> wrote:

> $vfn =~ s/\*\?\\\//%[A..F]/g;

$vfn =~ s!([*?/\\])! sprintf "%%%x", ord $1 !ge;

-- 
 _ / '  _      /         - aka -         rjk@coos.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: 17 Nov 1998 20:26:35 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: test for.t failure due to bad rounding
Message-Id: <72sm5r$f13$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Phoenix 
<rootbeer@teleport.com>],
who wrote in article <Pine.GSO.4.02A.9811170852420.27321-100000@user2.teleport.com>:
> Well, _if_ my test code was correct and the problem really is the
> stringification, I _think_ that's always done by your system's library
> routines. (Gconvert, gcvt, or sprintf, I believe.) I don't know as much as
> I'd like to know about Perl's internals. So, either those library routines
> are buggy, or Perl is calling them incorrectly, I think.

  > perl "-V:.*conv.*"
  d_Gconvert='gcvt((x),(n),(b))'
  d_locconv='define'

The first one is relevant.

Ilya


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

Date: Mon, 16 Nov 1998 23:29:36 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Wanted: Development Partner
Message-Id: <1dim0xa.1sbry875rwdshN@bay1-374.quincy.ziplink.net>

trri744@ibm.net <trri744@ibm.net> wrote:

> Wanted: Development Partner Perl -> Java/SQL/CORBA. 
> We are offering an unique business opportunity to jump into a joint
> venture online since 1996. Accidentially we lost the developer of
> 100+ well documented Perl5 scripts....

We left him here in our office while we went to get a cup of coffee, and
when we came back, he was gone!  We were only away for a few minutes...

Yes, we looked under the table and behind the server, but we still can't
find him!

-- 
 _ / '  _      /         - aka -         rjk@coos.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, 17 Nov 1998 21:55:56 +0100
From: Jimmer <jimmr@evolution.org>
To: Odin.Anderson@TDSTelecom.Com
Subject: Re: Win32::AdminMisc::UserSetMiscAttributes (Was Re: Win32 UserCreate )
Message-Id: <3651E2DC.A9023974@evolution.org>

Here is your original code:
Source:
use Win32::AdminMisc;
Win32::AdminMisc::UserSetMiscAttributes('', 'OdinTest789',
                USER_HOME_DIR_DRIVE, "i:",)||print "No Set!!!\n";
Win32::AdminMisc::UserGetMiscAttributes('', 'OdinTest789', \%hash) ||
die;
foreach $i (sort keys(%hash)){
  print "$i = ". $hash{$i} ."\n";
}

You need to change the "i:" from double quotes to single quotes like
this: 'i:'. Once you do this you will set the USER_HOME_DIR_DRIVE=i:.

Your code with the change:

use Win32::AdminMisc;
Win32::AdminMisc::UserSetMiscAttributes('', 'OdinTest789',
                USER_HOME_DIR_DRIVE, 'i:',)||print "No Set!!!\n";
Win32::AdminMisc::UserGetMiscAttributes('', 'OdinTest789', \%hash) ||
die;
foreach $i (sort keys(%hash)){
  print "$i = ". $hash{$i} ."\n";
}

Jimmer
jimmr@evolution.org





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

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


Administrivia:

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

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


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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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