[12827] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 237 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 23 16:07:28 1999

Date: Fri, 23 Jul 1999 13:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 23 Jul 1999     Volume: 9 Number: 237

Today's topics:
    Re: ****Perl tutorials!!!!**** <toby@venice.cas.utk.edu>
        CGI:New window opens w/ NN, not w/ IE <richardyavorsky@my-deja.com>
    Re: CGI:New window opens w/ NN, not w/ IE <daniel.vesma@thewebtree.com>
        Compiling Perl/Dynaloader on AIX prob. amackay11@my-deja.com
    Re: duplicating double quotes in text (Larry Rosler)
    Re: fetching zip files velo1@earthlink.net
        file manipulation <dan@fearsome.net>
    Re: Geekspeak Programming Contest <kejoki@netdoor.com>
        glob problem <northsky@ix.netcom.com>
    Re: glob problem (Anno Siegel)
        glob spawning problem <northsky@ix.netcom.com>
    Re: How to give Passwords on STDIN <toby@venice.cas.utk.edu>
    Re: How to give Passwords on STDIN (Marc Haber)
    Re: How to give Passwords on STDIN <tchrist@mox.perl.com>
    Re: How to give Passwords on STDIN (I R A Darth Aggie)
        How to read a .xls file in UNIX <msingla@ford.com>
    Re: HTML on NT; how do I add docs? (Jan Dubois)
        http_referer problems <georgec@webleicester.co.uk>
    Re: http_referer problems (brian d foy)
    Re: http_referer problems <mdz4c@node3.unix.Virginia.EDU>
    Re: http_referer problems (I R A Darth Aggie)
        mail::pop3client problems <jgc5a@j2.mail.virginia.edu>
        Need help with a ^M/newline issue <bob.freedman@eis.noaa.gov>
    Re: Need help with a ^M/newline issue (Garth Sainio)
    Re: no such file when executing perl script <fncll@uaf.edu>
        oops <georgec@webleicester.co.uk>
        Perl on NT to Oracle on Unix <anthonyk@insicorp.com>
    Re: Perl with MSQL (brian d foy)
    Re: Perl with MSQL (Layout/Design)
    Re: pipe "|" functionality: ksh can easily do, perl can (Michael Wang)
    Re: Q - Mapping to complex, nested data structures? dwolfe5272@my-deja.com
    Re: Q - Mapping to complex, nested data structures? (Anno Siegel)
    Re: Regex-ing <jacklam@math.uio.no>
    Re: Regex-ing (Michael Rubenstein)
    Re: Speeding up Perl (Jason Stapels)
    Re: Speeding up Perl (brian d foy)
        strict vars and local <q2ir@unb.ca>
    Re: strict vars and local (brian d foy)
        Submitting Photos (Trevor Milley)
    Re: Timed prompt <jsolomon@stanford.edu>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Fri, 23 Jul 1999 14:55:24 -0400
From: toby <toby@venice.cas.utk.edu>
Subject: Re: ****Perl tutorials!!!!****
Message-Id: <3798BA9C.4B2C89C7@venice.cas.utk.edu>

> this is typical behaviour for Navigator .. I like to think of IE (here it
> comes .. the whole reason for this post *8^) as the Perl of web browsers
> .. because irrespective of the input - it always tries to do something
>
> flame suit on .. goggles down .. Bill's cheque in my pocket .. and ..
> exit - stage left
>
> --
>  jason - remove all hyphens for email reply -

Egads! Now would you test with IE or Navigator given that 'it always tries to
do something.' I had a student in my office trying to put frames on his web
site. (I know, I know). IE5.0 spit it out beautifully. Navigator 4.61 showed
the <noframes> code. Why? Because the <noframes> code was placed above the
<frameset> in the code. Maybe IE was doing the right thing and respecting the
instructions given it, but Netscape was playing by the rules. Browsers read
the file from the top down (this is open to debate). Would you want Perl to
just go through code and give you something irregardless or would you want to
have fail with a nice error or warning to debug from?. According to
BrowserWatch(by no means authoritative), about 40% of people use Netscape.
That's a chunk of users.

Toby 'where's -w for my browser' Applegate



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

Date: Fri, 23 Jul 1999 12:48:05 -0700
From: Rich Yavorsky <richardyavorsky@my-deja.com>
Subject: CGI:New window opens w/ NN, not w/ IE
Message-Id: <3798C6F4.4C15F4C4@my-deja.com>

Hello.

Simply, I have a Perl CGI script that, when done executing after being
called, ends with the following:

	print "Status: 302 Moved Temporarily\n";
	print "Location: " . $url . "\n";
	print "Window-Target: NewWindow\n\n";

This code opens $url in a new browser window.  This works like a dream
for NN browsers.  For MSIE, however, $url is opened in the same window
that it was called.

	1) Why doesn't this work for MSIE, and 
	2) What do I need to return to the MSIE-using client such that $url
opens in a new window?

Thanks in advance,
Rich Yavorsky


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

Date: Fri, 23 Jul 1999 20:20:08 +0100
From: "Daniel Vesma" <daniel.vesma@thewebtree.com>
Subject: Re: CGI:New window opens w/ NN, not w/ IE
Message-Id: <7nafi0$bdv$1@gxsn.com>

Why don't you just set the form's action to open a new window rather than
doing it from within the script?

<FORM ACTION="blah" TARGET="_top"></FORM>

Daniel Vesma
http://www.thewebtree.com
http://www.thewebtree.com/daniel-vesma




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

Date: Fri, 23 Jul 1999 17:43:33 GMT
From: amackay11@my-deja.com
Subject: Compiling Perl/Dynaloader on AIX prob.
Message-Id: <7na9k3$raa$1@nnrp1.deja.com>

When I install Perl on AIX 4.3, I get

make
 ....
AutoSplitting perl library
Making DynaLoader (static)
The Unsupported function umask function is unimplemented at
 ../../lib/ExtUtils/Install.pm line 247.
 make: The error code from the last command is 2.

Help Please!!

Andrew Mackay



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Fri, 23 Jul 1999 10:42:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: duplicating double quotes in text
Message-Id: <MPG.120249666f721b8a989d29@nntp.hpl.hp.com>

In article <7nb6is$g7411@news.cyber.net.pk> on Fri, 23 Jul 1999 20:54:45 
+0500, Faisal Nasim <swiftkid@bigfoot.com> says...
> : What is the easiest way to double quotes in strings.
> : For example, change:
> : Photo is 5" x 7"
> :
> : to:
> :
> : Photo is 5"" x 7""
> 
> $photo = 'Photo is 5" x 7"';
> 
> $photo = q(Photo is 5" x 7");
> 
> $photo = qq(Photo is 5" x 7");

None of those looks like what is requested -- to 'double' existing 
quotes in strings (not to put double-quotes in strings).

> : Eventually, I want to put quotes and a comma around the whole thing to
> : get:
> :
> : "Photo is 5"" x 7""",
> 
> 'Photo is 5" x 7"' ,

The relevance of any of these answers to the questions asked escapes me.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 23 Jul 1999 17:16:20 GMT
From: velo1@earthlink.net
Subject: Re: fetching zip files
Message-Id: <3798a32c.149170982@news.giganews.com>

On Fri, 23 Jul 1999 20:40:36 +0500, "Faisal Nasim"
<swiftkid@bigfoot.com> wrote:

>
><snip>
>
>: #$file = $ARGV[0];
>: #print "Content-length: ",(stat("registered/$file"))[7],"\n";
>: #print "Content-type: application/x-zip-compressed\n\n";
>: #print `cat registered/$file`;
>
>'cat' doesn't read binary data... i guess.
>
>binmode STDOUT;
>
>open BLAH , 'registered/$file';
>binmode BLAH;
>print <BLAH>
>close BLAH;
>
><snip>
>
>
Forgive me please but what should the BLAH's be ?


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

Date: Fri, 23 Jul 1999 19:29:35 +0100
From: "Dan Adams" <dan@fearsome.net>
Subject: file manipulation
Message-Id: <932754508.24302.0.nnrp-02.c2deb1c5@news.demon.co.uk>

Hi,

Following a number of posts to this group, not a single person has been
willing and able to help me out to the required extent with some code that I
am stumbling over. Since no-one is willing to help me for free, can I induce
anyone to help me by offering payment? I only need about 10 lines or so of
code that I am stuck on, but no-one seems willing to help me fix the
problem.

Dan Adams
dan@fearsome.net




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

Date: Fri, 23 Jul 1999 13:09:11 -0500
From: Kevin Kinnell <kejoki@netdoor.com>
Subject: Re: Geekspeak Programming Contest
Message-Id: <3798AFC7.620DCF8F@netdoor.com>

Tom Christiansen wrote:
> 
> Here's a translation table to help techie programmer types talk with
> consumerist user types, and vice versa ....
[snip] 
> Your mission, should you choose to accept it, is to write a translator
> program than converts from one lingo to the other, or vice versa.
> Extra points will be given for having an especially amusing word list
> (you don't have to use mine), for handling plurals and capitals well,
> and in general, for hackish clevernesses.  The program should work for
> translating between other domains as well, such as East Coast vs West
> Coast jargon, programmer vs manager, etc.
> 
> --tom

Hmmmm....  Interesting challenge....  Looks like fun. 'B)>

Oh, one more for a general list (maybe we should start a geekspeak
file?)

Jan 1, 2001 = Jan 1, 2000

Kevin Kinnell
kejoki@netdoor.com


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

Date: Thu, 22 Jul 1999 20:50:23 -0400
From: Ewan Dunbar <northsky@ix.netcom.com>
Subject: glob problem
Message-Id: <932691097.245655889@nntp.netcom.ca>

Whenever I try to use glob, it fails, saying that the child exited with status
126. What child? What's glob spawning? And why's it failing?

--
------------------------------------------------
Ewan Dunbar               northsky@ix.netcom.com
------------------------------------------------
Visit Preston Manning: Action Hero at
http://earl.thedunbars.com/pmah/index.html
------------------------------------------------



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

Date: 23 Jul 1999 19:42:15 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: glob problem
Message-Id: <7nagin$1j9$1@lublin.zrz.tu-berlin.de>

Ewan Dunbar  <northsky@ix.netcom.com> wrote in comp.lang.perl.misc:
>Whenever I try to use glob, it fails, saying that the child exited with status
>126. What child? What's glob spawning? And why's it failing?

See perldoc perlop, in particular the section about I/O operators.
The relevant part is:

           while (<*.c>) {
               chmod 0644, $_;
           }

       is equivalent to

           open(FOO, "echo *.c | tr -s ' \t\r\f' '\\012\\012\\012\\012'|");
           while (<FOO>) {
               chop;
               chmod 0644, $_;
           }

       In fact, it's currently implemented that way.  (Which

Anno


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

Date: Fri, 23 Jul 1999 11:32:44 -0400
From: Ewan Dunbar <northsky@ix.netcom.com>
Subject: glob spawning problem
Message-Id: <932744150.56616142@nntp.netcom.ca>

Every time I try to use glob, it says glob failed (child exited with status
126). Am I missing something? What child process is glob spawning? And why
won't it work for me?

--
------------------------------------------------
Ewan Dunbar               northsky@ix.netcom.com
------------------------------------------------
Visit Preston Manning: Action Hero at
http://earl.thedunbars.com/pmah/index.html
------------------------------------------------



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

Date: Fri, 23 Jul 1999 13:01:33 -0400
From: toby <toby@venice.cas.utk.edu>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to give Passwords on STDIN
Message-Id: <37989FED.EBACF635@venice.cas.utk.edu>

The Horned Tome of Perl Knowledge (the Ram book) sayd change the install rule in
Makefile.PL. Since I have read it, though not thoroughly enough it seems, I
should've known that. Thank you for smacking me with the wet fish of enlightenment.

Toby


Tom Christiansen wrote:

>      [courtesy cc of this posting mailed to cited author]
>
> In comp.lang.perl.misc,
>     tapplega@utk.edu writes:
> :He may have a irritable cuss  sysadmin who won't install any modules outside of
> :the standard distribution.
>
> Not relevant.  He can always install his own modules.
>
> --tom



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

Date: Fri, 23 Jul 1999 17:30:01 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: Re: How to give Passwords on STDIN
Message-Id: <7na8qp$h6r$1@news.rz.uni-karlsruhe.de>

Tom Christiansen <tchrist@mox.perl.com> wrote:
>     [courtesy cc of this posting mailed to cited author]
>In comp.lang.perl.misc, 
>    tapplega@utk.edu writes:
>:He may have a irritable cuss  sysadmin who won't install any modules outside of
>:the standard distribution.
>
>Not relevant.  He can always install his own modules.

What if his program run on a variety of systems and he doesn't want to
have to install Readkey.pm on all of them?

Greetings
Marc

-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber          |   " Questions are the         | Mailadresse im Header
Karlsruhe, Germany  |     Beginning of Wisdom "     | Fon: *49 721 966 32 15
Nordisch by Nature  | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29


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

Date: 23 Jul 1999 11:34:41 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to give Passwords on STDIN
Message-Id: <3798a7b1@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Marc.Haber-usenet@gmx.de (Marc Haber) writes:
:What if his program run on a variety of systems and he doesn't want to
:have to install Readkey.pm on all of them?

That he can do what the perlfunc manpage tells him to do.

--tom
-- 
There ain't nothin' in this world that's worth being a snot over.
	    --Larry Wall in <1992Aug19.041614.6963@netlabs.com>


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

Date: 23 Jul 1999 17:38:52 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: How to give Passwords on STDIN
Message-Id: <slrn7pha9i.2r3.fl_aggie@thepentagon.com>

On Fri, 23 Jul 1999 17:30:01 GMT, Marc Haber <Marc.Haber-usenet@gmx.de>, in
<7na8qp$h6r$1@news.rz.uni-karlsruhe.de> wrote:
+ Tom Christiansen <tchrist@mox.perl.com> wrote:

+ >:He may have a irritable cuss  sysadmin who won't install any 
+ >:modules outside of the standard distribution.

+ >Not relevant.  He can always install his own modules.

+ What if his program run on a variety of systems and he doesn't want to
+ have to install Readkey.pm on all of them?

Not relevant. If Readkey isn't part of the standard distribution, then
it's going to have to be installed on every system by *someone*.

If he's really ambitious, he can download Readkey and rip out the
relevant code segments and insert them into his code base. I haven't
looked at Readkey, so I have no idea how do-able that is.

James


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

Date: Fri, 23 Jul 1999 15:44:20 -0400
From: "Manmohan Singla" <msingla@ford.com>
Subject: How to read a .xls file in UNIX
Message-Id: <7nagk7$m7s11@eccws1.dearborn.ford.com>

Hello,

I am having a Excel file transmitted to Web Server on a Unix machine
everyday. All I have to do is pull the data from there and load into an
oracle table.

Any Help as to what is the best way to handle this situation .


Thanks

Manny







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

Date: Fri, 23 Jul 1999 21:07:03 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: HTML on NT; how do I add docs?
Message-Id: <379aba1d.8423402@news3.ibm.net>

[mailed & posted]

kiansp@my-deja.com wrote:

>I have installed AvticePerl "version 5.005_03 built for
>MSWin32-x86-object", build 518.
>With this comes documentation in HTML format.
>Now I want to have a couple of HTML files added to the "perltoc.html"
>file. This is additional info for a couple of modules.
>I created a new folder under "C:\Perl\html\lib" and dropped the
>HTML files into the folder.
>
>How do I incorporate new html files into the TOC?

The following command will rebuild the TOC:

    perl -MHtmlHelp -eHtmlHelp::MakePerlHtmlIndexCaller

-Jan


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

Date: Fri, 23 Jul 1999 18:41:53 +0100
From: "George Crane" <georgec@webleicester.co.uk>
Subject: http_referer problems
Message-Id: <mN1m3.9$zq4.99@news1-hme0.mcmail.com>

Hi all,

Why is the environment key HTTP_REFERER always empty? How can you find the
name of the page or server that is calling your script? IE to stop unwanted
people from calling your scripts?

George






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

Date: Fri, 23 Jul 1999 14:55:23 -0400
From: brian@pm.org (brian d foy)
Subject: Re: http_referer problems
Message-Id: <brian-ya02408000R2307991455230001@news.panix.com>

In article <mN1m3.9$zq4.99@news1-hme0.mcmail.com>, "George Crane" <georgec@webleicester.co.uk> posted:

> Why is the environment key HTTP_REFERER always empty? How can you find the
> name of the page or server that is calling your script? IE to stop unwanted
> people from calling your scripts?


don't waste your time.  you can't do what you are looking to do.

did you have a Perl question?

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Fri, 23 Jul 1999 15:08:56 -0400
From: Matthew Zimmerman <mdz4c@node3.unix.Virginia.EDU>
Subject: Re: http_referer problems
Message-Id: <Pine.A41.4.05.9907231500390.81750-100000@node3.unix.Virginia.EDU>

On Fri, 23 Jul 1999, George Crane wrote:

> Why is the environment key HTTP_REFERER always empty? How can you find the
> name of the page or server that is calling your script? IE to stop unwanted
> people from calling your scripts?

HTTP_REFERER _should_ contain the name of the page that calls the script,
i.e., the page with

<a href="http://.../myscript.cgi">This is my script.</a>

If you type http://.../myscript.cgi directly in the browser, or run the
script from the command line, HTTP_REFERER won't be set. If that's not
what you're doing, it could be a configuration problem with
your web server. We can't help you with that.

BTW, this isn't a Perl question, but a CGI question. You really should
look in another group, such as comp.infosystems.www.authoring.cgi, for
advice on this. 

Matt

-- 
Matthew Zimmerman ------------  http://www.people.virginia.edu/~mdz4c
Interdisciplinary Biophysics Program --------- University of Virginia
| "You got to be very careful if you don't know where you're going, |
| because you might not get there."                   -- Yogi Berra |



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

Date: 23 Jul 1999 19:38:39 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: http_referer problems
Message-Id: <slrn7phha5.3ee.fl_aggie@thepentagon.com>

On Fri, 23 Jul 1999 15:08:56 -0400, Matthew Zimmerman
<mdz4c@node3.unix.Virginia.EDU>, in
<Pine.A41.4.05.9907231500390.81750-100000@node3.unix.Virginia.EDU>
wrote:

+ HTTP_REFERER _should_ contain the name of the page that calls the script

If and ONLY IF your server is configured to set that variable. Not all
are.

+ BTW, this isn't a Perl question, but a CGI question.

No. It's a server configuration question, and should be in
comp.infosystems.www.servers.{misc,windows,unix,whatever}, depending
on the platform type.

James


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

Date: Fri, 23 Jul 1999 15:42:33 -0400
From: James Gerard Coleman <jgc5a@j2.mail.virginia.edu>
Subject: mail::pop3client problems
Message-Id: <Pine.A41.4.05.9907231538470.66016-100000@node9.unix.Virginia.EDU>

hi,

i'm running perl for win32..  i need to have pop3 reading capability, so i
downloaded the mail::pop3client module.  however, when i try to run my
script, which uses the module, i get an error message:

Missing $ on loop variable at blah/blah/blah/pop3client.pm line 96
BEGIN failed -- compilation aborted at dir/dir/dir/file.plx at line...

i looked through the code, and couldn't find any errors... i might be
wrong about that, but i'm pretty sure it's okay..  anyone here more
familiar with this particular module?  any workarounds, changes to the
code i can use, or anything?

thanks,

Jim



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

Date: Fri, 23 Jul 1999 13:56:45 -0400
From: Bob Freedman <bob.freedman@eis.noaa.gov>
Subject: Need help with a ^M/newline issue
Message-Id: <3798ACDD.CA43541D@eis.noaa.gov>

I am receiving an HTML file with newline characters and ^M at the end of
lines.

I am trying to replace the ^M with \n but am having no success.

I tried the follwing:

$document =~ s/\n+/\n/g; #seems to have no effect

$document =~ s/\n+//g;   #seems to get rid of both ^M and \n

$document =~ s/\n{2,}//g;#seems to have no effect

HELP!!!


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

Date: Fri, 23 Jul 1999 15:44:26 -0400
From: modred@shore.net (Garth Sainio)
Subject: Re: Need help with a ^M/newline issue
Message-Id: <modred-2307991544260001@gniqncy-s03-147.port.shore.net>

In article <3798ACDD.CA43541D@eis.noaa.gov>, Bob Freedman
<bob.freedman@eis.noaa.gov> wrote:

> I am receiving an HTML file with newline characters and ^M at the end of
> lines.
> 
> I am trying to replace the ^M with \n but am having no success.
> 
> I tried the follwing:
> 
> $document =~ s/\n+/\n/g; #seems to have no effect
> 
> $document =~ s/\n+//g;   #seems to get rid of both ^M and \n
> 
> $document =~ s/\n{2,}//g;#seems to have no effect
> 
> HELP!!!

Well, there are at least two or three other threads addressing this same
issue. Basically, the ^M is represented by \r, try working with that and
see what happens.

Garth

-- 
Garth Sainio               "Finishing second just means you were the 
modred@shore.net            first to lose" - anonymous


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

Date: Fri, 23 Jul 1999 17:52:31 GMT
From: Chris L <fncll@uaf.edu>
Subject: Re: no such file when executing perl script
Message-Id: <7naa4r$rgj$1@nnrp1.deja.com>



> + Why would a file run fine if I use
> + perl program.pl
> +
> + but fail with the error:
> + ": No such file or directory
> +
> + when I use ./program.pl ?
>
> The first line of program.pl does not contain the right-path-to-perl.
>
> For instance, your perl might be located in /usr/local/bin/perl, and
> the script contains:
>
> #!/usr/bin/perl
>
> which doesn't exist -- no such file or directory...

I thought of that, but the line is indeed correct. It is exactly the
same as the test script which does work fine. I tried deleting the
shebang line and retyping it (in case there were hidden characters or
something)  as well as copying it from the working file. No dice.

In addition, I found out something strange. If I add -w to the shebang
line, then it invokes just fine with ./program.pl! When I run it from
the command line using -w, I get a couple of warnings about using
uninitialized variables, but nothing else...

Why would adding -w to the shebang line cause it to execute properly?
This is really driving me batty. Something else, even stranger, is that
without -w I type ./program.pl and get this response:

bash: ./program.pl: No such file or directory

but add the -w to the shebang line and it runs fine!

c


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Fri, 23 Jul 1999 18:43:22 +0100
From: "George Crane" <georgec@webleicester.co.uk>
Subject: oops
Message-Id: <MO1m3.10$zq4.108@news1-hme0.mcmail.com>






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

Date: Fri, 23 Jul 1999 15:23:42 -0400
From: "Anthony Kopf-Johnson" <anthonyk@insicorp.com>
Subject: Perl on NT to Oracle on Unix
Message-Id: <7nafpe$9cc$1@nntp2.uunet.ca>

I need to connect a Perl cgi on an NT server (behind a firewall) with IIS
4.0 to an Oracle 7 database on an HP-UX server. I intend using DBD::Oracle
and SQL*Net to accomplish this. From what I have found in the literature
this should be possible but I can't find an example to increase my comfort
level.

Has anyone out there done this or something similar?




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

Date: Fri, 23 Jul 1999 13:14:45 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Perl with MSQL
Message-Id: <brian-ya02408000R2307991314450001@news.panix.com>

In article <37988A13.A19AEDAE@analog.com>, "Paul Foran (Layout/Design)" <Paul.Foran@analog.com> posted:

> I need some support on interfacing perl with MSQL. What I need to do is
> the following:

you probably want to use the DBI modules to do this.

good luck :)

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Fri, 23 Jul 1999 18:06:23 +0100
From: "Paul Foran (Layout/Design)" <Paul.Foran@analog.com>
To: Matt <mlopresti@bigfoot.com>
Subject: Re: Perl with MSQL
Message-Id: <3798A10E.C41E5BF8@analog.com>

Matt wrote:

> Do you have examples that you tried?

No I don't.

> Or are you looking how to get started?

Yes. I was recommended an ISP that Supports MSQL on Unix. therefore will be
using Perl to Generate the scripts. I will Update my Database Tables with
Access and somehow  transfer them to my ISP in a format that MSQL will accept.

>
> What kind of support do you need. If you could narrow down your support
> request that would be more helpful.
>
>

I need to know how to do the following:
1.Upload an Access table in a way that MSQL will accep (maybe the wrong
nesgroup for this   problem)
2. Get perl Connect to the MSQL table containing say a vacancy database.
3. read in the Job category selected the user selected in the HTML form.
4. Get perl to Query the Vacancy table records whose category colum (within
vacancy table) matches the selected one via HTML form.
5. Get perl to display all relevant records matching selected job category.
Output this to a HTML webpage in table format.



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

Date: 23 Jul 1999 19:38:09 GMT
From: mwang@tech.cicg.ml.com (Michael Wang)
Subject: Re: pipe "|" functionality: ksh can easily do, perl can hardly do?
Message-Id: <7nagb1$s2h$1@news.ml.com>

Darrin frim uchicago, Larry from hp, and others, 

Following some of your ideas, I came up with the following code.
It works, however the performance is not good for things in /yp/
branch. This kind of things can easily be done with ksh. Is there
anything that I did wrong, or this is just the limitation with Perl?
Thanks. 

  foreach $j ( do {
                 if ( $opt_d eq "all" ) {
                   map ( {
                     if ( /local/ ) {
                       keys(%::beeper_byname);
                     } elsif ( /yp/ ) {
                       open(FH, "ypcat -k beeper.byname |")
                         or die("cannot fork: $!\n");
                       map ( {
                         /(\w+)\s+\w+/ && $1
                       } <FH> );
                     } else {
                     foreach $fh (*STDERR, *LOG) {
                         print($fh "beeper database $_ does not exist.\n");
                     }
                       $exit_status++;
                     }
                   } split(/,/, $opt_b) )
                 } else {
                   split(/,\s*/, $opt_d);
                 }
              }
  ) {
    unless ( $j eq "YP_LAST_MODIFIED" || $j eq "YP_MASTER_NAME" ) {
      ($k, @devnull)=get_pin("0", "1", "0", $opt_b, $j);
      $exit_status+=$k;
    }
  }
-- 
Michael Wang
http://www.mindspring.com/~mwang


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

Date: Fri, 23 Jul 1999 17:04:46 GMT
From: dwolfe5272@my-deja.com
Subject: Re: Q - Mapping to complex, nested data structures?
Message-Id: <7na7b6$qhj$1@nnrp1.deja.com>


> >I have a pretty good handle on how to use shmget to map to and read/
> >write from a shared memory area that contains simple shorts, longs,
> >doubles, etc, but I don't really know where to begin with a more
> >complicated structure of user-defined types.  Can anyone recommend a
> >document somewhere that might help me figure this out?
>
> That's what unpack is for (among other things).  For reference see
> perldoc -f pack and perldoc -f unpack.
>

Yes, but what 'template' (to use perldoc parlance) do you use for
packing/unpacking the data?  There is no template for, say, a
Vibration_Type (one of my user-defined types), so how do I figure out
how the machine stores these values internally?  I feel like there
*must* be a way to figure out how my gigantic mess of nested, user-
defined types is aligned/byte-padded by my C compiler--but I don't know
what it is (and whether I can even rely on this being the same all the
time).

So I guess my question is really:  how do I figure out what templates
to use with pack and unpack in Perl to read/write shared memory data in
complex, nested C structures?

--
*-*-*-*-*-*-*-*-*-*-*-*-*
Dave Wolfe
gForce Technologies Inc.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 23 Jul 1999 19:26:24 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Q - Mapping to complex, nested data structures?
Message-Id: <7nafl0$1hn$1@lublin.zrz.tu-berlin.de>

 <dwolfe5272@my-deja.com> wrote in comp.lang.perl.misc:

[snip]

>So I guess my question is really:  how do I figure out what templates
>to use with pack and unpack in Perl to read/write shared memory data in
>complex, nested C structures?

Of course the problem is the same in standard memory.

Translating C typedefs into pack/unpack patterns is quite challenge.
I don't know about a general solution; h2ph doesn't try to tackle
it.  I'm really out of my depth here, maybe an experienced extension
builder can comment.

Anno


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

Date: Fri, 23 Jul 1999 19:33:39 +0200
From: "Peter J. Acklam" <jacklam@math.uio.no>
Subject: Re: Regex-ing
Message-Id: <3798A772.E979135@math.uio.no>

Garth Sainio wrote:
> 
> Depending on the browser and platform the carriage returns may be
> encoded in the text as \r, \n, \r\n, \n\r. So, try something like
> 
>  $news =~ s/[\r\n]/delimiter/g;

How about

    $news =~ s/\015/delimiter/g;

Peter

-- 
Peter J. Acklam - jacklam@math.uio.no - http://www.math.uio.no/~jacklam


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

Date: Fri, 23 Jul 1999 19:20:56 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: Regex-ing
Message-Id: <379bbe40.15991274@nntp.ix.netcom.com>

On Fri, 23 Jul 1999 11:44:04 -0400, modred@shore.net (Garth
Sainio) wrote:

>In article <37987D50.2939D6A9@NOSPAMcognitech.co.uk>, Ben Meghreblian
><ben@NOSPAMcognitech.co.uk> wrote:
>
>!!  I am using cgi.pm to get the values from a form, including a multi-line
>!!  text-box.
>!!  
>!!  I want to replace all carriage-returns with my own delimiter.
>!!  
>!!  i have tried the following:-
>!!  
>!!  $news = s/\n/delimiter/g;
>!!  
>!!  but this doesn't work
>!!  
><snip>
>
>Depending on the browser and platform the carriage returns may be encoded
>in the text as \r, \n, \r\n, \n\r. So, try something like
>
> $news =~ s/[\r\n]/delimiter/g;

Which will translate two of the possible "carriage returns" you
list into two delimiters.  Something a little more like

	$news =~ s/(?:\r\n?)|(?:\n\r?)/delimiter/g;

might work better.

However, it might be that Ben really does mean "carriage return",
not "whatever represents a new line in the input."  If so, his
mistake is simply in using the wrong character.  \r is the escape
for carriage return, so it should be

	$news =~ s/\r/delimiter/g;
-- 
Michael M Rubenstein


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

Date: 23 Jul 1999 18:29:56 GMT
From: jmstapel_n0spam@mtu.edu (Jason Stapels)
Subject: Re: Speeding up Perl
Message-Id: <7nacb4$f3l$1@campus1.mtu.edu>

: As your assertions about grep totally contradict my expectations and my 
: benchmark, some more explanation would be appropriate, please.

I'll be completely honest in mentioning I'm not the best Perl programmer,
probably considered a newbie by many still... here is the actual code I
had used for my comparisons...

#! /usr/bin/perl

$blah = "a b c d e f ";

$start = (times)[0];
for ($x=0; $x<15; $x++)
    { $blah .= $blah; }
$end = (times)[0];
print "for..loop is ", $end - $start, "\n";

$start = (times)[0];
%test = ();
for (split( " ", $blah )) {$test{$_}++;}
$end = (times)[0];
print "for() is ", $end - $start, "\n";

$start = (times)[0];
%test = ();
map {$test{$_}++;} (split( " ", $blah ));
$end = (times)[0];
print "map is ", $end - $start, "\n";

$start = (times)[0];
%test = ();
grep $test{$_}++, (split( " ", $blah ));
$end = (times)[0];
print "grep is ", $end - $start, "\n";



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

Date: Fri, 23 Jul 1999 14:56:00 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Speeding up Perl
Message-Id: <brian-ya02408000R2307991456000001@news.panix.com>

In article <7nacb4$f3l$1@campus1.mtu.edu>, jmstapel_n0spam@mtu.edu (Jason Stapels) posted:

> : As your assertions about grep totally contradict my expectations and my 
> : benchmark, some more explanation would be appropriate, please.
> 
> I'll be completely honest in mentioning I'm not the best Perl programmer,
> probably considered a newbie by many still... here is the actual code I
> had used for my comparisons...

i noticed you didn't use the Benchmark module...

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Fri, 23 Jul 1999 16:00:02 -0300
From: "Eric L. Brine" <q2ir@unb.ca>
Subject: strict vars and local
Message-Id: <Pine.GSO.4.05.9907231553020.24648-100000@jupiter.sun.csd.unb.ca>


To my dismay, the following is not possible:

use strict;
sub test {
  local *huge_arg = \$_[0];  # Pass by reference.
  print($huge_arg, "\n");    # ack! strict error!
}
 ...
test(\$huge_arg);

My question:
  Is it possible to make a local var not strict (while the global one does
remain strict)? or is there a way to alias to $_[0] with strict on?

I can do the following, but I'd rather not.
sub test {
  my ($huge_arg_ref) = @_;
  print(${$huge_arg_ref}, "\n");
}
 ...
test(\$huge_arg);

--
Eric L. Brine  |  Chicken: The eggs's way of making more eggs.
q2ir@unb.ca    |  Do you always hit the nail on the thumb?
ELB@iname.com  |  An optimist thinks thorn bushes have roses.



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

Date: Fri, 23 Jul 1999 15:54:54 -0400
From: brian@pm.org (brian d foy)
Subject: Re: strict vars and local
Message-Id: <brian-ya02408000R2307991554540001@news.panix.com>

In article <Pine.GSO.4.05.9907231553020.24648-100000@jupiter.sun.csd.unb.ca>, "Eric L. Brine" <q2ir@unb.ca> posted:

> To my dismay, the following is not possible:
> 
> use strict;
> sub test {
>   local *huge_arg = \$_[0];  # Pass by reference.
>   print($huge_arg, "\n");    # ack! strict error!
> }
> ...
> test(\$huge_arg);
> 
> My question:
>   Is it possible to make a local var not strict (while the global one does
> remain strict)? or is there a way to alias to $_[0] with strict on?

what are you trying to do?

perhaps you want

   use vars qw($huge_arg);

or

   sub test {
      no strict 'vars';

      ....
      }

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Fri, 23 Jul 1999 18:18:23 GMT
From: jac@rom.com (Trevor Milley)
Subject: Submitting Photos
Message-Id: <3799b1e4.105698050@news.thezone.net>

I'm trying to develop a photo gallery on a website and I'm wondering
if it is possible for people to give the path to their photo on their
hard drive and for the script to copy that file to a database on the
server.  The only other option I can think of is getting the people to
just email the photos in but I would prefer to have a script do it
instead.  If anyone can help it would be greatly appreciated.

Trevor



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

Date: 23 Jul 1999 10:46:41 -0700
From: Jeff Solomon <jsolomon@stanford.edu>
Subject: Re: Timed prompt
Message-Id: <w4du2qv6yym.fsf@mrclean.Stanford.EDU>


> Does anyone have a module or a script that will prompt a user for
> something ( at present Y/N) and wait only N seconds before accepting
> a default.
> 
>     I've searched CPAN and have been unable to find anything.

I think what you really want is Term::ReadLine::Gnu. It has exactly
what you want. In fact one of it's test programs has this feature
exactly. In fact, here is a little standalone script that demonstrates 
it:

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

    require 5.004;

    use strict;
    use Term::ReadLine;

    my $term    = new Term::ReadLine 'test';
    my $attribs = $term->Attribs;
    my $timer   = 20;  # 20 x 0.1 = 2.0 sec timer

    $attribs->{'event_hook'} = \&count_down_timer;

    my $line = $term->readline("input in 2 seconds> ") || 'default';

    undef $attribs->{'event_hook'};

    print "\n<$line>\n";

    sub count_down_timer {
      if ($timer-- < 0) {
        $attribs->{'done'} = 1;
        undef $attribs->{'event_hook'};
      }         
    };              

This was taken from t/readline.t from the distribution.

I want to take this opportunity to say how good Term::ReadLine::Gnu
is. It's author, Hiroo Hayashi, has done a fantastic job bringing the
power of GNU ReadLine to Perl. I've used this module for a few of my
applications and it rocks!

Anyway, hope this helps.

Jeff


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 237
*************************************


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