[11921] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5521 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 29 18:07:25 1999

Date: Thu, 29 Apr 99 15:00:20 -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           Thu, 29 Apr 1999     Volume: 8 Number: 5521

Today's topics:
    Re: a complex associative array problem <rick.delaney@home.com>
    Re: An explanation of sort <jeromeo@atrieva.com>
    Re: An explanation of sort <rick.delaney@home.com>
        Beginner question regarding @INC <byeoh@panix.com>
    Re: Beginner question regarding @INC <byeoh@panix.com>
    Re: Call and exe program from perl <swarren@slip.net>
    Re: Call and exe program from perl <cassell@mail.cor.epa.gov>
    Re: Calling functions iteratively <rick.delaney@home.com>
    Re: Calling functions iteratively <vinger@ford.com>
    Re: Calling functions iteratively <rick.delaney@home.com>
    Re: cgi-html generated in different frame <gellyfish@gellyfish.com>
    Re: Example Server Code <gellyfish@gellyfish.com>
        expect cryptoman@my-dejanews.com
        Frontpage98 and ActivePerl <ready@SPAMFREE.globalnet.co.uk>
    Re: Help! - Trouble with CGI script written in Perl. <pizdobol@hotmail.com>
    Re: HELP! Atan2 conversion (Daniel S. Lewart)
    Re: How do i print something using perl? <swarren@slip.net>
        newbie q: compiling perl <dennis@rietvink.demon.nl>
    Re: Newsfeed and Local Weather <cassell@mail.cor.epa.gov>
        Passing Params <jim.ray@west.boeing.com>
    Re: perl and Relational Databases <jeff@vpservices.com>
    Re: perl and Relational Databases <gellyfish@gellyfish.com>
    Re: Problems with PerlIS <gellyfish@gellyfish.com>
        RegExp for the following string, w/o using split (Michael Shavel)
    Re: what's wrong with $x = $y or "" <swarren@slip.net>
    Re: What's wrong with this code? <rick.delaney@home.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 29 Apr 1999 21:58:52 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: a complex associative array problem
Message-Id: <3728D5BB.6C4A169@home.com>

[posted & mailed]

bing-du@tamu.edu wrote:
> 
> The print statements outside 'sample' only showed me the first level keys:
> It seemed the associative array was constructed and displayed inside the
> subroutine.  Just when it was passed out, something wrong happened.
> 
>             xxxx:
>             -----
>             xxx:
>             -----
> "-w" option did not show me any hints.

And what about 'use strict'?  You haven't stored anything in the hash in
your code so it's hard to know what's happening, but 'use strict refs'
might point out some problems.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Thu, 29 Apr 1999 14:06:48 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: An explanation of sort
Message-Id: <3728C9E8.5EFE17A1@atrieva.com>

Larry Rosler wrote:
> 

> This:
> 
>     @new = sort {
>       my ($aa, $bb) = ($a =~ /=(\d+)/, $b =~ /=(\d+)/);
>       $bb <=> $aa
>     } @old;
> 
> wouldn't be as silly and seems considerably more perspicuous. 

I'm well versed in silly, but how would I know if I'm being perspicous? 
Or, if I were being perspicious, what would I be?

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Thu, 29 Apr 1999 21:37:12 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: An explanation of sort
Message-Id: <3728D0A6.FA11976F@home.com>

[posted & mailed]

Jerome O'Neil wrote:
> 
> Larry Rosler wrote:
> >
> > wouldn't be as silly and seems considerably more perspicuous.
> 
> I'm well versed in silly, but how would I know if I'm being perspicous?
> Or, if I were being perspicious, what would I be?

Don't they have dictionaries in Seattle?  I'm not sure if there's a joke
in those misspellings or not.  I guess I'm not very perspicacious.  :-)

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Thu, 29 Apr 1999 17:03:30 -0400
From: Brian Yeoh <byeoh@panix.com>
Subject: Beginner question regarding @INC
Message-Id: <Pine.GSU.4.05.9904291653490.28747-100000@panix3.panix.com>

I'm having considerable trouble with the paths in @INC. I'm running in a
HP-UX environment with four servers, one of which I am attempting to
install Perl modules on. I'm getting an error message of form:

Can't locate %s in @INC (where %s is ExtUtils::MakeMaker, incidentally)

When I try to check the contents of @INC by using:

perl -e 'print "@INC\n"'

I receive output that looks like :

///////////////////////////////////usr/STAGE/lib///////////////// etc,

none of which are the paths I'm expecting to find. Could anyone tell me
how I can modify the default values of @INC? I've flipped through the
camel and tried undeffing @INC and assigning it new values like so:

undef @INC
@INC = {/usr/lib/, etc}

but the same output returns. I've also tried followig the use lib
suggestion, but if it can't find lib...

I would approach the server's admin, but he's out on vacation and his
boss/colleague doesn't know any Perl.

Could anyone offer me some advice? I'm still trying to catch up on all the
posts in comp.lang.perl.misc, but I've got about 2000 more to go, so I'd
very much appreciate it if you would please e-mail any suggestions. I
recognise that this is a breach of etiquette, but I do intend to make it
good.

Thanks in advance.

Brian "going absolutely spare here" Yeoh

Before moonlit nights
Sakura flower and fall.
I lie, beneath them.

-- 21/03/1999



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

Date: Thu, 29 Apr 1999 17:51:20 -0400
From: Brian Yeoh <byeoh@panix.com>
Subject: Re: Beginner question regarding @INC
Message-Id: <Pine.GSU.4.05.9904291748390.28747-100000@panix3.panix.com>

On Thu, 29 Apr 1999, Brian Yeoh wrote:

Ah _hah_. One shouldn't follow up to one's posts, but I've just found some
useful information. When I run the script 

perl -e 'print "@INC\n"'

as root, I get the paths I should be getting. However, I can't run the job
which needs to use Perl as root (long story).

So... I'm thinking that the reason may lie in my installation of Perl as
root. Should I chmod/chown the directory where Perl resides? Does anyone
have any suggestions?

> I'm having considerable trouble with the paths in @INC. I'm running in a
> HP-UX environment with four servers, one of which I am attempting to
> install Perl modules on. I'm getting an error message of form:
> 
> Can't locate %s in @INC (where %s is ExtUtils::MakeMaker, incidentally)
> 
> When I try to check the contents of @INC by using:
> 
> perl -e 'print "@INC\n"'
> 
> I receive output that looks like :
> 
> ///////////////////////////////////usr/STAGE/lib///////////////// etc,
> 
> none of which are the paths I'm expecting to find. Could anyone tell me
> how I can modify the default values of @INC? I've flipped through the
> camel and tried undeffing @INC and assigning it new values like so:
> 
> undef @INC
> @INC = {/usr/lib/, etc}
> 
> but the same output returns. I've also tried followig the use lib
> suggestion, but if it can't find lib...
> 
> I would approach the server's admin, but he's out on vacation and his
> boss/colleague doesn't know any Perl.
> 
> Could anyone offer me some advice? I'm still trying to catch up on all the
> posts in comp.lang.perl.misc, but I've got about 2000 more to go, so I'd
> very much appreciate it if you would please e-mail any suggestions. I
> recognise that this is a breach of etiquette, but I do intend to make it
> good.
> 
> Thanks in advance.
> 
> Brian "going absolutely spare here" Yeoh
> 
> Before moonlit nights
> Sakura flower and fall.
> I lie, beneath them.
> 
> -- 21/03/1999
> 
> 
> 



Before moonlit nights
Sakura flower and fall.
I lie, beneath them.

-- 21/03/1999



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

Date: Thu, 29 Apr 1999 21:15:18 GMT
From: "Stephen Warren" <swarren@slip.net>
Subject: Re: Call and exe program from perl
Message-Id: <GZ3W2.4579$gv5.2723@news.rdc1.sfba.home.com>

Call and exe program from perl#VIKRAM BALKRISHNAN NATARAJAN#
<U903506@ntu.edu.sg> wrote in message
news:D0BE198B1C7ED111AD1808002BA613F80CEFE5E1@mail1.ntu.edu.sg...
>   Anyone knows how to cause perl to execute and exe program say
>in c:\vikram ???
>  I tried
>   chdir "c:\vikram";
>   exec "file.exe"
>  but it does not work...

 . (current directory) is not always in the $PATH. (or $ENV{"PATH"}). Doing
chdir() doesn't help you unless it is.

So, you can either arrange for . to be in the PATH (ick) or use the fully
qualified file name (as in another response)

That said, you mean:

chdir "c:\\vikram"

or what you're actually chdir()ing to is c:vikram, which is probably an
invalid path using "|| die" will help you trap this.





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

Date: Thu, 29 Apr 1999 14:46:04 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Call and exe program from perl
Message-Id: <3728D31C.174F7041@mail.cor.epa.gov>

Stephen Warren wrote:
> 
> Call and exe program from perl#VIKRAM BALKRISHNAN NATARAJAN#
> <U903506@ntu.edu.sg> wrote in message
> news:D0BE198B1C7ED111AD1808002BA613F80CEFE5E1@mail1.ntu.edu.sg...
> >   Anyone knows how to cause perl to execute and exe program say
> >in c:\vikram ???
> >  I tried
> >   chdir "c:\vikram";
> >   exec "file.exe"
> >  but it does not work...
> 
> . (current directory) is not always in the $PATH. (or $ENV{"PATH"}). Doing
> chdir() doesn't help you unless it is.
> 
> So, you can either arrange for . to be in the PATH (ick) or use the fully
> qualified file name (as in another response)
> 
> That said, you mean:
> 
> chdir "c:\\vikram"
> 
> or what you're actually chdir()ing to is c:vikram, which is probably an
> invalid path using "|| die" will help you trap this.

No, in win32 Perl [at least ActiveState Perl] handles this gracefully.
You (in general) only have to worry about the / vs \ vs \\ problem
when you actually hand something off to the DOS shell.  And even
then there are fiddles.

But there is another point.  `exec' may *not* be what the poster wants.
exec will run the program while causing Perl to terminate.  If the 
poster is trying this in a CGI script, it won't work.  Period.  At
least, I hope not.  PerlScript and Perl for (ISAPI|WebSite) and some
others share a process space with the webserver et al.  A real exec
would kill the webserver.  Oops...

David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


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

Date: Thu, 29 Apr 1999 21:05:39 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Calling functions iteratively
Message-Id: <3728C93C.5A53E157@home.com>

[posted & mailed]

Slav Inger wrote:
> 
> I have a special situation where I'm forced to call functions from
                                       ^^^^^^
> within an array that stores the function names and parameters, like
> this:
> 
> @subs = ('test1("a")', 'test2("b")');

I hope you're not really being *forced* to do it this way.

> foreach(@subs) {
>     &$_;        #call test1("a") and test2("b")
> }

As you know, this doesn't work but you're on the right track.  If you
change it so that you are storing coderefs then all you're missing are
the arguments.

You could store a reference to each subroutine along with its arguments
in an array.  Then store references to each array in your main @subs
array.  This is commonly called a list of lists which you can read about
in the perllol manpage.

Here's code that does what you describe.

#!/usr/local/bin/perl -w 

use strict;

my ($coderef1, $coderef2) = \(&test1, &test2);
my @subs = ([$coderef1, "a", "b"], [$coderef2, "b"]);

foreach (@subs) {
    $_->[0]->(@{$_}[1 .. $#$_]);
}

sub test1 {
    print "test1: @_\n";
}

sub test2 {
    print "test2: @_\n";
}

The line that's calling the subroutines is

    $_->[0]->(@{$_}[1 .. $#$_]);

This is calling the subroutine referenced by the first element of the
array with the arguments stored in the rest of the array.  If this looks
a little hard to read, it can always be broken out into more statements.
And we don't have to use the -> notation.
 
foreach my $cmd (@subs) {
    my $func = $$cmd[0];
    my @args = @$cmd[1 .. $#$cmd];
    &$func(@args);
}

Since you have the panther book you can read about references in the
first chapter.  But start with the excellent documentation that comes
with perl first.

perldoc perlref

If you're stuck with the storage you describe then a simple

    foreach (@subs) {
        eval $_;
    }

will do but will be much slower.

perldoc -f eval

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Thu, 29 Apr 1999 17:02:50 -0400
From: Slav Inger <vinger@ford.com>
Subject: Re: Calling functions iteratively
Message-Id: <3728C8FA.63B33FA6@ford.com>

Slav Inger wrote:

> Hello,
>
> I have a special situation where I'm forced to call functions from
> within an array that stores the function names and parameters, like
> this:
>
> @subs = ('test1("a")', 'test2("b")');
>
> foreach(@subs) {
>     &$_;        #call test1("a") and test2("b")
> }
>
> sub test1 {
> ...
> }
>
> sub test2 {
> ...
> }
>
> The above doesn't work (complains that &main::test1("a") is undefined),
> and I didn't think it would work, but I'm wondering about the correct
> way to do this.  I looked in Advanced Perl book and man perlsub, but it
> didn't mention anything resembling this.
>

I found that eval $_ seems to work in this case.  Maybe this would be of
help to others who may run into this problem.

- Slav Inger.
- vinger@ford.com





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

Date: Thu, 29 Apr 1999 21:19:54 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Calling functions iteratively
Message-Id: <3728CC99.8118BC47@home.com>

[posted & mailed]

Slav Inger wrote:
> 
> I found that eval $_ seems to work in this case.  Maybe this would be 
> of help to others who may run into this problem.

Maybe, but don't forget how slow eval can be (see my other post). 
Here's some proof:

#!/usr/local/bin/perl -w 

use strict;
use Benchmark;

my @refs  = ([\&test1, "a", "b"], [\&test2, "b"]);
my @evals = ('test1("a", "b")', 'test2("b")');

timethese 10000, {
    Ref  => sub { $_->[0]->(@{$_}[1 .. $#$_]) foreach @refs },
    Eval => sub { eval $_                     foreach @evals },
};    

sub test1 { my $x = "test1: @_\n" }
sub test2 { my $x = "test2: @_\n" }

__END__
Benchmark: timing 10000 iterations of Eval, Ref...
      Eval: 11 wallclock secs (10.21 usr +  0.00 sys = 10.21 CPU)
       Ref:  1 wallclock secs ( 1.16 usr +  0.00 sys =  1.16 CPU)

-- 
Rick Delaney
rick.delaney@home.com


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

Date: 29 Apr 1999 20:18:48 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: cgi-html generated in different frame
Message-Id: <7gaer8$lb$1@gellyfish.btinternet.com>

On Thu, 29 Apr 1999 12:20:14 -0400 Eddy Viscous wrote:
> Hello all,
> This may be an easy one...maybe not.  I have a script that searches a
> database and returns results.  I want these result to appear in a different
> frame than the one that the script's form is in.  Can this be done?  If so
> how.
> 

This is a FAQ.  Unfortunately not for this group:

<http://www.webthing.com/tutorials/cgifaq.html>

That group is comp.infosytems.www.authoring.cgi

If you are using the module CGI.pm (as recommended by 9 out of 10 Perl
breeders) then there is a section in the documentation for that module
entitled:

   WORKING WITH NETSCAPE FRAMES

Oh you are using Perl arent you ?

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


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

Date: 29 Apr 1999 22:06:23 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Example Server Code
Message-Id: <7gal4v$u6$1@gellyfish.btinternet.com>

On Thu, 29 Apr 1999 15:39:30 -0400 Steve Crump wrote:
> Can someone send me an example of a perl 5 script that uses the
> IO:Socket
> module to:
> 
> Wait for a network connection on a specified port.
> Read a line of input from the port.
> Print a line to the port.
> Close the connection.
> 
> I have found some examples of servers written in perl 4 but
> I would like to know how to do it with the IO:Socket modules.
> 

A quick example:

#!/usr/bin/perl -w

use strict;

use IO::Socket;

my $server = IO::Socket::INET->new ( LocalPort => 1112,
                                     Type      => SOCK_STREAM,
                                     Reuse     => 1,
                                     Listen    => SOMAXCONN )
                                || die "Couldnt open socket $@\n";

{
my $client = $server->accept();
   select $client;
   $| = 1;
   my $blah = <$client>;
   print "Yeah go it\n";
}


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


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

Date: Thu, 29 Apr 1999 20:52:42 GMT
From: cryptoman@my-dejanews.com
Subject: expect
Message-Id: <7gagqo$5mc$1@nnrp1.dejanews.com>

Hi,

I heard about module EXPECT. I would like to use it but I don't know very well
what it can do. Can you tell me where I can get documentation before I install
it machine?

Thank you!

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


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

Date: Thu, 29 Apr 1999 22:35:26 +0100
From: "Ready" <ready@SPAMFREE.globalnet.co.uk>
Subject: Frontpage98 and ActivePerl
Message-Id: <7gaj07$7lb$1@gxsn.com>

I'm having real difficulties getting the FrontPage98 web server to run perl
scripts, on Windows95.  Can anyone help?

The Perl installation itself works fine; I can run Perl scripts from the
MSDOS command line and from Windows explorer.  I've also followed the
instructions re: setting the registry key (as found in the ActivePerl HTML
guide and also
http://support.microsoft.com/support/kb/articles/q150/6/29.asp?FR=0)

However, when I try and hyperlink to "test.pl" (content as per the link
above), I still get the:

"500 Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.
Please contact the server administrator, [no address given] and inform them
of the time the error occurred, and anything you might have done that may
have caused the error."

Any help would be very much appreciated.

Thanks

Andy





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

Date: Thu, 29 Apr 1999 16:39:47 -0400
From: "Pizdobol" <pizdobol@hotmail.com>
Subject: Re: Help! - Trouble with CGI script written in Perl.
Message-Id: <3728c86a.0@lightning.ica.net>


David Cassell <cassell@mail.cor.epa.gov> wrote in message
news:3727A764.8F60B341@mail.cor.epa.gov...
>
> It is really pretty rude to dump this amount of trafe on us and expect
> someone to solve all your problems for free.  And I doubt you can
> afford the consulting fees.
Sorry about that.

> What works?  What doesn't work?  What OS is it on?  Server?  What
> version of Perl?  Are there error messages?  What's in the error
> log?  Why isn't this using CGI.pm?  Does this work from the command
> line?  Does a test script work on your server?
The server is running Apache/1.3.4 (Unix) FrontPage/3.0.4.2 PHP/3.0.7 on
Linux, has perl5.004 , and i have a virtual hosting account on that box.
I don't even have access to the error log. As i try to run the script, it
gives me the 500 error. All my other scripts work fine.







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

Date: 29 Apr 1999 21:10:23 GMT
From: d-lewart@uiuc.edu (Daniel S. Lewart)
Subject: Re: HELP! Atan2 conversion
Message-Id: <7gahrv$8d3$1@vixen.cso.uiuc.edu>

arbiggs@my-dejanews.com writes:

> I'm converting some code to PERL from another language which uses the atan
> (arctangent) function. I cannot find an equivalent function in PERL, only
> Atan2, which takes two arguments. The difference seems simple, atan takes a
> ratio of two sides of a triangle and atan2 (apparently) takes the two sides
> and does the ratio. However my attempts so far have failed miserably. Does
> anyone know the equivalent PERL for the code below?
>     RadDist = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)

Please s/PERL/Perl/g;

Either this:
	$RadDist = atan2(sqrt(1-$X*$X), $X);
or this:
	use POSIX;
	$RadDist = acos($X);
or this:
	use Math::Trig;
	$RadDist = acos($X);

Daniel Lewart
d-lewart@uiuc.edu


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

Date: Thu, 29 Apr 1999 21:24:37 GMT
From: "Stephen Warren" <swarren@slip.net>
Subject: Re: How do i print something using perl?
Message-Id: <p64W2.4580$gv5.2758@news.rdc1.sfba.home.com>

Philip 'Yes, that's my address' Newton <nospam.newton@gmx.net> wrote in
message news:37282AAE.84310596@gmx.net...
> Stephen Warren wrote:
> >
> > Philip Newton <nospam.newton@gmx.net> wrote in
> > message news:3726D0B9.EF843CF@gmx.net...
> > >
> > > [1] reminds me of the Joyce (aka PCW8512)
> >
> > Aha! So *that's* what the J is for...
>
> Supposedly, the computer was named after Mr. Amstrad's secretary. Or
> something like that. Don't tell me you had one of those things, too?

Well, I had a CPC, but I also did some programming work for my "high-school"
on a PCW...





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

Date: Thu, 29 Apr 1999 23:55:38 +0200
From: "Dennis" <dennis@rietvink.demon.nl>
Subject: newbie q: compiling perl
Message-Id: <925422926.19935.0.rover.d4ee2fcf@news.demon.nl>

Its a couple of weeks ago since i started to use perl. (should have done
that years ago!!)

I cannot figure out how to compile my scripts. Already downloaded
EGCS-1.1.2, but i am not familier with this kind of compiling ( I'm a
spoiled VB GUI kid).
Can anyone please give my a hint.

I am running perl 5.005 on a Windows NT.

Thanx,

Dennis




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

Date: Thu, 29 Apr 1999 14:57:17 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Newsfeed and Local Weather
Message-Id: <3728D5BD.D93A17AB@mail.cor.epa.gov>

Skyward Internet Technology wrote:
> 
> Hello Everybody,
> 
> Does anybody know of any Perl scripts available that go out to the Weather
> Channel and grab their local forecast?  I've seen this done with a Cold
> Fusion application and just wondered if anybody had a Perl script to do the
> same.

Funny you should mention it.  The latest issue of The Perl Journal
has a 10-line Perl program to out to intellicast.com, snarf down
the forecast for any given city code, parse out the non-essentials,
and present the formatted, text-wrapped output.  And some of those
10 lines could have been squashed together if the authors hadn't
wanted to keep the code clean and efficient.

Cold fusion?  Isn't that some weird physics blunder by two guys in Utah?

HTH,
David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


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

Date: Thu, 29 Apr 1999 20:47:54 GMT
From: "news.boeing.com" <jim.ray@west.boeing.com>
Subject: Passing Params
Message-Id: <FAyxr4.n2M@news.boeing.com>

I am migrating my UNIX perl scripts over to NT. So far it has not beena big
deal.  The problem is how NT perl handles Parms.

I have a code the goes something like this.   passme.cgi?ME

In UNIX using the $ARGV[0] store the value "ME".  In NT $ARGV[0] never gets
passed.  What is the command in Active Perl 5 that works the same?

Thank you.

--
Jim Ray
Delta Program NT Administrator
The Boeing Company
714-896-2038
jim.ray@west.boeing.com




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

Date: Thu, 29 Apr 1999 13:32:50 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: perl and Relational Databases
Message-Id: <3728C1F2.FD86BC03@vpservices.com>

wax_man@my-dejanews.com wrote:
> 
> Is there a way to use Perl to connect to a Relational Database?  

Yes, definitely, see:  http://www.symbolstone.org/technology/perl/DBI/

> I am using Informix RDMS

The page includes references to DBD::Informix and to drivers for over a
dozen other RDBMSs.

> I have found numerous articles on Database connectivity with Perl - but they
> all reference flat file databases.

Hmm, curious, a simple search of www.perl.com or CPAN for the word
"database" shows numerous references to Informix, Oracle, and other
relational databases and just typing "perlodc -q database" would show
you the perfaq #8 section which points you to the same page I have under
the heading "How do I use an SQL database?".

-- 
Jeff


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

Date: 29 Apr 1999 21:49:19 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl and Relational Databases
Message-Id: <7gak4v$re$1@gellyfish.btinternet.com>

On Thu, 29 Apr 1999 19:14:06 GMT wax_man@my-dejanews.com wrote:
> Is there a way to use Perl to connect to a Relational Database?  I am using
> Informix RDMS and would like to use Perl/cgi to add data directly to a table.
> 

Perl can interface with a variety of RDBMS via its DBI module.  Specifically
you will need to use DBD::Informix which is available from CPAN.

In the case of Informix you will need to obtain the Client SDK (which is
now a free download for most platforms ) in order to build the module. 

The DBI/DBD modules are fairly well documented so that should give you a
start. 

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


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

Date: 29 Apr 1999 20:47:33 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Problems with PerlIS
Message-Id: <7gagh5$lf$1@gellyfish.btinternet.com>

On Thu, 29 Apr 1999 03:15:28 +0200 Thomas Ellingsen wrote:
> hI,
> 
> when I install PerlIS in the same folder as Perl for win32 I always get
> the same message, couldn't find perl.exe eventhough it's there. Does
> anyone know what this means? 

It means that you are installing the wrong version of Perl - the latest
versions of ActivePerl dont require you to install PerlIS seperately.

>                                And do you know if PerlIS works with
> Personal Webserver by MS?
> 

No.  But that is not a Perl question. It is a server matter.

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


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

Date: Thu, 29 Apr 1999 17:38:29 -0400
From: mshavel@erols.com (Michael Shavel)
Subject: RegExp for the following string, w/o using split
Message-Id: <mshavel-2904991738290001@130.9.16.207>


Hi

I have a string that looks like this:

" 4","123456","19990423","","","","","This is the text field","","",""


I need to always parse what is between the first and second comma, so in
this case I want to get 123456 into a variable. I've tried various regular
expressions but can't seem to get it right. I know I could do this using
split but I was trying not to because I have about 250,000 lines like this
in each file that I have to parse.  I thought the overhead of a split
would be too great. Any suggestions please...

Thanks very much

Mike Shavel
mshavel@erols.com


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

Date: Thu, 29 Apr 1999 21:35:29 GMT
From: "Stephen Warren" <swarren@slip.net>
Subject: Re: what's wrong with $x = $y or ""
Message-Id: <Bg4W2.4583$gv5.2711@news.rdc1.sfba.home.com>

Philip 'Yes, that's my address' Newton <nospam.newton@gmx.net> wrote in
message news:37283552.87610075@gmx.net...
> Abigail wrote:
> >
> > Philip Newton (nospam.newton@gmx.net) wrote on MMLXVI
> > September MCMXCIII in <URL:news:3726E92B.F259BE35@gmx.net>:
> > // Abigail wrote:
> > // >
> > // > Now if only we had the ?? operator....
> > //
> > // What would this operator do? Logical ?: or something?
> >
> > EXPR1 ?? EXPR2 would be EXPR1 if EXPR1 is defined, EXPR2 otherwise.
>
> That would appear to be a useful addition. But as Bart points out, it
> probably couldn't be called ??.

Well, it's already ?: in C, if you use gcc-specific extensions.

Assuming that NULL in C is undef in Perl, then:

{
   char *a ;
   char *b = something ;
   a = a ?: b ; // Same as "a = a ? a : b" assuming NULL is false
}

a gets assigned with a (if non-null) else b.

Quite useful at times.

Perhaps we could even have:

a ?:= b ; // a = b if undef b





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

Date: Thu, 29 Apr 1999 21:30:37 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: What's wrong with this code?
Message-Id: <3728CF1C.6058EF88@home.com>

[posted & mailed]

tfinn wrote:
> 
> Hi
> 
> Having a bit of a problem trying to work out what's wrong with this.
> Does anyone know?
> 
> ######################################################################
> #!/usr/local/bin/perl

You're missing -w on the end of that line.  You're missing 'use strict'
on the next line.  

I'll stop there since that's often enough to help one find one's own
mistakes.  If not then you might want to be a bit more specific in your
question.  Good things to include:

1.  What your code is supposed to do.
2.  What your code does.
3.  Which part of the discrepancy between 1 and 2 you don't understand.

-- 
Rick Delaney
rick.delaney@home.com


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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