[18691] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 859 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 9 03:07:11 2001

Date: Wed, 9 May 2001 00:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <989391911-v10-i859@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 9 May 2001     Volume: 10 Number: 859

Today's topics:
    Re: Disguising Perl scripts <dodger@necrosoft.net>
    Re: file manipulations (Martien Verbruggen)
    Re: Good editor for perl <goldbb2@earthlink.net>
    Re: how to set debug mode in perl <ilya@math.ohio-state.edu>
    Re: Idiom: the expression of a copied & substituted str <goldbb2@earthlink.net>
    Re: Invoking Perl script from a web page <japh@flashmail.com>
    Re: Javascript within perl <japh@flashmail.com>
    Re: Local Time (Randal L. Schwartz)
    Re: Local Time (Todd Smith)
    Re: Local Time (Randal L. Schwartz)
    Re: Local Time <todd@designsouth.net>
    Re: Local Time <tom.beer@btfinancialgroup.spamfilter.com>
        MD/DC area ? (CDantes)
        Need some help with this <newuser@nospam.slip.net>
        passing parameter into JavaScript <mhan88yh@yahoo.com>
        Perl CGI post to a text file <danmurph@worldnet.att.net>
    Re: Perl CGI post to a text file <japh@flashmail.com>
    Re: PL/SQL and DBI. <rereidy@indra.com>
    Re: Prices for work? <mdkersey@hal-pc.org>
    Re: Question about "->" operator (Jay Tilton)
    Re: Sort String <uri@sysarch.com>
    Re: unicode support in perl 5.6 -- I'm trying to get it <ilya@math.ohio-state.edu>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 09 May 2001 04:30:42 GMT
From: "Dodger" <dodger@necrosoft.net>
Subject: Re: Disguising Perl scripts
Message-Id: <SJ3K6.57123$B22.14438239@news1.rdc2.pa.home.com>

"jimbo" <jimbo@soundimages.co.uk> wrote in message
news:3hPJ6.8673$4A4.37620@NewsReader...
> > _fixes_ your program but makes it totally unrecogizable!  Yeesh, any of
> you
> > born in the south!?
>
> Where's the south?


North of Australia, I'd reckon.

--
Dodger
www.dodger.org
www.necrosoft.net
www.gothic-classifieds.com





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

Date: Wed, 09 May 2001 02:40:14 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: file manipulations
Message-Id: <slrn9fhbge.22m.mgjv@verbruggen.comdyn.com.au>

On 08 May 2001 11:15:03 -0500,
	Ren Maddox <ren@tivoli.com> wrote:
> 
> Way back in 1990, Larry Wall wrote a Perl "rename" script for just
> this type of situation.  I'm not exactly sure where the best place to
> get that script is

> # $Header: rename,v 4.0 91/03/20 01:11:53 lwall Locked $

The Perl sources, in the directory eg/ contain a slightly newer
version of this program.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | That's not a lie, it's a
Commercial Dynamics Pty. Ltd.   | terminological inexactitude.
NSW, Australia                  | 


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

Date: Tue, 08 May 2001 22:27:42 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Good editor for perl
Message-Id: <3AF8AB1E.67F1EE92@earthlink.net>

Anno Siegel wrote:
[snip]
> Slightly more on topic, yet still going on about vim: what I miss
> more than any syntax hilighter (which I don't trust enough) is
> the ability to use the QuickFix feature[1].  Perl error messages
> have the file and line number last, a format that is impossible
> to parse with the scanf-like methods vim offers.  Or is it?
> 
> Of course it's no problem to pre-process the error output so
> that vim can use it.  Using $SIG{ __WARN__} and $SIG{ __DIE__}
> for the purpose has the additional benefit that programmers are
> discouraged from using them themselves :).
> 
> Hmm "use Unix::QuickFix;" sounds snappy...

Surely Vim::QuickFix would be a better name; after all, I'm sure that it
works on platforms other than unix, right?  And I doubt that it's
especially useful for editors other than vim.  OTOH, since one might
want to fix warnings and errors for other editors than vim, we might
desire a whole heirarchy just for that, making this ErrorFix::Vim, and
fixing messages for other editors would be ErrorFix::<EditorName>.

> Anno
> 
> [1] QuickFix is vim's ability to read a file of error messages
> (which may come from multiple files) and jump to the indicated
> lines.

-- 
Shift to the left, shift to the right, mask in, mask out, BYTE, BYTE,
BYTE !!!


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

Date: 9 May 2001 06:29:28 GMT
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Subject: Re: how to set debug mode in perl
Message-Id: <9dao48$n1g$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Logan Shaw
<logan@cs.utexas.edu>], who wrote in article <9d9rip$j44$1@boomer.cs.utexas.edu>:
> But anyway, do "perl -d myscript".  When inside the debugger, type "h"
> for help.

I think this is a quite bad advice.  Better follow the hint given when
you start the debugger: combine "h" and "h h".

Ilya


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

Date: Tue, 08 May 2001 22:06:34 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Idiom: the expression of a copied & substituted string
Message-Id: <3AF8A62A.3745C3B@earthlink.net>

Ren Maddox wrote:
> 
> On Wed, 25 Apr 2001, mischief@velma.motion.net wrote:
> 
> > How abouot this messy little sub, which lets you write
> > '$orig = replace( $orig, $exp1, $exp2, $exp3, ... );'?
> 
> [snip]
> 
> >
> > #####
> >     my $orig = 'foo';
> >
> >     my $exp1 = 's/f/b/';
> >     my $exp2 = 's/o/a/';
> >     my $exp3 = 'tr/o/r/';
> >
> >     $orig = replace( $orig, $exp1, $exp2, $exp3 );
> >     print $orig . "\n"; # outputs "bar\n"
> > #####
> >
> 
> You don't really need a sub for that, just use:
> 
>   s/f/b/, s/o/a/, tr/o/r/ for $orig;
> 
> > This is the functionality for which it seems to me John is asking.
> 
> Actually, it isn't.  He's been pretty clear that what he wants is a
> simple expression that returns the modified string.  The same thing
> that you get from:
> 
>   do { (my $copy = $orig) =~ s/f/b/; $copy }
> 
> The best solution seems to be to write a subroutine like:
> 
>   sub apply (&$) {
>     local $_ = $_[1];
>     $_[0]->();
>     $_;
>   }
> 
>   my $orig = 'foo';
>   print "$orig => ", (apply { s/f/b/; s/o/a/; tr/o/r/ } $orig), "\n";
>   print "\$orig still $orig\n";
>   __END__
> 
> BTW, I'm annoyed that the prototype isn't strong enough to stop eating
> arguments after the prototype is met, but I guess some things are just
> considered too ambiguous.  At least it works for zero argument
> prototypes.

Of course, that could be a good thing.  Here's a slightly rewritten [but
untested] apply.

sub apply (&) {
	my $sub = shift;
	my @copy = @_;
	$sub->() for(@copy); # for() binds to $_
	wantarray ? @copy : $copy[0];
}

my @orig = ('foo', 'foz'); $" = ", ";
print "\@orig is @orig\n";
my @changed = apply { s/f/b/; s/o/a/; tr/o/r/ } @orig;
print "\@orig still @orig\n";
print "\@changed is @changed\n";

-- 
Shift to the left, shift to the right, mask in, mask out, BYTE, BYTE,
BYTE !!!


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

Date: Tue, 8 May 2001 21:42:41 -0500
From: Flounder <japh@flashmail.com>
Subject: Re: Invoking Perl script from a web page
Message-Id: <tfhblv295pan1c@corp.supernews.com>

<snip>
> yeah, try one of these in your html:
> 
> <!--#exec cgi="script.cgi"-->
>     or
> <!--#exec cmd="/path/script.cgi"-->

But if your server does not have SSI installed these will not work.
To return an image just do this. Create a small .gif image could be one 
pixal save it somewhere.
Then what you do is open the image as you would a text file and read the 
data and print the data unmodified back out to the browser, but for this to 
work right you need to use a Content-type of image/gif
So the code would look like this:

#START CODE
print "CONTENT-TYPE: image/gif\n\n";
open IMAGE, "/path/pic.gif";
print while <IMAGE>;
# END CODE

Keep in mind I did no error checking to make sure it really opened the 
image. So if you really want to go with the image tag that is how. This is 
how most of those free hit counters do it.


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

Date: Tue, 8 May 2001 22:16:32 -0500
From: Flounder <japh@flashmail.com>
Subject: Re: Javascript within perl
Message-Id: <tfhdl9ruptqvff@corp.supernews.com>

MikeG wrote:

> Is it possible to use JavaScript within Perl?
<snip>

Not like you are wanting to. Atleast not without a special module that 
intreprets javascript code, and I don't know of one. Could someone tell me 
if there is one. If there is I would like to take a look at it.
Are you wanting to edit remote files or local files? It looks like remote, 
but I am not for sure. 

Here is the local code:
# BEGIN CODE
sub conf {
  my $file = shift;
  if(-e $file) {
     # do GUI stuff to say it exists depends on gui toolkit you use
  }
  else {
      # do gui stuff to say     file has not been overwritten
  }
}
#END CODE
or remote version
# BEGIN CODE
use LWP::Simple;
sub conf {
  my $file = shift;
  if(get($file)) {
     # do GUI stuff to say it exists depends on gui toolkit you use
  }
  else {
      # do gui stuff to say     file has not been overwritten
  }
}
# END CODE
on remote version $file must be a full path with http:// and all

so call remote version like
&conf("file.html");

and remote like
&conf("http://www.slashdot.org");  

Tyler





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

Date: 08 May 2001 18:26:48 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Local Time
Message-Id: <m1r8xz5n3b.fsf@halfdome.holdit.com>

>>>>> "Todd" == Todd Smith <todd@designsouth.net> writes:

Todd> why do you have to be so mean?

It's not personal.  It's simply to show the onlookers that the answer
is rather pointless *and* harmful, given the number of useful answers
already in the thread.

Perhaps the points that Alan brings up are known by the poster.
Perhaps they aren't.  In either case, the points now clearly annotate
why the REST of us should use caution when using that answer.

Or perhaps you're someone who is more interested in everybody being
nice-nice to each other while the websites they build get broken into
by fourth graders and my credit-card and medical data gets ripped off.

No, I'd rather have Alan lean in a bit than to have bad coders out
there passing around bad tips to less experienced coders.  Yeah,
that's the world I'd rather live in.

print "Just another Perl hacker," # and programmer for three decades...

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Wed, 09 May 2001 04:17:18 GMT
From: todd@designsouth.net (Todd Smith)
Subject: Re: Local Time
Message-Id: <Xns909BEC6815A6Btodddesignsouthnet@24.7.143.118>

merlyn@stonehenge.com (Randal L. Schwartz) wrote in 
news:m1r8xz5n3b.fsf@halfdome.holdit.com:

>>>>>> "Todd" == Todd Smith <todd@designsouth.net> writes:
> 
> Todd> why do you have to be so mean?
> 
> It's not personal.  It's simply to show the onlookers that the answer
> is rather pointless *and* harmful, given the number of useful answers
> already in the thread.
> 
> Perhaps the points that Alan brings up are known by the poster.
> Perhaps they aren't.  In either case, the points now clearly annotate
> why the REST of us should use caution when using that answer.
> 
> Or perhaps you're someone who is more interested in everybody being
> nice-nice to each other while the websites they build get broken into
> by fourth graders and my credit-card and medical data gets ripped off.
> 
> No, I'd rather have Alan lean in a bit than to have bad coders out
> there passing around bad tips to less experienced coders.  Yeah,
> that's the world I'd rather live in.
> 
> print "Just another Perl hacker," # and programmer for three decades...
> 

I really don't think that anybody's credit card info or medical records 
could be stolen because somebody uses `date` instead of 'localtime'. If 
something were that important, I would leave the answer alone. But being as 
trivial as getting a date, there's more than one acceptible way to do it, 
and there's no harm in giving another option. And please don't call me a bad 
coder; you don't know me.

-- 
-todd


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

Date: 08 May 2001 22:08:01 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Local Time
Message-Id: <m18zk75cum.fsf@halfdome.holdit.com>

>>>>> "Todd" == Todd Smith <todd@designsouth.net> writes:

Exhibit one:

Todd> I really don't think that anybody's credit card info or medical
Todd> records could be stolen because somebody uses `date` instead of
Todd> 'localtime'. If something were that important, I would leave the
Todd> answer alone. But being as trivial as getting a date, there's
Todd> more than one acceptible way to do it, and there's no harm in
Todd> giving another option.

 ... put together with ...

Todd> And please don't call me a bad coder; you don't know me.

OK, let's base my knowledge entirely on exhibit one.  Based on *that*
evidence alone, I'd call you someone painfully unaware of what people
*do* use to break in.  (And I've got a hunch Alan and many of the
other experts, especially in the area of computer security, would back
me up here.)  Let's call that "bad coding" for the sake of argument.

Do you have counterevidence to show that you really aren't qualified
for that "bad coder" label I just gave you?  I hope so, or my claim
will stand, and you've just proved my point, not yours.

Tell ya what.  We'll make it simple.  You go read BugTraq or the CERT
mailing list for a year.  You tell me that there are no bugs *ever*
related to forking processes, especially programs outside your control
(like date(1)), especially programs where the PATH can be wrangled to
one of the users' choosing or are unknown to the coder.  External
processes are trouble.  Too much trust.  Too much communication.
Especially when they're trivially replaced with cheap internal system
calls, like time(2).

Go tell me that.  Tell me I've not seen those sorts of exploits time
and again.

And when you're unable to do that, you'll know why both Alan and I
complained at the use of `date` when it absolutely isn't necessary.

When you've removed your foot from your mouth, let me know how that
big toe tastes.

Just another computer security expert, and Perl hacker, and coder for
three decades,

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Wed, 09 May 2001 05:12:58 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: Re: Local Time
Message-Id: <ul4K6.81358$U4.17913517@news1.rdc1.tn.home.com>

I started to get all upset about the 'bad coder' label you gave me without
knowing me, but then I realized, I really don't care what you think at all.
See ya.




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

Date: Wed, 9 May 2001 15:48:15 +1000
From: "Tom Beer" <tom.beer@btfinancialgroup.spamfilter.com>
Subject: Re: Local Time
Message-Id: <9daln8$3rk$1@merki.connect.com.au>

"Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message
news:m18zk75cum.fsf@halfdome.holdit.com...
>
> Just another computer security expert, and Perl hacker, and coder for
> three decades,
>

Is this part of your sig, or are you trying to tell us that you are an old
fogey?

> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
0095
> <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!




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

Date: 09 May 2001 03:26:39 GMT
From: cdantes@aol.com (CDantes)
Subject: MD/DC area ?
Message-Id: <20010508232639.04389.00002290@ng-fr1.aol.com>

Hi,
Im looking for a PERL programmer to work on a couple pages for me; simple
database retrieval stuff.

-MK


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

Date: Mon, 7 May 2001 19:03:49 -0700
From: "newuser" <newuser@nospam.slip.net>
Subject: Need some help with this
Message-Id: <FqIJ6.3$ww5.44@news2.dnvrcoidc.firstworld.net>

Hello,

    I have been working on this message board script for a long time now and
I need just a little help on the last part which uses a html file. I will
try to explain what I am looking for the best I can.

    Currently I have a post.htm file which gives a person the option if they
place a x in a box the original poster will get all the follow-ups mail to
him/her.

    This part is working great by using the sendmail and a mailscript which
was added.
Now for the difficult part is what I want to do is some how if I can use the
same post.htm file and if a person does not place a x in the box then
his/her email address and name will not show up on the board. Kind of like
using the box has a dual purpose. Here is a snippet example of the post.htm:

<P><FORM METHOD="POST" ACTION="test.cgi">
 <b>Name:</b><br><INPUT TYPE="TEXT" NAME="name" SIZE="30"
maxlength="50"></td><tr><td align=left><b>E-Mail:</b><br><INPUT type=text
name="email" size="30" maxlength="50"><br><input type=checkbox name="reply"
value="yes"><font size=2 face=arial color=green><b>Check here if you wish to
be notified, via email, when someone replies to yourmessage.</b></font></td>

What I tried here is to add a <input type=checkbox name="reply"
value="no">underneath <input type=checkbox name="reply" value="yes"> for the
post.htm which will work.

Now as you can see from the following is a portion of the test.cgi (if more
is needed please let me know) which is working if a person places a x in the
box but where and
what statement will I have to use to make it work if a person does not place
a x in the box and that his/her name will not show up at all. I tried the
following but this did not work.

if ($email) {
      print NEWFILE "<a href=\"mailto:$email\">$name</a> on
$long_date:<p>\n";
   }
   else {
      print NEWFILE "$name on $long_date:<p>\n";
   }
if ($email) {
      print NEWFILE $name on $long_date:<p>\n";
   }

# New File Subroutine

sub new_file {
   open(NEWFILE,">$basedir/$mesgdir/$num\.$ext") || die $!;
   print NEWFILE "<html>\n";
   print NEWFILE "  <head>\n";
   print NEWFILE "    <title>$subject</title>\n";
   print NEWFILE "  </head>\n";
   print NEWFILE "  $background\n";
   print NEWFILE "    <center>\n";
   print NEWFILE "      <h1>$subject</h1>\n";
   print NEWFILE "    </center>\n";
   print NEWFILE "<hr size=7 width=75%>\n";
   if ($show_faq == 1) {
      print NEWFILE "<center>[ <a href=\"#followups\">Follow Ups</a> ] [ <a
href=\"#postfp\">Post Followup</a> ] [ <a
href=\"$baseurl/$mesgfile\">$title</a> ] [ <a
href=\"$baseurl/$faqfile\">FAQ</a> ]</center>\n";
   }
   else {
      print NEWFILE "<center>[ <a href=\"#followups\">Follow Ups</a> ] [ <a
href=\"#postfp\">Post Followup</a> ] [ <a
href=\"$baseurl/$mesgfile\">$title</a> ]</center>\n";
   }
   print NEWFILE "<hr size=7 width=75%><p>\n";

   print NEWFILE "Posted by ";
   if ($email) {
      print NEWFILE "<a href=\"mailto:$email\">$name</a> on
$long_date:<p>\n";
   }
   else {
      print NEWFILE "$name on $long_date:<p>\n";
   }
   if ($followup == 1) {
      print NEWFILE "In Reply to: <a
href=\"$last_message\.$ext\">$origsubject</a> posted by ";
      if ($origemail) {
         print NEWFILE "<a href=\"$origemail\">$origname</a> on
$origdate:<p>\n";
      }
      else {
         print NEWFILE "$origname on $origdate:<p>\n";
      }
   }

Thanks for all your help in the past with this perl program.





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

Date: Tue, 08 May 2001 22:59:31 -0400
From: M Han <mhan88yh@yahoo.com>
Subject: passing parameter into JavaScript
Message-Id: <3AF8B292.D45D9C3F@yahoo.com>

Hi,

I am writing a monitoring script in perl,
which validates a test userID on Logon page and
accesses test data from a backend database in our web site.
The website is developed in JavaScripts/Servlets.
Now, the script can login successfully and keeps the session info.
But I have a problem with
accessing following JavaScript.

Is there any way in perl to
pass 'Catalog' button info into this JavaScript and
make 'submitForm' work ? I tested with HTTP::Agent module,
but it didn't work.

Thanks in Advance.

Followings are from actual page.
--------------------------------
 ...
 ...
<SCRIPT language="JavaScript"><!-- hide from non JavaScript browsers
function submitForm(pstrNextPage) {
    document.mfrmMain.page.value=pstrNextPage;
    document.mfrmMain.method="get";
    document.mfrmMain.target="main";
    <% mstrFullUrl = mstrServletPath +
    "/servlet/servlets.application.MenuServlet";%>
    document.mfrmMain.action="<%=mstrFullUrl%>";
    document.mfrmMain.submit();
}
// stop hiding -->
</SCRIPT>
<TR>
<TD title="Online Catalog"><A href="javascript:submitForm('Catalog')"
onMouseOver="self.status='Online Catalog';return true">&nbsp;
CATALOG</A></TD>
</TR>
 ....
 ....

<TR>
<TD class="disabled" title="Online Catalog">&nbsp;CATALOG</TD>
</TR>
 ....
 ....
<FORM name="mfrmMain">
    <INPUT type="hidden" name="page">
</FORM>






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

Date: Wed, 09 May 2001 01:39:40 GMT
From: "Daniel Murphy" <danmurph@worldnet.att.net>
Subject: Perl CGI post to a text file
Message-Id: <wd1K6.11999$t12.886671@bgtnsc05-news.ops.worldnet.att.net>

I'm working on a web page with a text area where users enter a few lines of
information. The information goes directly to a text file.

When submitting the form and writing to the file, the non-alphanumeric
characters are automatically replaced with their hex equivalents with a "%"
 . I handle it now by explicitly substituting back to the entered characters
in the CGI executable so that the characters in the resulting text file look
like what was in the form.

I would like to know why this is happening and if there is another way of
handling it.







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

Date: Tue, 8 May 2001 21:32:36 -0500
From: Flounder <japh@flashmail.com>
Subject: Re: Perl CGI post to a text file
Message-Id: <tfhb2uasvob46d@corp.supernews.com>

Are you useing the CGI module.
I would if you are not it will take care of this. There is no way around it 
though other than having some like the CGI module take care of it for you. 
That is how webbrowsers send the info to the server. You can use the CGI 
module like this:
# START CODE
use CGI qw/:standard/;

my $text = param("THE FORMS NAME"); 
# the param function gets the data passed by either GET or POST

# END CODE
Text will be just how it was in the form. The qw/:standard/ tells it to use 
the CGI module in standard mode which is the non OO mode.
for more on the CGI module type:
perldoc CGI


Daniel Murphy wrote:

> I'm working on a web page with a text area where users enter a few lines
> of information. The information goes directly to a text file.
> 
> When submitting the form and writing to the file, the non-alphanumeric
> characters are automatically replaced with their hex equivalents with a
> "%" . I handle it now by explicitly substituting back to the entered
> characters in the CGI executable so that the characters in the resulting
> text file look like what was in the form.
> 
> I would like to know why this is happening and if there is another way of
> handling it.
> 
> 
> 
> 
> 



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

Date: Tue, 08 May 2001 20:11:06 -0600
From: Ron Reidy <rereidy@indra.com>
Subject: Re: PL/SQL and DBI.
Message-Id: <3AF8A73A.E795F17D@indra.com>

Ming Zhang wrote:
> 
> Does anybody have experience on using DBI with
> oracle Pl/SQL?Please give me an example. What should I do if I want to pass
> in one variable to PL/SQL and get a returned recordset?
> Thanks!
The DID and DBD::Oracle docs contain examples of using PL/SQL with
Perl.  You can also create and then use a SP (or an anonymous PL/SQL
blkock) which will return a reference to a cursor.  You can then use
this refences to fetch from (ala $sth->fetchrow_hashref etc.).
-- 

Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.


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

Date: Wed, 09 May 2001 00:12:55 -0500
From: "Michael D. Kersey" <mdkersey@hal-pc.org>
Subject: Re: Prices for work?
Message-Id: <3AF8D1D7.BB4BB6E4@hal-pc.org>

Todd Smith wrote:
> 
> US
> --

Now you've done it! This just in:

Killer Wave Floods Taiwan Cities, Threatens CA Coastline

LOS ANGELES (Reuters) - The internet once again displayed
the ability to produce unintended consequences when a
giant killer wave washed into the western Taiwan coastline,
submerging major cities and drowning millions. The wave 
continues eastward and now threatens California's coastline. 

Scientists looking into the origin of the wave found no 
geological or meteorological cause, but instead traced 
it to a post to the comp.lang.perl.misc newsgroup by one 
Todd Smith. In the post Mr. Smith inadvertently revealed
hitherto highly classified fact that Perl programmers in 
the US make $50-$60 per hour. 

Apparently, upon reading Mr. Smith's post, most of mainland 
China's 11 million Perl programmers simultaneously rose from 
their computers and entered the water, each intent on a Perl 
job in the US. The resulting wave has wreaked havoc upon 
Taiwan's western coast and decimated the fishing industry 
in that region. 

The average salary of a Chinese Perl programmer was $0.30 
per hour(US). However, since the hasty departure of China's 
best, wages have begun to rise rapidly, and offers as high 
as $0.75 per hour(US) have since been made.

The California Emergency Management Agency(CEMA), whose 
officials have until recently been tied up with the current 
energy blackouts, was apparently also completely unprepared 
for this contingency. "We never thought of this." said CEMA
director, L. Ron Rubbard, as he left for a New York City 
convention on Internet Terrorism.

Innovative measures have been proposed by several 
California legislators who have called for funding 
of research in harnessing the energy of water waves 
for electricity production. "If we can capture the 
energy from this wave, we can save our coastline and 
tell those Texas energy producers to kiss our ass!" 
said representative Dianne Feinstein. 

One scientist presented a proposal for using the wave's 
energy to raise the land west of the San Andreas fault. 
"We can capture the energy in the fault and then, by slowly 
lowering it again, generate electrical power." said Tom 
Tunnell, professor of Quantum Aerodynamics at UCLA Berkeley. 
"Unfortunately, this would have the side-effect of flooding 
half of California. I'll have to work on it a bit."

Meanwhile Gov. Davis, quick to take charge of the situation,
has called out the California State Guard to man the coastline 
and turn back the wave and the following group of Chinese 
Perl swimmers.

Gov. Davis' moves were immediately challenged in a lawsuit 
filed only hours ago by the San Francisco Chinese Restauranteurs' 
Association(SFCRA). "When those 11 million Perl programmers get 
here, they're gonna be plenty hungry," said Jackie Yan, 
president of SFCRA, "and we've got plenty of won ton!"

In a sidenote to the disaster, reports are that the American
mystery spyplane has taken off from the Hainan airport and
is on a flight path to the US mainland. Lieutenant Charles
Kurhammer, Attache' for Naval Affairs to the Peoples' Republic
of China, stated that the plane had not yet been released
to the US: "The plane has been spotted by our pilots. The 
tail has been painted with a white background and a camel.
Well, they may pretend to be Arabs, but whoever's piloting 
that plane is Chinese, as far as we're concerned."


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

Date: Wed, 09 May 2001 04:40:14 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Question about "->" operator
Message-Id: <3af8c3c9.101987813@news.erols.com>

On Wed, 09 May 2001 00:00:43 GMT, "Todd Smith" <todd@designsouth.net>
wrote:

>"Ed Napier" <napes@attglobal.net> wrote in message
>news:3AF86D5C.E3848F99@attglobal.net...
>
>>    $cds->{$host}->{$src} = $dest;
[...]
>if you want the first line to work, put this line above it:
>
>    $cds = { %cds };

That will make $cds a reference to a copy of %cds.  Using the
backslash operator will create a reference to the original.

  $cds = \%cds;

Of course, when %cds is a hash-of-hashes, both techniques end up
altering the same data.


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

Date: Wed, 09 May 2001 04:10:38 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Sort String
Message-Id: <x766fbcgbo.fsf@home.sysarch.com>

>>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:

>>>>> "Uri" == Uri Guttman <uri@sysarch.com> writes:
  RLS> and never use split /(....)/.

  Uri> well, not until you know why you need to use it. i have rarely used it
  Uri> but it has a use nonetheless. sometimes you want to keep the fields and
  Uri> their delims (which could be odd and not just fixed strings).

  RLS> In which case it's still more natural to teach:

  RLS>    my %hash = /(.*?)=(.*)\n/g;

but that is a fixed delim with only two fields. what about a case where
the delim is some variable string and you want to keep it for parsing
reasons?

  RLS> which comes out extremely awkward if you try to write it as a
  RLS> capturing split.

and my example comes out badly in a match since you would have to have
repeating groups of groups which doesn't work. split handles the looping
properly there. a while m//g could work but split is simpler as you
don't have to define the fields, just the separator regex.

  RLS> Naah... I've pretty much given up on capturing splits.

like i said, they are not needed often but when you need it, it saves a
lot of work.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info:     http://www.sysarch.com/perl/OOP_class.html


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

Date: 9 May 2001 06:32:00 GMT
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Subject: Re: unicode support in perl 5.6 -- I'm trying to get it to work l
Message-Id: <9dao90$n2c$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Eli the Bearded 
<elijah@workspot.net>], who wrote in article <eli$0105081742@qz.little-neck.ny.us>:
> > [I do not know how to set I/O encodings, and whether it is possible at
> > all.  Perl's Unicode I/O *may* be unfinished, but the processing
> > *while in Perl* should be pretty good nowadays.]
> 
> I can prove this wonderful theorem, but I have not way of writing
> down the proof?

At the LCD you can tie() a filehandle, and output things byte-by-byte.

> Why does using C<cmp> cause it to print differently?

Again: do not use print() on a handle without a define translation.

Ilya


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.

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 V10 Issue 859
**************************************


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