[11355] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4955 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Feb 21 14:07:16 1999

Date: Sun, 21 Feb 99 11:00:28 -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           Sun, 21 Feb 1999     Volume: 8 Number: 4955

Today's topics:
        Background script I/O <wfunk@dev.tivoli.com>
    Re: Drag and Drop ASCII File in Windows <Allan@Due.net>
        FAQ 4.18: How do I remove consecutive pairs of characte <perlfaq-suggestions@perl.com>
        FAQ 4.19: How do I expand function calls in a string?   <perlfaq-suggestions@perl.com>
        FAQ 4.20: How do I find matching/nesting anything?   <perlfaq-suggestions@perl.com>
    Re: FAQ 4.20: How do I find matching/nesting anything? (Ilya Zakharevich)
        FAQ 4.21: How do I reverse a string?   <perlfaq-suggestions@perl.com>
        FAQ 4.22: How do I expand tabs in a string?   <perlfaq-suggestions@perl.com>
        FAQ 4.23: How do I reformat a paragraph?   <perlfaq-suggestions@perl.com>
    Re: flock() question <tchrist@mox.perl.com>
    Re: flock() question (Juergen Heinzl)
    Re: FMTEYEWTK: Switch Statements <mds-resource@mediaone.net>
    Re: foreach and while (Tad McClellan)
    Re: Got a modification to do, please help <unpaul@hotmail.com>
    Re: Help Please: CGI-String terminator problem <jth@sci.fi>
    Re: Help Please: CGI-String terminator problem <Allan@Due.net>
    Re: How to Search FAQ? (Tad McClellan)
    Re: perl ldap problem HELP please <morrowc@his.com>
    Re: Printing all environment variables (Andre L.)
    Re: Printing all environment variables <rick.delaney@home.com>
    Re: Problem with oraperl in a web-browser <morrowc@his.com>
    Re: require: command not found <jeff909@koan.com>
        slight ODBC confusion - hint appreciated. (Oliver)
        The crypt() function is unimplemented due to excessive  (Mark P.)
    Re: The crypt() function is unimplemented due to excess <Allan@Due.net>
    Re: The crypt() function is unimplemented due to excess (Mark P.)
    Re: tie complex data in DBM files <smiles@wfubmc.edu>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sat, 20 Feb 1999 22:30:21 -0600
From: "Wade T. Funk" <wfunk@dev.tivoli.com>
Subject: Background script I/O
Message-Id: <36CF8BDD.F396FAD3@dev.tivoli.com>

Hi,

I am trying to write a script, ultimately CGI, that will present a GUI
for a script
already written.  The script that is already in place and functional is
a large while
loop that processes user commands and returns messages after each
process.
The user exits the program by typing 'exit'.  I want to create a CGI
script that
takes these commands via a GUI and pipes them to the backgrounded script

already mentioned.  In otherwords, how can I put the script in the
background
so that I can write to and read from the script?

Thanks for any help ya'll can offer,

Wade



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

Date: Sun, 21 Feb 1999 13:52:52 -0500
From: "Allan M. Due" <Allan@Due.net>
Subject: Re: Drag and Drop ASCII File in Windows
Message-Id: <sCYz2.381$986.8032@nntp1.nac.net>

Jacob Rael wrote in message <36CF596E.5C4699D8@mediaone.net>...
:Hello,
:
:I would like to make an application that I can drag and drop an ascii
:file on-top of and it will modify it (one example is dos <-> unix). I
:come from a unix background so my old version is used a shell script to
:call a perl script (the shell script was to handle the file names
:easily).
:I tried to do it using a shortcut and batch file however I am missing
:something. I can write it so a specific file gets modified but I don't
:know how to extract the file name from the "drag and drop" operation.


Ok, write the perl script, lets call it foo.pl, so that it does the
modifications that you want to files passed to it via @ARGV.  Once the foo.pl
works as desired at the command prompt, run pl2bat on foo.pl.  To do this
simply type:

pl2bat foo.pl

and the file foo.bat will be created.  Now you can just drag any document that
you want changed onto foo.bat and it will be modified.

HTH

AmD




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

Date: 21 Feb 1999 06:23:27 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.18: How do I remove consecutive pairs of characters?  
Message-Id: <36d008cf@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I remove consecutive pairs of characters?

    To turn `"abbcccd"' into `"abccd"':

        s/(.)\1/$1/g;

-- 


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

Date: 21 Feb 1999 07:05:44 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.19: How do I expand function calls in a string?  
Message-Id: <36d012b8@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I expand function calls in a string?

    This is documented in the perlref manpage. In general, this is fraught
    with quoting and readability problems, but it is possible. To
    interpolate a subroutine call (in list context) into a string:

        print "My sub returned @{[mysub(1,2,3)]} that time.\n";

    If you prefer scalar context, similar chicanery is also useful for
    arbitrary expressions:

        print "That yields ${\($n + 5)} widgets\n";

    Version 5.004 of Perl had a bug that gave list context to the expression
    in `${...}', but this is fixed in version 5.005.

    See also ``How can I expand variables in text strings?'' in this section
    of the FAQ.

-- 
"...we will have peace, when you and all your works have perished--and
 the works of your dark master to whom you would deliver us.  You are a
 liar, Saruman, and a corrupter of men's hearts."  --Larry Wall in perl/taint.c, citing Theoden from LOTR


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

Date: 21 Feb 1999 08:05:51 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.20: How do I find matching/nesting anything?  
Message-Id: <36d020cf@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I find matching/nesting anything?

    This isn't something that can be done in one regular expression, no
    matter how complicated. To find something between two single characters,
    a pattern like `/x([^x]*)x/' will get the intervening bits in $1. For
    multiple ones, then something more like `/alpha(.*?)omega/' would be
    needed. But none of these deals with nested patterns, nor can they. For
    that you'll have to write a parser.

    If you are serious about writing a parser, there are a number of modules
    or oddities that will make your life a lot easier. There is the CPAN
    module Parse::RecDescent, the standard module Text::Balanced, the byacc
    program, the CPAN module Parse::Yapp, and Mark-Jason Dominus's excellent
    *py* tool at http://www.plover.com/~mjd/perl/py/ .

    One simple destructive, inside-out approach that you might try is to
    pull out the smallest nesting parts one at a time:

        while (s//BEGIN((?:(?!BEGIN)(?!END).)*)END/gs) {
            # do something with $1
        } 

    A more complicated and sneaky approach is to make Perl's regular
    expression engine do it for you. This is courtesy Dean Inada, and rather
    has the nature of an Obfuscated Perl Contest entry, but it really does
    work:

        # $_ contains the string to parse
        # BEGIN and END are the opening and closing markers for the
        # nested text.
     
        @( = ('(','');
        @) = (')','');
        ($re=$_)=~s/((BEGIN)|(END)|.)/$)[!$3]\Q$1\E$([!$2]/gs;
        @$ = (eval{/$re/},$@!~/unmatched/);
        print join("\n",@$[0..$#$]) if( $$[-1] );

-- 
: There may be 2 or three ways to perform a particular task, but there will
: not be 10,000 as there are in perl.
I think you may be exaggerating slightly.  Perl isn't that good yet.
        -- Larry Wall, 5 Jun 91 5:11:004GMT


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

Date: 21 Feb 1999 18:40:26 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: FAQ 4.20: How do I find matching/nesting anything?
Message-Id: <7apjuq$mh0$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Christiansen 
<perlfaq-suggestions@perl.com>],
who wrote in article <36d020cf@csnews>:
>   How do I find matching/nesting anything?
> 
>     This isn't something that can be done in one regular expression, no
>     matter how complicated.

This is obsolete.  With 5.005 it is already possible (but *how*
complicated!).  With 5.00555 the functionality did already settle down
and keeps a lot of water (though Hugo fixed one bug already).

The syntax has not been simplified yet to the simplest possible one,
either with (?p $postponed ), or with //p.

    my $matching;			# Should be on a separate line
    $matching = qr{
		    \(
		    (?:
		      (?> [^()]+ )	# Optimization: grab many
		     |
		      (?p{ $matching })	# Postponed recursive part
		    )*
		    \)
		}x;
    print "$1\n" while $input =~ /($matching)/g;

Ilya


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

Date: 21 Feb 1999 09:05:53 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.21: How do I reverse a string?  
Message-Id: <36d02ee1@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I reverse a string?

    Use reverse() in scalar context, as documented in the "reverse" entry in
    the perlfunc manpage.

        $reversed = reverse $string;

-- 
    "This sentence no verve." --Larry Wall


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

Date: 21 Feb 1999 10:05:56 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.22: How do I expand tabs in a string?  
Message-Id: <36d03cf4@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I expand tabs in a string?

    You can do it yourself:

        1 while $string =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;

    Or you can just use the Text::Tabs module (part of the standard perl
    distribution).

        use Text::Tabs;
        @expanded_lines = expand(@lines_with_tabs);

-- 
"Whenever you find that you are on the side of the majority, it is time
 to reform."    --Mark Twain


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

Date: 21 Feb 1999 11:06:04 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.23: How do I reformat a paragraph?  
Message-Id: <36d04b0c@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I reformat a paragraph?

    Use Text::Wrap (part of the standard perl distribution):

        use Text::Wrap;
        print wrap("\t", '  ', @paragraphs);

    The paragraphs you give to Text::Wrap should not contain embedded
    newlines. Text::Wrap doesn't justify the lines (flush-right).

-- 
San Francisco isn't what it used to be, and it never was.
                -- Herb Caen


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

Date: 21 Feb 1999 06:58:11 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: flock() question
Message-Id: <36d010f3@csnews>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    justin <jjpark@home.com> writes:
:what happens if you tries to flock a file that's already locked?
:does it wait until the first lock is removed or does it return failure
:flock?

Did you try?  Did you read the posting about flock over the
last few days?

--tom
-- 
Under no circumstances should program the way I say because I say to;
program the way you think expresses best what you're trying to accomlish
in the program.  And do so consistently and ruthlesly.  --Rob Pike


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

Date: Sun, 21 Feb 1999 14:49:15 GMT
From: juergen@monocerus.demon.co.uk (Juergen Heinzl)
Subject: Re: flock() question
Message-Id: <slrn7d06vm.3l.juergen@monocerus.demon.co.uk>

In article <36CFEF90.C9340D81@home.com>, justin wrote:
>what happens if you tries to flock a file that's already locked?
>does it wait until the first lock is removed or does it return failure
>flock?

It depends on whether the LOCK_NB flag is set or not.

Cheers,
Juergen

-- 
\ Real name     : J|rgen Heinzl                 \       no flames      /
 \ EMail Private : juergen@monocerus.demon.co.uk \ send money instead /
  \ Phone Private : +44 181-332 0750              \                  /


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

Date: Sun, 21 Feb 1999 12:26:48 -0600
From: "Michael D. Schleif" <mds-resource@mediaone.net>
Subject: Re: FMTEYEWTK: Switch Statements
Message-Id: <36D04FE8.732FC3C3@mediaone.net>

I'm sorry; but, did you read Tom's post, to which you responded?

Or, maybe you meant, why does Perl not have *only one* switch statement 
}:-^

Brad Baxter wrote:
> 
> Sure, but why doesn't Perl have a switch statement?  >:-)
> 
> -Brad
> 
> On 19 Feb 1999, Tom Christiansen wrote:
> > So, anybody read this far? :-)
> >
> > --tom
> > --
> >     "If ease of use is the highest goal, we should all be driving golf carts."
> >       --Larry Wall
> 
> --
> "Beauty lies in the hand of the beer holder"  --I forget

-- 

Best Regards,

mds
mds resource
888.250.3987

"Dare to fix things before they break . . . "

"Our capacity for understanding is inversely proportional to how much we
think we know.  The more I know, the more I know I don't know . . . "


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

Date: Sat, 20 Feb 1999 19:29:34 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: foreach and while
Message-Id: <e1kna7.kd6.ln@magna.metronet.com>

aaronp123@my-dejanews.com wrote:

: I have a pipe delimited data file like:
: $NAME|$EMAIL|$CREDIT|$DATE

: That looks like:
: Jon128|jon@email.com|6|990108
: Jon128|jon@email.com|10|990308
: Bobh92|bob@doman.com|18|990308
: Jon128|jon@email.com|33|990508


: for each. What I cannot figure out for the life of me is how I can add up the
: numeric value of the CREDIT values and pass it along to a single variable
: like 'total_credits'.


: This is what I have for search results:

: foreach $result (@results){
: ($NAME,$EMAIL,$CREDIT,$DATE)= split(/\|/,$result);
: print "<b>$NAME</b> - $EMAIL - $CREDIT - On: $DATE<br>\n";

   $total_credits += $CREDIT if $NAME eq 'Jon128';

: }


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


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

Date: Sun, 21 Feb 1999 16:46:42 +0100
From: "Mec" <unpaul@hotmail.com>
Subject: Re: Got a modification to do, please help
Message-Id: <7ap9mg$62n$1@front3.grolier.fr>


Steve Linberg a icrit dans le message ...
>In article <7aovr6$hvl$1@front3.grolier.fr>, "Mec" <unpaul@hotmail.com>
wrote:
>
>> Here is the current code, please tell me how to modify it so it will let
url
>> starting by news:
>
>if ($url_to_check !~ /^(ftp|http|nntp|news):\/\/\S+\.\S+/) { return(1); }

Thanks a lot for your help, but your code allow news:// and it's not like
news: (without the //)

Do you have another solution to allow news: ?

Thanks,
Mec




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

Date: Sun, 21 Feb 1999 18:21:18 +0200
From: "Jouni Honkala" <jth@sci.fi>
Subject: Re: Help Please: CGI-String terminator problem
Message-Id: <7apbqk$p3h$1@tron.sci.fi>


Yan Ge kirjoitti viestissd <36CFC3CD.1EE4F1B9@waksman.rutgers.edu>...
>Hi! Everyone!  I am new to perl and having trouble to run the
simplest
>CGI-perl program on my machine.  I copied the howdy CGI program from
the
>Learning Perl book got this message when I tried to run on my machine
:
>"Can't find string terminator "end_of" anywhere befor EOF at
xxfile.."
>I don't quite get it since the terminator is in the program as the
>follow:


Interesting! My ActivePerl on W95 did not complain at all!

>I installed the ActivePerl on my NT4.0 system and it worked  when I
>tested out the example.pl.   Another question I have is the
declaration
>of the MIME type.  The Learning Perl book used the above way to do it
>while a tutorial on the web use
>
>print "Content-type: text/html\n\n";
>

>instead.  I wonder whether they all work.

I'm not sure, but I recall that I've seen a definition like:
"There isn't the one only way do things in Perl". I think this one
goes to the same slot. The only thing that matters, is that you have
that MIME line as a first output and then the rest of the headers
(like cookies) and an empty line before the page content.






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

Date: Sun, 21 Feb 1999 13:17:08 -0500
From: "Allan M. Due" <Allan@Due.net>
Subject: Re: Help Please: CGI-String terminator problem
Message-Id: <45Yz2.377$986.7961@nntp1.nac.net>

Yan Ge wrote in message <36CFC3CD.1EE4F1B9@waksman.rutgers.edu>...
:Hi! Everyone!  I am new to perl and having trouble to run the simplest
:CGI-perl program on my machine.  I copied the howdy CGI program from the
:Learning Perl book got this message when I tried to run on my machine :
:"Can't find string terminator "end_of" anywhere befor EOF at xxfile.."
:I don't quite get it since the terminator is in the program as the
:follow:
:#!/usr/local/bin/perl -w
:# howdy
:print <<end_of;
:Content-type: text/html
:<html>
:    <head>
:    <title> Hello World </title>
:     </head>
:     <body>
:     <h1> Greetings </h1>
:     </body>
:</html>
:
:end_of
:I installed the ActivePerl on my NT4.0 system and it worked  when I
:tested out the example.pl.

Make sure that there is no extra white space after end_of, that end_of is
flush left on the line and that end_of is not the very last line in the file.
There must be one newline after the end_of token.  Just to be on the safe side
you might want to a superfluous ; after the end_of just to make sure you have
the extra line.  Some editors will remove extra blank lines at an end of the
file.

so try:
#!/usr/local/bin/perl -w
# howdy
print <<end_of;
Content-type: text/html


<html>
    <head>
    <title> Hello World </title>
     </head>
     <body>
     <h1> Greetings </h1>
     </body>
</html>

end_of
;

:Another question I have is the declaration
:of the MIME type.  The Learning Perl book used the above way to do it
:while a tutorial on the web use

:print "Content-type: text/html\n\n";

They are the same.  You need two newlines after the Content-type.  The second
version writes them explicitly using \n\n while the first includes the two
newlines are part of the here document.  Oh, and comp.lang.perl is no more.

HTH

AmD




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

Date: Sat, 20 Feb 1999 19:34:35 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How to Search FAQ?
Message-Id: <rakna7.kd6.ln@magna.metronet.com>

Jalil Feghhi (jalilf@home.com) wrote:
: It seems that some of the questions asked in this group (including my last
: two questions) are already in the faq. I am wondering if there is any way to
: search all the faqs. I hope it is not already in faqs!


After cd'ing to the where the .pods are on your system:

1) Make a file with the questions in it

   perl -ne 'print if /^=/' perlfaq[1-9].pod >faq_marked_lines


2) Make a file with the name of all of Perl's functions in it:

   perl -ne 'print if /^=/' perlfunc.pod >function_list


3) Make a file with all of the POD marked lines in the standard docs:

   perl -ne 'print if /^=/' *.pod >marked_lines


Word search as appropriate.


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


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

Date: Sun, 21 Feb 1999 11:49:55 -0500
From: Chris Morrow <morrowc@his.com>
To: shaven.monkey@throw.me.the.banana.first
Subject: Re: perl ldap problem HELP please
Message-Id: <36D03933.105B2998@his.com>

what kind of LDAP server is this? If it's exchange you need to bind with
a more NT like syntax :) I believe you would bind with a userid like:
	"cn=userid,cn=DOMAIN"
There is documentation on this in the manuals... I think for Netscape
LDAP servers the bind is as you show in your code.

-Chris

shaven.monkey wrote:
> 
> The code creates the user and rfc822Mailbox is a mandatory attribute of
> rfc822-user, so it can't be blank.
> 
> thanks anyway
> SM
> 
> lt lindley wrote:
> >
> > shaven.monkey <shaven.monkey@throw.me.the.banana.first> wrote:
> > :>Can anybody see what's wrong with this piece of code?
> >
> > :>I get the error message "bind error Invalid syntax" and can't figure out
> > :>why.
> > :>If an existing user already has an attribute rfc822Mailbox I can modify
> > :>the value,
> > :>but I can't add the attribute to a user.
> >
> > [ code snipped ]
> >
> > I don't know about the error message.  And I have only read enough
> > LDAP to do whatever I was trying to do at the time.
> >
> > Are you sure that the user does not already have an attribute
> > rfc822Mailbox that happens to be Null?  Try using "modify_s"
> > instead of add.
> >
> > --
> > // Lee.Lindley   | There was a time when I thought that "being right"
> > // @bigfoot.com  | was everything.  Then I realized that getting along
> > //    | was more important.  Still, being right is more fun!
> > //    | And if I'm wrong, somebody will get some joy out of telling me!


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

Date: Sun, 21 Feb 1999 12:18:18 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Printing all environment variables
Message-Id: <alecler-2102991218180001@dialup-619.hip.cam.org>

In article <m3k8xclts2.fsf@joshua.panix.com>, Jonathan Feinberg
<jdf@pobox.com> wrote:

> mwoog@gmx.net (Marc-A. Woog) writes:
> 
> > >Andre L. wrote in message ...
> > >
> > >print map{"$_\t$ENV{$_}\n"} (sort keys %ENV);
> > 
> > Just yesterday I was trying to learn more about the map function and
> > red in the Camel Book something like "do not use map in a void
> > context, use foreach or system instead" Aren't you doing exactly
> > that (or do I misunderstand "void context")?


First point, there is a misquote here, I did not post the example above
using map, this was from Allan M. Due. Credit where credit is Due[1]. :-)

Second point, as Jonathan stated, map() is not being used in a void
context here, since the result of the map is used by print(). However, it
is not very appropriate to produce a list of strings like that before
printing it.

Now, this one below is a use of map() in a void context:

   map { print } ( some_list );

This particular example is not really a sin, though, because print() does
not return any value, so the list returned by map() is empty. IMO, this is
the one exception where using map solely for its side-effect may be
considered legitimate by a pragmatic programmer. 

Andre
[1] Sorry Allan, I know it's bad taste to play on people's names.


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

Date: Sun, 21 Feb 1999 18:38:31 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Printing all environment variables
Message-Id: <36D05485.FEF3B0ED@home.com>

[posted & mailed]

Andre L. wrote:
> 
> Now, this one below is a use of map() in a void context:
> 
>    map { print } ( some_list );
> 
> This particular example is not really a sin, though, because print() 
> does not return any value, so the list returned by map() is empty. 

print() doesn't return a value?

$ perl -le 'print map { print } qw(a b c)'
a
b
c
111

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Sun, 21 Feb 1999 11:30:11 -0500
From: Chris Morrow <morrowc@his.com>
To: Peter Schoenenberger <schoedema@my-dejanews.com>
Subject: Re: Problem with oraperl in a web-browser
Message-Id: <36D03493.2EB03D2D@his.com>

When you changed the Oracle_Home might you also have to
"recompile/reinstall" oraperl/DBD::Oracle? During the
installation/compilation there are some parts that are either referenced
or pulled from the Oracle_Home.  The shared objects you are not able to
reference could be required at runtime and Perl is looking in the
"wrong" place for them?

-Chris

Peter Schoenenberger wrote:
> 
> That's a good thought, but I have already set the following variable in the
> Perl-Script:
> 
> $ENV{ORACLE_HOME}="/opt/app/oracle/product/7.3.4";
> 
> Are there any other variables which must been set?
> 
> The script _IS_ running on a unix-shell using 'perl <scriptname>' but is not
> running from the WWW Server as a CGI (errorlog see below).
> 
> Peter
> 
> In article <36CCD8DE.32300FB@his.com>,
>   Chris Morrow <morrowc@his.com> wrote:
> > 1) Your script is running from the WWW Server...as a CGI.
> > 2) you might have set the ORACLE_HOME in the CGI script and now since
> > you have upgraded (and removed the old version) the ORACLE_HOME is
> > different???
> >
> > Just a thought and a comment.
> >
> > This seems to most likely NOT be a problem with Apache, it seems like
> > your code might need a quick fix (change ORACLE_HOME to be correct?)
> >
> > -Chris
> >
> > schoedema@my-dejanews.com wrote:
> > >
> > > I have the following configuration:
> > > Solaris 2.5, Apache 1.2.5, Netscape 4.04 under Solaris.
> > > I have a Perl script, that connects to an oracle-DB via CGI and Oraperl
> from a
> > > browser (IE4 or Netscape 4). Under Oracle V.7.3.2 everything works fine.
> > > After upgrading the DB to V.7.3.4 the script didn't work properly anymore.
> The
> > > Apache error-log produces the follwing message:
> > >
> > > ---------- install_driver(Oracle) failed: Can't load
> > > '/usr/local/lib/perl5/site_perl/sun4- solaris/auto/DBD/Oracle/Oracle.so' for
> > > module DBD::Oracle: ld.so.1: /usr/local/bin/perl: fatal: libclntsh.so.1.0:
> > > can't open file: errno=2 at
> > > /usr/local/lib/perl5/sun4-solaris/5.00403/DynaLoader.pm line 155.
> > >
> > >  at (eval 1) line 2
> > >
> > >   DBI::install_driver('DBI', 'Oracle') called at
> > > /usr/local/lib/perl5/site_perl/Oraperl.pm line 57  require Oraperl.pm called
> > > at /usr/local/www/cgi-bin/digidat/list_msanl line 21  main::BEGIN() called
> at
> > > /usr/local/lib/perl5/site_perl/Oraperl.pm line 0  eval {...} called at
> > > /usr/local/lib/perl5/site_perl/Oraperl.pm line 0 BEGIN failed--compilation
> > > aborted at /usr/local/www/cgi-bin/digidat/list_msanl line 21. -----------
> > >
> > > If I create a softlink from the old oraclehome to new oraclehome the script
> > > is running without a problem even from the webbrowser. Obviously there seems
> > > to be a problem with the path-tracking within the Apache server.
> > >
> > > I'm grateful for any suggestions concerning my problem.
> > >
> > > -----------== Posted via Deja News, The Discussion Network ==----------
> > > http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
> >
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own


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

Date: Sun, 21 Feb 1999 07:18:15 -0800
From: "iratheous" <jeff909@koan.com>
Subject: Re: require: command not found
Message-Id: <7ap8hs$5nc$1@remarQ.com>

Thanks alot for your reply. i am beginning to think they don't support
shebang..   (I agree with your boo-hiss because I'm not exactly a
perlwriting pro here or anything)
Jeff

Jonathan Stowe wrote in message <7aova5$2p7$1@gellyfish.btinternet.com>...
>On Sat, 20 Feb 1999 23:06:57 -0800 iratheous wrote:
>>                                              I have a require statement
to
>> include my cgi-lib.pl file (so I can use the $readParse) but the script
wont
>> run and the only error I get when checking through telnet is "require:
>> command not found" ....
>
>This is because your program is being run by the shell and not Perl - you
>should check that you have the correct shebang invocation at the
>beginning of your file:
>
>#!/usr/bin/perl
>
>Of course your perl might be in a different place.  If your system doesnt
>support the shebang invocation (boo hiss) then you should see the perlrun
>manpage for an alternative method.
>
>/J\
>--
>Jonathan Stowe <jns@btinternet.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: Sun, 21 Feb 1999 15:42:25 GMT
From: o.harvey@andtech.co.uk (Oliver)
Subject: slight ODBC confusion - hint appreciated.
Message-Id: <36d00c81.7492333@oak>

Hello all,
	...ok, so I've got an ODBC data source on my NT machine.

	I'd like to interface to it from my Linux box.

	I thought DBD:ODBC would do the trick.....but no....it's not
an ODBC driver after all.........

	..so I need an ODBC driver for linux...right ?

	..urrr .....Intersolve.....

	I'll get cracking, but any hints would be appreciated !

	thanks all,
	
	Oliver



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

Date: Sun, 21 Feb 1999 18:16:43 GMT
From: mag@imchat.com (Mark P.)
Subject: The crypt() function is unimplemented due to excessive paranoia
Message-Id: <36d04cda.45102223@news.ionet.net>

I'm using CGI.PM to parse the form and have come across this little
tidbit thats killing my script. Is this coming from CGI.PM or what?




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

Date: Sun, 21 Feb 1999 13:31:46 -0500
From: "Allan M. Due" <Allan@Due.net>
Subject: Re: The crypt() function is unimplemented due to excessive paranoia
Message-Id: <FiYz2.379$986.7945@nntp1.nac.net>

Mark P. wrote in message <36d04cda.45102223@news.ionet.net>...
:I'm using CGI.PM to parse the form and have come across this little
:tidbit thats killing my script. Is this coming from CGI.PM or what?


No that message is coming from perl.  If my recollection serves me correctly
that was the message you received from the standard port version 5.004_02 for
Win32.  If you are still using that version it is time to upgrade to 5.005_02.
You can download it from www.activestate.com

HTH

AmD





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

Date: Sun, 21 Feb 1999 18:36:52 GMT
From: mag@imchat.com (Mark P.)
Subject: Re: The crypt() function is unimplemented due to excessive paranoia
Message-Id: <36d051e4.46392458@news.ionet.net>

	Thanks, I was just scrolling through CGI.PM and was coming to
the same conclusion albeit, it definately would have taken me a lot
longer.<G>


On Sun, 21 Feb 1999 13:31:46 -0500, "Allan M. Due" <Allan@Due.net>
wrote:

>Mark P. wrote in message <36d04cda.45102223@news.ionet.net>...
>:I'm using CGI.PM to parse the form and have come across this little
>:tidbit thats killing my script. Is this coming from CGI.PM or what?
>
>
>No that message is coming from perl.  If my recollection serves me correctly
>that was the message you received from the standard port version 5.004_02 for
>Win32.  If you are still using that version it is time to upgrade to 5.005_02.
>You can download it from www.activestate.com
>
>HTH
>
>AmD
>
>
>



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

Date: Sat, 20 Feb 1999 12:26:50 -0500
From: Steve Miles <smiles@wfubmc.edu>
Subject: Re: tie complex data in DBM files
Message-Id: <36CEF05A.9A123399@wfubmc.edu>

I should have read the Perl Cookbook more carefully. There is a section on
MLDBM in the Chapter 14. The only problem is that MLDBM is not a standard
module in Perl 5.005! :-)

Steve Miles wrote:

> Hi,
>
> I'm been working with fairly complex hashes containing hashes and
> arrays, but I then tried to implement these same structures and store
> them using DBM files and none of the complex structures appear to be
> saved.
>
> While I can :
> push (@{ $hash{$data} }, $newdata);
> and print "@{ $hash{$data}";
>
> if I tie it to a DBM file I just get a "ARRAY(8x80s8x7)" when I reopen
> the database and
>  print "@{ $hash{$data}";.
>
> Any suggestions?
> Steve
> --------------------------------------------------------
> Steve Miles (smiles@wfubmc.edu)
> Wake Forest University School of Medicine
> 5019 Hanes, Medical Center Blvd.
> Winston-Salem, NC 27157
> Phone: 336.716.0454     FAX: 336.716.7200
> --------------------------------------------------------

--
=============================================
Steve Miles (smiles@wfubmc.edu)
----> http://www.groundbreak.com  <----
Wake Forest University School of Medicine
5019 Hanes, Medical Center Blvd.
Winston-Salem, NC 27157
Phone: 336.716.0454     FAX: 336.716.7200
=============================================




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

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

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