[23536] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5744 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 3 14:05:58 2003

Date: Mon, 3 Nov 2003 11:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 3 Nov 2003     Volume: 10 Number: 5744

Today's topics:
    Re: Aps and Linux <jwillmore@remove.adelphia.net>
    Re: Could someone successfully compile perl 5.8.1 with  (Rafael Garcia-Suarez)
    Re: derefing a nested table full of refs ctcgag@hotmail.com
    Re: How big can an array be ? <raisin@delete-this-trash.mts.net>
    Re: How big can an array be ? ctcgag@hotmail.com
    Re: How big can an array be ? ctcgag@hotmail.com
        How can i execute "cal" of UNIX  in xxx.pl ? (silvester)
    Re: How can i execute "cal" of UNIX  in xxx.pl ? <dmcbride@naboo.to.org.no.spam.for.me>
    Re: How to find a word in wordlist <bmb@ginger.libs.uga.edu>
        if/els statement within perl script - newb <post@to_group.com>
    Re: if/els statement within perl script - newb <dmcbride@naboo.to.org.no.spam.for.me>
    Re: if/els statement within perl script - newb <jgibson@mail.arc.nasa.gov>
    Re: if/els statement within perl script - newb <nobull@mail.com>
    Re: Need help with OCIDefineObject <ggershSNACK@CAKEctc.net>
    Re: Need help with OCIDefineObject <jwillmore@remove.adelphia.net>
        Rookie: Accessing specific element of excel->range arra <sdfg@sdg.com>
    Re: Rookie: Accessing specific element of excel->range  <sdfg@sdg.com>
    Re: Rookie: Accessing specific element of excel->range  <pinyaj@rpi.edu>
    Re: Something like JSP tags <jwillmore@remove.adelphia.net>
    Re: Something like JSP tags (Malcolm Dew-Jones)
    Re: What am I doing wrong?! <tore@aursand.no>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 03 Nov 2003 15:51:10 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Aps and Linux
Message-Id: <20031103105110.2caad5ad.jwillmore@remove.adelphia.net>

On 2 Nov 2003 22:09:06 -0800
rook_5150@yahoo.com (Bryan Castillo) wrote:
<snip>
> VBScript can be used within ASP, but many languages can be used in
> ASP,
> including perl (well on IIS you would need to use PerlScript from
> ActiveState,
> which allows perl to be used from WSH).
> 
> > published that it's ASP (because of the syntax used).
> > 
> > But, of course, I could be wrong :-)
> > 
> > In any event, It don't look, talk, etc. like Perl code :-)
> > 
> 
> Interestingly enough, if you check the URL the user posted for the
> script
> you will see errors with references to Apache::ASP, which from what
> I know only
> supports perl as its scripting language.  
> 
> I imagine the user tried to put an ASP page using VBScript as the
> scripting
> language on Apache::ASP.  Perhaps the user read that perl was used
> for Apache::ASP and came here.
> 
> Anyway, you have to convert all the stuff between <% and %> to perl
> (from whatever language you used VB, JScript, Python, Perl, etc....
> 
> The objects such as Request and Session should be the same.  Instead
> of
> Request.method() it would be Request->method().  Check the
> Apache::ASP website.

I didn't check the website :-(

And now, I've learned something new today :-)

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
The moon is a planet just like the Earth, only it is even deader.



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

Date: 03 Nov 2003 17:32:46 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Could someone successfully compile perl 5.8.1 with mingw 3.1.0-1?
Message-Id: <slrnbqd45s.mpt.rgarciasuarez@rafael.serd.lyon.hexaflux.loc>

Albert Albani wrote:
>
>I am wondering if there is someone who was able to successfully
>compile perl 5.8.1 with ming 3.1.0-1, and I'd be very happy
>if such a person could give me a hint as to what I could do
>to compile my perl as well.

Try the patch at 

    http://nntp.x.perl.org/group/perl.perl5.changes/9413

(basically inserting 3 lines into win32/win32.h)

HTH.


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

Date: 03 Nov 2003 15:39:13 GMT
From: ctcgag@hotmail.com
Subject: Re: derefing a nested table full of refs
Message-Id: <20031103103912.838$t8@newsreader.com>

AVataRR <member41443@dbforums.com> wrote:
> okay.. say I gots me a table and each row of this table has a nested
> table full of refs.. I know I have to somehow get to each "tuple" of the
> nested table and deref them individually, but PL/SQL being worse than
> BASIC, I have absolutley no idea of how to do this.

You know, I think you may have accidentally posted this to the right
news group.  Because if I had to do that, I'd do in Perl rather than
PL/SQL.

But YMMV.  I know some of the real Oracle devotees would disagree with me.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service              New Rate! $9.95/Month 50GB


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

Date: Mon, 3 Nov 2003 08:15:49 -0600
From: Master Web Surfer <raisin@delete-this-trash.mts.net>
Subject: Re: How big can an array be ?
Message-Id: <MPG.1a101f0e8bfecfb89896c0@news.mts.net>

[This followup was posted to comp.lang.perl.misc ]

In article <3fa4b8de_1@news.iprimus.com.au>, "Andrew Rich \(VK4TEC\)" 
<vk4tec@hotmail.com> says...
> Is there any limitation to a PERL array size ?
> 
> If I was to load a MySQL database into an array...
> 
> or
> 
> open (FILE,"/somemonsterfile"):
> while (<FILE>)
> {
> push @array, $_
> }


Perl by definition puts no limit on the size of an array.
However there may be limit opposed by your operating system as to the 
amount of memory that can be attached to a process.


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

Date: 03 Nov 2003 15:44:33 GMT
From: ctcgag@hotmail.com
Subject: Re: How big can an array be ?
Message-Id: <20031103104433.768$8X@newsreader.com>

rook_5150@yahoo.com (Bryan Castillo) wrote:
>
> Using linux I was able to load a hash, where the process was taking up
> ~ 1GB of memory.  I only had 512 MB of RAM.  I had 1 GB of swap.  I
> imagine that on some OS's you might not be able to occupy more that
> 4GB of RAM, since pointers would go over their limit (for 32 bit
> pointers at least).  I was also root while doing this, I don't know if
> some users are prohibited more than others.  Trying this non-root on
> Solaris, I was told that I ran out of memory much earlier. (I don't
> know why  ulimit  maybey???)
>
> *** I had 2 huge files to cross reference with each other.
>     I originally tried doing the calculation with both
>     a relational database (Informix) and with Berkely DB.
>     Loading all of one file into memory and using that in memory hash
>     for processing against the 2nd file was at least 10 times faster
>     than using a database. ***

Did you try a sort-merge?  I've never seen a hash that doesn't fit in
physical memory be fast about anything.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service              New Rate! $9.95/Month 50GB


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

Date: 03 Nov 2003 15:51:41 GMT
From: ctcgag@hotmail.com
Subject: Re: How big can an array be ?
Message-Id: <20031103105141.804$zR@newsreader.com>

Master Web Surfer <raisin@delete-this-trash.mts.net> wrote:
> [This followup was posted to comp.lang.perl.misc ]
>
> In article <3fa4b8de_1@news.iprimus.com.au>, "Andrew Rich \(VK4TEC\)"
> <vk4tec@hotmail.com> says...
> > Is there any limitation to a PERL array size ?
> >
> > If I was to load a MySQL database into an array...
> >
> > or
> >
> > open (FILE,"/somemonsterfile"):
> > while (<FILE>)
> > {
> > push @array, $_
> > }
>
> Perl by definition puts no limit on the size of an array.

By the definition of what?

It seems that the index of an array must fit in a 32-bit integer, at least
in some systems, and probably a 64-bit integer on the rest.  So that is
a limit.  A limit that will probably never be reached in physical memory,
but still a limit.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service              New Rate! $9.95/Month 50GB


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

Date: 3 Nov 2003 09:39:46 -0800
From: silvesterkwok@yahoo.com.tw (silvester)
Subject: How can i execute "cal" of UNIX  in xxx.pl ?
Message-Id: <4eb85e83.0311030939.172c306f@posting.google.com>

Here is my code. &#8595;  (of course i have another relative xxx.html)

#!/usr/local/bin/perl
do "cgi-lib.pl"||die "error\n";
&ReadParse;
exec "cal $in{month} $in{year}";
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
              &#8593;Here is my question.               
                i can't exec cal with month & year at the same time.
                for example,
                i can't exec "cal 11 2003";
                but it's ok to exec "cal 2003";
              
                what's wrong?
                or that's not supported by Perl?
                 
                i need help, please.


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

Date: Mon, 03 Nov 2003 17:48:51 GMT
From: Darin McBride <dmcbride@naboo.to.org.no.spam.for.me>
Subject: Re: How can i execute "cal" of UNIX  in xxx.pl ?
Message-Id: <7ywpb.283342$pl3.247016@pd7tw3no>

silvester wrote:

> Here is my code. &#8595;  (of course i have another relative xxx.html)
> 
> #!/usr/local/bin/perl
> do "cgi-lib.pl"||die "error\n";
> &ReadParse;
> exec "cal $in{month} $in{year}";
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>               &#8593;Here is my question.
>                 i can't exec cal with month & year at the same time.
>                 for example,
>                 i can't exec "cal 11 2003";
>                 but it's ok to exec "cal 2003";
>               
>                 what's wrong?
>                 or that's not supported by Perl?
>                  
>                 i need help, please.

$ perl -e '$in{m}=11;$in{y}=2003;exec "cal $in{m} $in{y}";'
    November 2003
Su Mo Tu We Th Fr Sa
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30

Works fine for me ... you may want to upgrade to a newer style of perl,
e.g., one that doesn't use cgi-lib.pl ;-)

Also, run your script through a debugger:

$ perl -d xxx.pl

Check what %in contains after ReadParse.

Finally, if this is a CGI script, cal may or may not be in your PATH at that 
point.  Try running with a full pathname, e.g. exec "/usr/bin/cal ..." (if 
that's where cal is on your system).


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

Date: Mon, 3 Nov 2003 13:25:06 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: How to find a word in wordlist
Message-Id: <Pine.A41.4.58.0311031305190.19994@ginger.libs.uga.edu>

On Sat, 1 Nov 2003, Anno Siegel wrote:

> VP  <VP@yahoo.com> wrote in comp.lang.perl.misc:
> > Hi all,
> > I have wordlist file having format:
> > ...
> > abc
> > abd
> > abf
> > abg
> > abh
> > ...
> > # check.pl abc
> >
> > if the word is found => ouput OK
> > if the word is not found => output two words above and below of this
> > word. For example:
> > # check.pl abe => output: abd abf
[snip]
>
> The direct application of binary search requires the whole file to be read
> into memory.  With 70,000 words this should be no problem.
>

Anything wrong with using Search::Dict?  And perhaps something like
File::ReadBackwards for the not-found condition (not included below)?


#!/usr/local/bin/perl
use strict;
use warnings;
use Search::Dict;

my $term = shift||die "Usage: $0 term\n";

open my $fh, 'datafile' or die $!;
look $fh, $term;

my $try = <$fh>||'';
chomp $try;

my $found = $term eq $try ? 1 : 0;
print $found?"OK\n":"Not found\n";


Regards,

Brad


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

Date: Mon, 03 Nov 2003 12:08:46 -0500
From: "Stuart H" <post@to_group.com>
Subject: if/els statement within perl script - newb
Message-Id: <pan.2003.11.03.17.08.45.654578@to_group.com>

Since bash is horrible at date statements i had to convert my bash script
to perl....now i have a headache.. I had help to convert but now in
modifying i have messed it up..

i'm checking a returned value from a sql query and comparing it against
the date. 
The two possible output types 


[bluemoon@monitor]$ /usr/local/bin/sqsh -Uuser -Ppassword -S sql1 -h -i test.sql
[bluemoon@monitor]$ 
[bluemoon@monitor]$ /usr/local/bin/sqsh -Usql1_replicator -Pkaiisdead -S mtsql1 -h -i test.sql
 0        2003110311:53:42/298


i am usure as to how to include a if $SQLOutput= null then exit, else...



#!/usr/bin/perl -w
 
use Date::Calc qw(Delta_DHMS);
use Date::Calc qw(Delta_Days);
use POSIX qw(strftime);
require Symbol;
 
$SENDMAIL_EXEC      = '/usr/sbin/sendmail';     # Path to sendmail(8)
$BLUEMOON_RECV_EMAIL = 'user@domain.com';
my $bluemoon_sender = "bluemoon_monitor\@domain.com";
 
my @today = (strftime("%Y", localtime(time)),strftime("%m", localtime(time)), strftime("%d", localtime(time)),strftime("%H", localtime(time)),strftime("%M", localtime(time)),strftime("%S", localtime(time)));
my @timestamp;
 
my $day;
my $year;
my $month;
my $hour;
my $minutes;
my $seconds;
my $Dd;
my $Dh;
my $Dm;
my $Ds;
 
my $SQLOutput;
my $zero;
 
my $bluemoon_body;
 
$SQLOutput=`/usr/local/bin/sqsh -Uuser -Ppassword -S sql1 -h -i bluemoon.sql`;
 
if ($SQLOutput = null then exit; else < ------- not sure how to do this in
perl...

/(.)(.)(........)(....)(..)(..)(..)(.)(..)(.)(..)(....)/) { $zero = $2; 
$year = $4; $month = $5; $day = $6; $hour = $7; $minutes = $9; $seconds = $11; }
@timestamp = ($year, $month, $day, $hour, $minutes, $seconds);
($Dd,$Dh,$Dm,$Ds) = Delta_DHMS(@timestamp,@today);
 
if (($Dd > 0 || $Dh > 0 || $Dm > 10) && $zero == 0 ) {
        $bluemoon_body = join('',"Blue Moon Timestamp Check has
failed!\n\nThe UPLOADED Field = ",$zero,"\nThere has not been an update
in ", $Dd," days, ", $Dh," hours and ", $Dm," minutes.\n\nPlease restart 
the interface or investigate\n\nBluemoon TimeStamp:
",@timestamp,"\nCurrent Timestamp: ",@today);

my $SEND_MAIL   = Symbol->gensym;
        open($SEND_MAIL, "|-") ||
        exec($SENDMAIL_EXEC, '-i', '-t', "-f$bluemoon_sender");
print $SEND_MAIL <<"EOF";
Date: @today
From: $bluemoon_sender
To: $BLUEMOON_RECV_EMAIL
Subject: Blue Moon is Down!
$bluemoon_body
EOF
close($SEND_MAIL);
 
}

Thanks for any help


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

Date: Mon, 03 Nov 2003 17:21:51 GMT
From: Darin McBride <dmcbride@naboo.to.org.no.spam.for.me>
Subject: Re: if/els statement within perl script - newb
Message-Id: <P8wpb.283312$pl3.195393@pd7tw3no>

Stuart H wrote:

> Since bash is horrible at date statements i had to convert my bash script

:-)  Horrible ... but doable.

> to perl....now i have a headache.. I had help to convert but now in
> modifying i have messed it up..
> 
> i'm checking a returned value from a sql query and comparing it against
> the date.
> The two possible output types
> 
> 
> [bluemoon@monitor]$ /usr/local/bin/sqsh -Uuser -Ppassword -S sql1 -h -i 
test.sql
> [bluemoon@monitor]$
> [bluemoon@monitor]$ /usr/local/bin/sqsh -Usql1_replicator -Pkaiisdead -S 
mtsql1 -h -i test.sql
>  0        2003110311:53:42/298
> 
> 
> i am usure as to how to include a if $SQLOutput= null then exit, else...



> #!/usr/bin/perl -w
>  
> use Date::Calc qw(Delta_DHMS);
> use Date::Calc qw(Delta_Days);

Both of these lines should be able to be combined:

use Date::Calc qw(Delta_DHMS Delta_Days);

> use POSIX qw(strftime);
> require Symbol;

You probably don't really want Symbol.  You want IO::File.

> $SENDMAIL_EXEC      = '/usr/sbin/sendmail';     # Path to sendmail(8)

FYI - I recommend Net::SMTP or Mail::Sendmail.  Further, you probably
don't want to use all caps for these variables.

> $BLUEMOON_RECV_EMAIL = 'user@domain.com';
> my $bluemoon_sender = "bluemoon_monitor\@domain.com";
>  
> my @today = (strftime("%Y", localtime(time)),strftime("%m",
> localtime(time)), strftime("%d", localtime(time)),strftime("%H",
> localtime(time)),strftime("%M", localtime(time)),strftime("%S",
> localtime(time))); my @timestamp;

There has to be an easier way to get all those variables ;-)  First,
you can get the output from localtime just once - can you imagine the
confusion if you ran this just as the date changed from one year to the
next?  ;-)

> my $day;
> my $year;
> my $month;
> my $hour;
> my $minutes;
> my $seconds;
> my $Dd;
> my $Dh;
> my $Dm;
> my $Ds;

Too many variables.

> my $SQLOutput;
> my $zero;
>  
> my $bluemoon_body;
>  
> $SQLOutput=`/usr/local/bin/sqsh -Uuser -Ppassword -S sql1 -h -i
> bluemoon.sql`;
>  
> if ($SQLOutput = null then exit; else < ------- not sure how to do this in
> perl...

exit unless $SQLOutput;

> /(.)(.)(........)(....)(..)(..)(..)(.)(..)(.)(..)(....)/) { $zero = $2;
> $year = $4; $month = $5; $day = $6; $hour = $7; $minutes = $9; $seconds =
> $11; } @timestamp = ($year, $month, $day, $hour, $minutes, $seconds);
> ($Dd,$Dh,$Dm,$Ds) = Delta_DHMS(@timestamp,@today);

Put this on multiple lines.  Further, you may want to use unpack for
this rather than a regular expression.

> if (($Dd > 0 || $Dh > 0 || $Dm > 10) && $zero == 0 ) {
>         $bluemoon_body = join('',"Blue Moon Timestamp Check has
> failed!\n\nThe UPLOADED Field = ",$zero,"\nThere has not been an update
> in ", $Dd," days, ", $Dh," hours and ", $Dm," minutes.\n\nPlease restart
> the interface or investigate\n\nBluemoon TimeStamp:
> ",@timestamp,"\nCurrent Timestamp: ",@today);

Again, use whitespace.  It's your friend.  And ours (those who you're
asking to look at the code).

> my $SEND_MAIL   = Symbol->gensym;
>         open($SEND_MAIL, "|-") ||
>         exec($SENDMAIL_EXEC, '-i', '-t', "-f$bluemoon_sender");

Using IO::Pipe may be better here.

my $SEND_MAIL = IO::Pipe->new();
$SEND_MAIL->reader($SENDMAIL_EXEC, '-i, '-t', "-f$bluemoon_sender");
$SEND_MAIL->writer();

print $SEND_MAIL <<"EOF";
 ...
EOF

Of course, using Mail::Sendmail takes care of all of this, much more
nicely, too, I think.

> print $SEND_MAIL <<"EOF";
> Date: @today
> From: $bluemoon_sender
> To: $BLUEMOON_RECV_EMAIL
> Subject: Blue Moon is Down!
> $bluemoon_body
> EOF
> close($SEND_MAIL);
>  
> }
> 
> Thanks for any help


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

Date: Mon, 03 Nov 2003 10:07:53 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: if/els statement within perl script - newb
Message-Id: <031120031007538936%jgibson@mail.arc.nasa.gov>

In article <pan.2003.11.03.17.08.45.654578@to_group.com>, Stuart H
<post@to_group.com> wrote:

> Since bash is horrible at date statements i had to convert my bash script
> to perl....now i have a headache.. I had help to convert but now in
> modifying i have messed it up..
> 
> i'm checking a returned value from a sql query and comparing it against
> the date. 
> The two possible output types 
> 
> 
> [bluemoon@monitor]$ /usr/local/bin/sqsh -Uuser -Ppassword -S sql1 -h -i
> test.sql
> [bluemoon@monitor]$ 
> [bluemoon@monitor]$ /usr/local/bin/sqsh -Usql1_replicator -Pkaiisdead -S
> mtsql1 -h -i test.sql
>  0        2003110311:53:42/298
> 
> 
> i am usure as to how to include a if $SQLOutput= null then exit, else...
> 
> 
[snip]

>  
> $SQLOutput=`/usr/local/bin/sqsh -Uuser -Ppassword -S sql1 -h -i bluemoon.sql`;
>  
> if ($SQLOutput = null then exit; else < ------- not sure how to do this in
> perl...

exit unless $SQLOutput;

[remainder of program snipped]


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

Date: 03 Nov 2003 18:13:34 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: if/els statement within perl script - newb
Message-Id: <u97k2hfhgx.fsf@wcl-l.bham.ac.uk>

Darin McBride <dmcbride@naboo.to.org.no.spam.for.me> writes:

> Stuart H wrote:
> 
> > require Symbol;
> 
> You probably don't really want Symbol.  You want IO::File.

You probably don't even want IO::File.

> > my $SEND_MAIL   = Symbol->gensym;

If you have Perl 5.6 (or is that 5.6.1?) you can omit the explicit
initialisation - file handles autovivify.

> >         open($SEND_MAIL, "|-") ||
> >         exec($SENDMAIL_EXEC, '-i', '-t', "-f$bluemoon_sender");
> 
> Using IO::Pipe may be better here.
> 
> my $SEND_MAIL = IO::Pipe->new();
> $SEND_MAIL->reader($SENDMAIL_EXEC, '-i, '-t', "-f$bluemoon_sender");
> $SEND_MAIL->writer();

If you have Perl 5.8 (I think) then you can avoid the clunklyness of
the old open/exec solution and also avoid the clunklyness of IO::Pipe
by using the LIST form of open().

open( my $SEND_MAIL, '|-', 
      $SENDMAIL_EXEC, '-i', '-t', "-f$bluemoon_sender")  or die $!

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Mon, 03 Nov 2003 09:42:48 -0500
From: Greg G <ggershSNACK@CAKEctc.net>
Subject: Re: Need help with OCIDefineObject
Message-Id: <QJudnQYSSpAT9DuiRVn-hA@ctc.net>



James Willmore wrote:
> On Thu, 30 Oct 2003 10:01:55 -0500
> Greg G <ggershSNACK@CAKEctc.net> wrote:
> 
>>I'm totally confused as to how to do an OCIDefineObject to get an
>>object from a database.  Here's the short form:
> 
> 
> Is this an Oracle concept?  If so, how is this concept related to
> Perl?  Are you using the DBD::Oracle module and DBI and this is what
> your question relates to?

    Yes.  I am using DBD::Oracle and DBI.  Unfortunately, the docs are 
completely arcane, and I have no idea what the parameters are (or 
really, even which DBI function I need to call to make this bind).

> 
>>I've got an object K_PAIR defined as a KEY (varchar 20) and VALUE 
>>(varchar 64).  I also have a table type of K_TABLE which is a table
>>of K_PAIR objects.
>>
>>The select statement I want to use is something along the lines of:
>>
>>SELECT username, keys FROM MYTABLE;
>>
>>username is just a plain old varchar and keys is a K_TABLE.
>>
>>Of course, I get a message that I haven't done an OCIDefineObject. 
>>Everything I've looked at is a confusing mash of parameters that I
>>can't quite decipher.  Is there an *easy* way to do this binding?
> 
> 
> Some _Perl_ code would be helpful :-)  Sorry, but it's not clear what
> you're asking - as it relates to Perl.
> 

    I'm asking how to do this select in perl.  I thought that was clear. 
  I don't *have* any existing code to work from, other than a basic 
string assignment and unexciting call to $dbh->prepare and execute().

-Greg G



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

Date: Mon, 03 Nov 2003 16:06:44 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Need help with OCIDefineObject
Message-Id: <20031103110643.52e69a5d.jwillmore@remove.adelphia.net>

On Mon, 03 Nov 2003 09:42:48 -0500
Greg G <ggershSNACK@CAKEctc.net> wrote:
> James Willmore wrote:
> > On Thu, 30 Oct 2003 10:01:55 -0500
> > Greg G <ggershSNACK@CAKEctc.net> wrote:
> > 
> >>I'm totally confused as to how to do an OCIDefineObject to get an
> >>object from a database.  Here's the short form:
> > 
> > 
> > Is this an Oracle concept?  If so, how is this concept related to
> > Perl?  Are you using the DBD::Oracle module and DBI and this is
> > what your question relates to?
> 
>     Yes.  I am using DBD::Oracle and DBI.  Unfortunately, the docs
>     are 
> completely arcane, and I have no idea what the parameters are (or 
> really, even which DBI function I need to call to make this bind).

I agree :-)  The documentation for some modules leave a lot to be
desired.  Some authors don't even go to the trouble of producing
documentation.

However, the DBI module is pretty verbose and filled with all types of
"good stuff".  There's also a mailing list that you can search for
answers.  One place (according the the documentation) is
http://groups.yahoo.com/group/dbi-users .  There's also the DBI
homepage: http://dbi.perl.org.

<snip>
> > Some _Perl_ code would be helpful :-)  Sorry, but it's not clear
> > what you're asking - as it relates to Perl.
> > 
> 
>     I'm asking how to do this select in perl.  I thought that was
>     clear. 
>   I don't *have* any existing code to work from, other than a basic 
> string assignment and unexciting call to $dbh->prepare and
> execute().

There is the 'do' function in the DBI module.  If you have fashioned
some SQL at the command line (SQL-Plus I _think_ is the shell
application that Oracle uses), then this SQL can be executed with the
'do' function.  It's rather messy to do it this way, IMHO.  However,
that's a start.

I'm thinking that maybe someone else has some more information for
you.  You may want to look through the DBI mailing list archives in
the mean time. 

Sorry I can't be of more assistance :-(

HTH

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
"The Right Honorable Gentleman is indebted to his memory for his 
jests and to his imagination for his facts."   -- Sheridan 


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

Date: Mon, 03 Nov 2003 16:51:50 GMT
From: "sdfgsd" <sdfg@sdg.com>
Subject: Rookie: Accessing specific element of excel->range array
Message-Id: <GIvpb.113798$Go5.1968952@twister.tampabay.rr.com>

Hello All,

Here's the code. As you can see, I've put a range of excel values into the
array $cells. Before proceeding, I need to access one or two specific values
that remain constant in their location within the array.

My problem: I can't seem to understand how to access a specific
value/element in the array. See comment in the code. Thanks for any help.

========================================

my $cells = $worksheet->Range("A1:D22")->{'Value'};

print "The content of this cell is: ", $@cells[0][2];
                                                    ^^^^^^^^^^^
# According to the books and perldoc, this should work, but it doesn't?

foreach my $row (@$cells)  {
      foreach my $rec (@$row)  {
          $rec =~ s/^\s+//;
          $rec =~ s/\s+$//;
          $rec =~ s/[^a-zA-Z0-9 .-]//g;
          print "$rec\n";
       }
}








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

Date: Mon, 03 Nov 2003 18:43:16 GMT
From: "sdfgsd" <sdfg@sdg.com>
Subject: Re: Rookie: Accessing specific element of excel->range array
Message-Id: <8lxpb.93532$RP2.76985@twister.tampabay.rr.com>

"sdfgsd" <sdfg@sdg.com> wrote in message
news:GIvpb.113798$Go5.1968952@twister.tampabay.rr.com...
> Hello All,
>
> Here's the code. As you can see, I've put a range of excel values into the
> array $cells. Before proceeding, I need to access one or two specific
values
> that remain constant in their location within the array.
>
> My problem: I can't seem to understand how to access a specific
> value/element in the array. See comment in the code. Thanks for any help.
>
> ========================================
>
> my $cells = $worksheet->Range("A1:D22")->{'Value'};
>
> print "The content of this cell is: ", $@cells[0][2];
>                                                     ^^^^^^^^^^^
> # According to the books and perldoc, this should work, but it doesn't?
==========================================

I solved this by reassigning $cells to another array. Not sure if this is
the most elegant way, but it works...

my $cells = $worksheet->Range("A1:D22")->{'Value'};
my @ArrCell = @$cells;

print "The content of this cell is: ", $ArrCell[0][1];

> foreach my $row (@$cells)  {
>       foreach my $rec (@$row)  {
>           $rec =~ s/^\s+//;
>           $rec =~ s/\s+$//;
>           $rec =~ s/[^a-zA-Z0-9 .-]//g;
>           print "$rec\n";
>        }
> }




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

Date: Mon, 3 Nov 2003 13:55:26 -0500
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
Subject: Re: Rookie: Accessing specific element of excel->range array
Message-Id: <Pine.SGI.3.96.1031103135509.19952A-100000@vcmr-64.server.rpi.edu>

On Mon, 3 Nov 2003, sdfgsd wrote:

>my $cells = $worksheet->Range("A1:D22")->{'Value'};
>
>print "The content of this cell is: ", $@cells[0][2];

You want to do

  $cells->[0][2]

-- 
Jeff Pinyan            RPI Acacia Brother #734            2003 Rush Chairman
"And I vos head of Gestapo for ten     | Michael Palin (as Heinrich Bimmler)
 years.  Ah!  Five years!  Nein!  No!  | in: The North Minehead Bye-Election
 Oh.  Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)



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

Date: Mon, 03 Nov 2003 16:28:32 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Something like JSP tags
Message-Id: <20031103112832.4b976844.jwillmore@remove.adelphia.net>

On 3 Nov 2003 05:44:40 -0800
graf.laszlo@axis.hu (Laszlo) wrote:

> Hi Gurus
> 
> Did somebody develop a mechanism for Perl (and Apache web server)
> like JSP tag ?

Wombat (http://search.cpan.org/~ix/Wombat-0.7.1/lib/Wombat.pm).  It's
design is similar to Tomcat.

If you use Apache, there is a way to use server side includes. 
However, from what I've read, it created more headaches as far as
server security is concerned.  There is a tutorial you coulde read on
this (Apache specific) -
http://httpd.apache.org/docs-2.0/howto/ssi.html
It's been a long time since I've used SSI at all.

HTH

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
"The four building blocks of the universe are fire, water, gravel
and vinyl."   -- Dave Barry 


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

Date: 3 Nov 2003 10:55:03 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Something like JSP tags
Message-Id: <3fa6a487@news.victoria.tc.ca>

Laszlo (graf.laszlo@axis.hu) wrote:
: Hi Gurus

: Did somebody develop a mechanism for Perl (and Apache web server)
: like JSP tag ?

: Graf Laszlo

If you mean html web pages with additional xml-ish tags that control
variable content and logic, but use perl instead of java, then look at the
various template packages available.



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

Date: Mon, 03 Nov 2003 16:05:43 +0100
From: Tore Aursand <tore@aursand.no>
Subject: Re: What am I doing wrong?!
Message-Id: <pan.2003.11.03.14.04.16.447076@aursand.no>

On Mon, 03 Nov 2003 12:37:27 +0000, Anno Siegel wrote:
> [...]
> But the code above isn't just bad, or hard to read, it's *wrong*.

Excactly my point.


-- 
Tore Aursand <tore@aursand.no>


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

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


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