[28397] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9761 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 24 21:05:49 2006

Date: Sun, 24 Sep 2006 18:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 24 Sep 2006     Volume: 10 Number: 9761

Today's topics:
        Checking for empty cell in Excel Spreadsheet <pamelapdh@aol.com>
    Re: Checking for empty cell in Excel Spreadsheet <see.sig@rochester.rr.com>
    Re: Checking for empty cell in Excel Spreadsheet <pamelapdh@aol.com>
    Re: Checking for empty cell in Excel Spreadsheet <see.sig@rochester.rr.com>
    Re: empty fields <eric-amick@comcast.net>
        Endless loop in Text::Format::reformat() <noreply@gunnar.cc>
    Re: Endless loop in Text::Format::reformat() <nobull67@gmail.com>
    Re: Endless loop in Text::Format::reformat() <see.sig@rochester.rr.com>
    Re: Endless loop in Text::Format::reformat() <nobull67@gmail.com>
        Federated CGI to CGI <matt.toy@gmail.com>
    Re: Federated CGI to CGI axel@white-eagle.invalid.uk
        Help with "require" and importing constants <news@lawshouse.org>
    Re: Help with "require" and importing constants <nobull67@gmail.com>
    Re: Help with "require" and importing constants <see.sig@rochester.rr.com>
    Re: How identify if more than one option is specified? <shah@typhoon.xnet.com>
    Re: How identify if more than one option is specified? <shah@typhoon.xnet.com>
    Re: tying db records and other objects, speed? <abigail@abigail.be>
    Re: Zero equals pipe?? <sisyphus1@nomail.afraid.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 24 Sep 2006 12:39:12 -0700
From: "Pam" <pamelapdh@aol.com>
Subject: Checking for empty cell in Excel Spreadsheet
Message-Id: <1159126752.522545.219630@m7g2000cwm.googlegroups.com>

Hello :


Does anyone know how to check for an empty cell in an Excel spreadsheet
using Perl?
I am writing the script in a Windows envirement but the script will ber
run on Unix with a cron job.


I am using the following Perl packages

use strict;
use Spreadsheet::WriteExcel;
use Spreadsheet::ParseExcel;
use Win32::Ole;

I have tried all the exmaples regarding parsing but can't find anything
that will
give me the data in a cell or check if the cell is empty before writihg
to it.

HELP

Pam



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

Date: Sun, 24 Sep 2006 21:13:09 GMT
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: Checking for empty cell in Excel Spreadsheet
Message-Id: <FxCRg.47918$uH6.46680@twister.nyroc.rr.com>

Pam wrote:
 ...
> Does anyone know how to check for an empty cell in an Excel spreadsheet
> using Perl?

Yes

> I am writing the script in a Windows envirement but the script will ber
> run on Unix with a cron job.
> 
> 
> I am using the following Perl packages
> 
> use strict;
> use Spreadsheet::WriteExcel;
> use Spreadsheet::ParseExcel;
> use Win32::Ole;

Can't find that one.  Perhaps you mean Win32::OLE?

> 
> I have tried all the exmaples regarding parsing but can't find anything
> that will
> give me the data in a cell or check if the cell is empty before writihg
> to it.

How about the first example program in the docs for Win32::OLE?  It 
looks as if the 'Value' property of the 'Range' class will return undef 
for a cell that never had anything put in it (is that what you mean by 
"empty"?).  I tested this via a slight modification to that example. 
Use the defined() function to determine if the value is undef or not.
 ...
> Pam
-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


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

Date: 24 Sep 2006 14:32:26 -0700
From: "Pam" <pamelapdh@aol.com>
Subject: Re: Checking for empty cell in Excel Spreadsheet
Message-Id: <1159133546.068153.221150@m7g2000cwm.googlegroups.com>

Hi:

Yes I want to check each row in a particular column to see if anything
is there and then write to it.  Is it possible you can give me a
snippet of that code for the defined function,  This is the last piece
I have to fix


Appreciated

Pam

Bob Walton wrote:
> Pam wrote:
> ...
> > Does anyone know how to check for an empty cell in an Excel spreadsheet
> > using Perl?
>
> Yes
>
> > I am writing the script in a Windows envirement but the script will ber
> > run on Unix with a cron job.
> >
> >
> > I am using the following Perl packages
> >
> > use strict;
> > use Spreadsheet::WriteExcel;
> > use Spreadsheet::ParseExcel;
> > use Win32::Ole;
>
> Can't find that one.  Perhaps you mean Win32::OLE?
>
> >
> > I have tried all the exmaples regarding parsing but can't find anything
> > that will
> > give me the data in a cell or check if the cell is empty before writihg
> > to it.
>
> How about the first example program in the docs for Win32::OLE?  It
> looks as if the 'Value' property of the 'Range' class will return undef
> for a cell that never had anything put in it (is that what you mean by
> "empty"?).  I tested this via a slight modification to that example.
> Use the defined() function to determine if the value is undef or not.
> ...
> > Pam
> -- 
> Bob Walton
> Email: http://bwalton.com/cgi-bin/emailbob.pl



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

Date: Sun, 24 Sep 2006 22:15:31 GMT
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: Checking for empty cell in Excel Spreadsheet
Message-Id: <7sDRg.55848$8j3.39440@twister.nyroc.rr.com>

Pam wrote:
 ...
> Yes I want to check each row in a particular column to see if anything
> is there and then write to it.  Is it possible you can give me a
> snippet of that code for the defined function,  This is the last piece
> I have to fix
 ...
> Pam
 ...

Check the code in the first example in the documentation for the 
Win32::OLE module:

   perldoc Win32::OLE

It shows you how to read the value of a cell, how to use the defined() 
function, and lots more.  And, it goes without saying:

   perldoc -f defined

-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


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

Date: Sun, 24 Sep 2006 20:32:26 -0400
From: Eric Amick <eric-amick@comcast.net>
Subject: Re: empty fields
Message-Id: <bk8eh255qpi7k4tr9eg567tn5kpnnbuv3t@4ax.com>

On Sun, 24 Sep 2006 12:18:11 +0200, Awkish <awk@hotmail.com> wrote:

>Hi,
>I must parse files of this form:
>
>field1,,,field4,,field6,,,,,,
>
>
>That is, the fields of each line are separated by a comma, and the fields
>can be empty.
>
>With awk I can do this:
>
>awk -F, '{print $6; print NF}'
>
>with the above line I get:
>field6
>12
>and that's what I want
>
>
>How can I get the same result with Perl?
>I tried:
>
>perl -F, 'print $F[5];print $#F+1'

According to the description in perlrun (ahem), you need

perl -an -F, "print $F[5],$#F+1"

I tried it. It works.
-- 
Eric Amick
Columbia, MD


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

Date: Sun, 24 Sep 2006 23:36:37 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Endless loop in Text::Format::reformat()
Message-Id: <4noc36Fbbk8nU1@individual.net>

It has happened recently (twice) that invoking CGI::ContactForm at my 
web site has resulted in endless loops, which have made the web server 
error log grow to about 700 Mb in a couple of seconds, thus consuming 
the remaining space of my VPS. :(

This is what was written repeatedly to the error log: "Use of 
uninitialized value in concatenation (.) or string at 
/usr/lib/perl5/site_perl/5.8.1/CGI/ContactForm.pm line 600."

Line 600 of ContactForm.pm consists of:

     push @output, "$1 ";

and to see it in context, a URL to the CVS repository: 
http://gunnar.cc/cgi-bin/cvsweb.cgi/contactform/lib/CGI/ContactForm.pm?annotate=1.45;cvsroot=gunnar

The code in question is the reformat() subroutine, which was copied from 
the module Text::Format. It's used to format the body nicely before 
sending a message.

I have failed to figure out what kind of data that might cause 
reformat() to go into those endless loops. Therefore, any idea of what 
the problem is would be much appreciated.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: 24 Sep 2006 15:01:44 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Endless loop in Text::Format::reformat()
Message-Id: <1159135304.566072.259850@i3g2000cwc.googlegroups.com>


Gunnar Hjalmarsson wrote:
> It has happened recently (twice) that invoking CGI::ContactForm at my
> web site has resulted in endless loops, which have made the web server
> error log grow to about 700 Mb in a couple of seconds, thus consuming
> the remaining space of my VPS. :(
>
> This is what was written repeatedly to the error log: "Use of
> uninitialized value in concatenation (.) or string at
> /usr/lib/perl5/site_perl/5.8.1/CGI/ContactForm.pm line 600."
>
> Line 600 of ContactForm.pm consists of:
>
>      push @output, "$1 ";
>
> and to see it in context,

if ( $line =~ /^(.{$min,$opt1}) (.*)/ ||
     $line =~ /^(.{$min,$max1}) (.*)/ || $line =~ /^(.{$min,})? (.*)/ )
{
    push @output, "$1 ";
    $line = $2;
}

The way that $1 can be undef is if the first to two patterns don't
match and the third pattern matches but the optional subexpression does
not. This will happen if the first character of $line is a space.

I can't immediately see the cause of the endless looping but there's
your warning.



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

Date: Sun, 24 Sep 2006 22:03:18 GMT
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: Endless loop in Text::Format::reformat()
Message-Id: <GgDRg.55845$8j3.23341@twister.nyroc.rr.com>

Gunnar Hjalmarsson wrote:
> It has happened recently (twice) that invoking CGI::ContactForm at my 
> web site has resulted in endless loops, which have made the web server 
> error log grow to about 700 Mb in a couple of seconds, thus consuming 
> the remaining space of my VPS. :(
> 
> This is what was written repeatedly to the error log: "Use of 
> uninitialized value in concatenation (.) or string at 
> /usr/lib/perl5/site_perl/5.8.1/CGI/ContactForm.pm line 600."
> 
> Line 600 of ContactForm.pm consists of:
> 
>     push @output, "$1 ";
> 
> and to see it in context, a URL to the CVS repository: 
> http://gunnar.cc/cgi-bin/cvsweb.cgi/contactform/lib/CGI/ContactForm.pm?annotate=1.45;cvsroot=gunnar 
> 
> 
> The code in question is the reformat() subroutine, which was copied from 
> the module Text::Format. It's used to format the body nicely before 
> sending a message.
> 
> I have failed to figure out what kind of data that might cause 
> reformat() to go into those endless loops. Therefore, any idea of what 
> the problem is would be much appreciated.
> 

Hmmm...almost certainly this is happening because $1 is undef at line 
600, since that is the only concatenation (interpolation actually does a 
concatenation).  Looking at your code:

 ...
595:} elsif ( $line =~ /^(.{$min,$opt1}) (.*)/ ||
596:    $line =~ /^(.{$min,$max1}) (.*)/ ||
         $line =~ /^(.{$min,})? (.*)/ ) {
597:    # 1. Try to find a string as long as opt_length.
598:    # 2. Try to find a string as long as max_length.
599:    # 3. Take the first word.
600:       push @output, "$1 ";
 ...

it looks like the third alternative could match with $1 undef if $line 
started with a space character and there were no other space characters 
in $line (in which case the first two alternatives would fail, assuming 
$min>0).  Is that a possibility?
-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


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

Date: 24 Sep 2006 15:10:46 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Endless loop in Text::Format::reformat()
Message-Id: <1159135846.760933.117410@m7g2000cwm.googlegroups.com>


Brian McCauley wrote:
> Gunnar Hjalmarsson wrote:
> > It has happened recently (twice) that invoking CGI::ContactForm at my
> > web site has resulted in endless loops, which have made the web server
> > error log grow to about 700 Mb in a couple of seconds, thus consuming
> > the remaining space of my VPS. :(
> >
> > This is what was written repeatedly to the error log: "Use of
> > uninitialized value in concatenation (.) or string at
> > /usr/lib/perl5/site_perl/5.8.1/CGI/ContactForm.pm line 600."
> >
> > Line 600 of ContactForm.pm consists of:
> >
> >      push @output, "$1 ";
> >
> > and to see it in context,
>
> if ( $line =~ /^(.{$min,$opt1}) (.*)/ ||
>      $line =~ /^(.{$min,$max1}) (.*)/ || $line =~ /^(.{$min,})? (.*)/ )
> {
>     push @output, "$1 ";
>     $line = $2;
> }
>
> The way that $1 can be undef is if the first to two patterns don't
> match and the third pattern matches but the optional subexpression does
> not. This will happen if the first character of $line is a space.
>
> I can't immediately see the cause of the endless looping but there's
> your warning.

Got it...

Look at _stuff.

    sub _stuff {
         my ($text, $num_quotes) = @_;
         if ($text =~ /^ / || $text =~ /^>/ || $text =~ /^From / ||
$num_quotes > 0) {
             return " $text";
         }
         $text;
     }

If $num_quotes=0 and $line starts with a space then the line

  $line = '>' x $num_quotes . _stuff($line, $num_quotes);

Simply prepends a space to $line and then the code quoted in my
previous message simply strips of a leading space.

There's your infinite loop.



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

Date: 24 Sep 2006 12:45:17 -0700
From: "beowoof" <matt.toy@gmail.com>
Subject: Federated CGI to CGI
Message-Id: <1159127117.534580.241430@h48g2000cwc.googlegroups.com>

Hi all,

I have an interesting architecture that I'm trying to adapt a
configuration interface to.

At a high level, the architecture breaks down to:

Central Web Instance:
  - let's call it www.web-central.bank.com
Regional Web Servers:
  - www.web-usa.bank.com, www.web-eur.bank.com and
www.web-asia.bank.com

Now, ideally, users who want to configure each of the regional servers,
shouldn't have to actually log onto them locally.  Instead, they would
log onto the central instance, select the region to modify and -- poof
-- the regional server is updated behind the scenes.

Next up, I have no intention of using anything like frames,
configuration databases, pull methods, etc.  I want to be able to
"push" the configuration out to the regional servers from the central
instance ad hoc.

My first plan was to use xmlhttprequest to go off to a update.pl script
on the appropriate server and everything would be fine and dandy.  Of
course, that didn't work.  Calling a different web server causes
security warnings in IE and just won't work on Firefox.

So what I'd like are ideas on how to approach this, or where I'm going
wrong.  I specifically only want to stay within the web framework -
ideally CGI -> CGI calls.  I could of course have daemon processes
(this is all Linux/Apache btw), SSH push, etc... All of which I don't
want to do.  I had this wonderfully "clean" idea of central web scripts
calling regional web scripts.

Thanks in advance.



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

Date: Sun, 24 Sep 2006 22:32:32 GMT
From: axel@white-eagle.invalid.uk
Subject: Re: Federated CGI to CGI
Message-Id: <4IDRg.154$zf3.59@fed1read03>

beowoof <matt.toy@gmail.com> wrote:
> I have an interesting architecture that I'm trying to adapt a
> configuration interface to.
 
> [ major snip ]

Do you have a Perl problem?

If not, you are in the wrong newsgroup.

Axel
 


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

Date: Sun, 24 Sep 2006 22:04:02 +0100
From: Henry Law <news@lawshouse.org>
Subject: Help with "require" and importing constants
Message-Id: <1159131840.8742.0@proxy01.news.clara.net>

There's an easy answer to this, I'm sure, but an hour of Googling and 
experimenting has not led me to it.  Can someone help?

I need to include the module Win32::File if my code is running on 
Windows, but not on Linux.  Job for the "require" statement, I thought. 
The module exports a set of constants (ARCHIVE being my example), but 
not, apparently, when "require" is used.  How do I code this simple thing?

Code that does what I want on a Win32 system:
#! /usr/bin/perl
use strict; use warnings;
use Win32::File;
#require Win32::File;
#Win32::File->import qw(ARCHIVE);
printf "Archive constant from Win32::File: %x\n", ARCHIVE;

Commenting out "use" and making the "require" statement active gives
   Bareword "ARCHIVE" not allowed while "strict subs" in use at ...

Also included above, commented out, is an unscholarly attempt to use the 
"import" method, based on a Perl Cookbook recipe, but (a) it gives the 
same error, and (b) the constants are exported automatically by 
Win32::File without being specified, so I shouldn't have to code 
"import" anyway.

-- 

Henry Law       <><     Manchester, England


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

Date: 24 Sep 2006 14:39:29 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Help with "require" and importing constants
Message-Id: <1159133969.193132.154780@d34g2000cwd.googlegroups.com>


Henry Law wrote:
> There's an easy answer to this, I'm sure, but an hour of Googling and
> experimenting has not led me to it.  Can someone help?
>
> I need to include the module Win32::File if my code is running on
> Windows, but not on Linux.  Job for the "require" statement, I thought.
> The module exports a set of constants (ARCHIVE being my example), but
> not, apparently, when "require" is used.  How do I code this simple thing?

Simply change ARCHIVE to Win32::File::ARCHIVE().

i.e. full name, because require() doesn't call import() and make it
explicit to the compiler that you are talking about a function because
it can't know if you didn't load the module during the compilation
phase.

> Code that does what I want on a Win32 system:
> #! /usr/bin/perl
> use strict; use warnings;
> use Win32::File;
> #require Win32::File;
> #Win32::File->import qw(ARCHIVE);
> printf "Archive constant from Win32::File: %x\n", ARCHIVE;
>
> Commenting out "use" and making the "require" statement active gives
>    Bareword "ARCHIVE" not allowed while "strict subs" in use at ...
>
> Also included above, commented out, is an unscholarly attempt to use the
> "import" method, based on a Perl Cookbook recipe, but (a) it gives the
> same error,

You get the error because you are trying to rely on information to
travelling backwards in time. (A technique also known as the
"temporally global variable"). You want the compiler to know (during
the compilation phase) that the bare word ARCHIVE (without a ()) is a
to be compiled as a function call but you are not loading the module
that declares that function until _after_ the compilation phase.

> and (b) the constants are exported automatically by
> Win32::File without being specified,

Er no, It is Win32::File->import that doing the exporting. Your phrasse
"without being specified" in this context mean "even if the argument
list passed to Win32::File->import() is empty".

If you do call Win32::File->import then you can write ARCHIVE() rather
than needing to say Win32::File::ARCHIVE().

>  so I shouldn't have to code  "import" anyway.

perldoc -f use

Note that use() is eqivalent to require and import in a BEGIN {} block.



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

Date: Sun, 24 Sep 2006 21:47:25 GMT
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: Help with "require" and importing constants
Message-Id: <N1DRg.47920$uH6.20584@twister.nyroc.rr.com>

Henry Law wrote:
 ...
> I need to include the module Win32::File if my code is running on 
> Windows, but not on Linux.  Job for the "require" statement, I thought. 
> The module exports a set of constants (ARCHIVE being my example), but 
> not, apparently, when "require" is used.  How do I code this simple thing?
 ...
To tell what your platform is, check out:

    perldoc perlvar

particularly the section about $^O

Something like:

   BEGIN{if($^O eq 'MSWin32'){require Win32::File;import Win32::File;}}
   use Data::Dumper;
   print Dumper(ARCHIVE);

might work.  On my Win32 system, this prints '32'.  If I change MSWin32 
to something else, it prints 'ARCHIVE', indicating that the module did 
not load.
-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


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

Date: Sun, 24 Sep 2006 21:48:48 +0000 (UTC)
From: Hemant Shah <shah@typhoon.xnet.com>
Subject: Re: How identify if more than one option is specified?
Message-Id: <ef6ug0$gsl$1@new7.xnet.com>

While stranded on information super highway Chris Mattern wrote:
> In article <ef16de$non$1@new7.xnet.com>, Hemant Shah wrote:
>>
>>Folks,
>>
>>  Is there a easy way to find out if more than one option is specified.
>>
>>  Example:
>>
>>  use Getopt::Std;
>>  getopts(abc);
>>  if ($opt_a || $opt_b || $opt_c) {}
>>
>>  I only want user to specify one of the options (either -a or -b -or -c). 
>>  How do I easily check if they have specified more than one option.
>>
>>  I can write "if" statement as follows:
>>
>>  if (($opt_a && $opt_b && $opt_c) ||
>>       ($opt_a && $opt_b) ||
>>       ($opt_b && $opt_c) ||
>>       ($opt_a && $opt_c))
>>  {
>>     # print error message.
>>  }
>>
>>  This could get ugly if the number of possible options is greater than 3.
>>
>>  Is there an easier way?
>>
>>  Thanks.
>>
> 
> Sure.  Just count heads.
> 
> my $arg_count=0;
> $arg_count++ if $opt_a;
> $arg_count++ if $opt_b;
> $arg_count++ if $opt_c;
> 
> if ($arg_count != 1) {
>   die "You dummy, pick one and only one!"; }

 Thanks. That would work for me.

> 
> -- 
>              Christopher Mattern
> 
> "Which one you figure tracked us?"
> "The ugly one, sir."
> "...Could you be more specific?"

-- 
Hemant Shah                           /"\  ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com       \ /  --------------------- 
                                       X     against HTML mail
TO REPLY, REMOVE NoJunkMail           / \      and postings      
FROM MY E-MAIL ADDRESS.           
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind,                Above opinions are mine only.
it's backed up on tape somewhere.      Others can have their own.


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

Date: Sun, 24 Sep 2006 21:55:50 +0000 (UTC)
From: Hemant Shah <shah@typhoon.xnet.com>
Subject: Re: How identify if more than one option is specified?
Message-Id: <ef6ut6$gsl$2@new7.xnet.com>

While stranded on information super highway "Mumia W. (reading news)" wrote:
> On 09/22/2006 12:27 PM, Hemant Shah wrote:
>> Folks,
>> 
>>   Is there a easy way to find out if more than one option is specified.
>> 
>>   Example:
>> 
>>   use Getopt::Std;
>>   getopts(abc);
>>   if ($opt_a || $opt_b || $opt_c) {}
>> 
>>   I only want user to specify one of the options (either -a or -b -or -c). 
>>   How do I easily check if they have specified more than one option.
>> 
>>   I can write "if" statement as follows:
>> 
>>   if (($opt_a && $opt_b && $opt_c) ||
>>        ($opt_a && $opt_b) ||
>>        ($opt_b && $opt_c) ||
>>        ($opt_a && $opt_c))
>>   {
>>      # print error message.
>>   }
>> 
>>   This could get ugly if the number of possible options is greater than 3.
>> 
>>   Is there an easier way?
>> 
>>   Thanks.
>> 
> 
> Put the results in a hash and count the number of keys in the hash like so:
> 
>      use Getopt::Std;
>      my %opts;
>      getopts ('abc', \%opts);
> 
>      if (keys %opts > 1) {
>          print "More than one option was given.\n";
>      }
> 
> __HTH__

Thanks, this would also work for me, but I liked the one where I keep
the count of the arguments. This woulsd not work in another script I have
where it has combination of optional and mandatory options.

Example:  [-dvhs] {-A | -B | -C}

Where -d, -v, -h and -s are optional, but the user must specify one and only 
one of -A, -B and -C.


> 
> -- 
> paduille.4058.mumia.w@earthlink.net

-- 
Hemant Shah                           /"\  ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com       \ /  --------------------- 
                                       X     against HTML mail
TO REPLY, REMOVE NoJunkMail           / \      and postings      
FROM MY E-MAIL ADDRESS.           
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind,                Above opinions are mine only.
it's backed up on tape somewhere.      Others can have their own.


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

Date: 24 Sep 2006 19:22:55 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: tying db records and other objects, speed?
Message-Id: <slrnehdmod.40l.abigail@alexandra.abigail.be>

Oobi Van Doobi (skimba@dambo.di) wrote on MMMMDCCLXXII September MCMXCIII
in <URL:news:U_xRg.19108$HR7.19105@reader1.news.jippii.net>:
\\  Abigail wrote:
\\  
\\ > Oobi Van Doobi (skimba@dambo.di) wrote on MMMMDCCLXXII September MCMXCIII
\\ > in <URL:news:lCqRg.18783$Au2.16784@reader1.news.jippii.net>:
\\ > %%  Hi,
\\ > %%  have some issues regarding tying of db records.
\\ > %%  I have the past few days done a class/package that tie's a database
\\ > record
\\ > %%  to a hash. I am very happy with this solution, as I can just take the
\\ > CGI
\\ > %%  params and put them into the hash, and voila they are in the database.
\\ > %%
\\ > %%  But:What about speed? Could some kind soul please advice a little if
\\ > this
\\ > %%  (tie'ing records like this) is a good thing to do, or if I should take
\\ > %%  another route.
\\ > 
\\ > How can we tell? Only you know whether the speed of a choosen solution
\\ > is acceptable. We already know speed isn't your number one priority -
\\ > otherwise you wouldn't have picked Perl to implement it in.
\\ > 
\\ > %%  Background to the project:
\\ > %%  1)web application
\\ > %%  2)mod_perl to some extent
\\ > %%  3)number of users only about 5-10
\\ > %%  4)using MySQL
\\ > 
\\ > Yes, and?
\\ > 
\\ > 
\\ > 
\\ > Abigail
\\  ah, perl vs java or cobol or C++? or something else?


No.


Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


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

Date: Mon, 25 Sep 2006 09:36:42 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Zero equals pipe??
Message-Id: <45171793$0$5110$afc38c87@news.optusnet.com.au>


"Bob Walton" <see.sig@rochester.rr.com> wrote in message
news:NryRg.55491$8j3.26370@twister.nyroc.rr.com...
> Sisyphus wrote:
> > <ilya2@rcn.com> wrote in message
> > .
> > .
> >> if ( '0' == '|')  {  ... another statement ... }
> >>
> >
> > Any string that begins with numeric characters will be assigned the
numeric
> > value of those numeric characters. Hence:
> >
> > '1' == 1
> > '0' == 0
> > '1234' == 1234
> > '1234garbage' == 1234
> > '12garbage34' == 12
> >
> > But any string that begins with a non-numeric character will be assigned
a
> > numeric value of 0.Hence:
> >
> > 'garbage1234' == 0
> > '|' == 0
> >
> > From that you can see that '0' == '|' will evaluate as true since 0 ==
0.
> >
> > (This is documented somewhere .... but damned if I could find it in a
hurry
> > :-)
>
> That would be in
>
>     perldoc perlop
>
> in the "Equality Operators" section.
>

I was trying to track down the documentation that details the way in which
perl converts strings to numbers. The account I provided is probably not so
bad .... if you consider the first '.' found in any string to be a
"numerical character" :-)

I've possibly made other oversights, too.

Cheers,
Rob




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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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


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