[29534] in Perl-Users-Digest
Perl-Users Digest, Issue: 778 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 21 03:09:48 2007
Date: Tue, 21 Aug 2007 00:09:11 -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 Tue, 21 Aug 2007 Volume: 11 Number: 778
Today's topics:
Re: Gaa! UNIX hack tries PPM and fails! <bart.lateur@pandora.be>
Re: how to call sub by value in variable - SOLVED <mjcarman@mchsi.com>
Re: Mail::Sender problem <noreply@gunnar.cc>
new CPAN modules on Tue Aug 21 2007 (Randal Schwartz)
Re: Newbie Perl question <brian.d.foy@gmail.com>
Re: On redhat, different users = different @INC <brian.d.foy@gmail.com>
Re: Perl and JSP Saran.j.jegan@gmail.com
Re: Perl and JSP Saran.j.jegan@gmail.com
Re: Perl sum of array and help with sorting <davechunny@gmail.com>
Re: simple perl regex question <steve.logan@gmail.com>
Re: Stumped: returning a read pipe from a function xhoster@gmail.com
Re: Symbolic representation of logical operators <bart.lateur@pandora.be>
Re: Symrefs <brian.d.foy@gmail.com>
Re: Using Subroutines with CGI::Session::MySQL? <ljames@apollo3.com>
Re: Using Subroutines with CGI::Session::MySQL? xhoster@gmail.com
Re: Xah's Edu Corner: Under the spell of Leibniz's drea <trebla@vex.net>
Re: Xah's Edu Corner: Under the spell of Leibniz's drea <nepbabucxspamfree@yahoo.ca>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 21 Aug 2007 00:30:58 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Gaa! UNIX hack tries PPM and fails!
Message-Id: <p4ckc3tvjei156nj6e1kit5m917rkj31b8@4ax.com>
anno4000@radom.zrz.tu-berlin.de wrote:
>It appears that the tarball contains everything below blib/ and nothing
>else. I don't know how a PPM is supposed to work, but that doesn't look
>right. In any case it won't support a manual install.
Look at what else is in the PPD file, at
http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd
<INSTALL EXEC="PPM_PERL"
HREF="http://theoryx5.uwinnipeg.ca/ppms/scripts/install_ssl">install_ssl</INSTALL>
It points to a Perl script that needs to be executed at install time.
It searches for the library on your local computer first, and if not
found, downloads it from the repository..
--
Bart.
------------------------------
Date: Tue, 21 Aug 2007 01:44:54 GMT
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: how to call sub by value in variable - SOLVED
Message-Id: <qsryi.51804$Xa3.10507@attbi_s22>
On 8/20/2007 8:59 AM, Petr Vileta wrote:
>
> I prefer to _not_ use no strict 'refs'.
As long as you know what you're doing, and why, it's fine.
> The dispatch table is bad solution for me because now I have 10 subs in my
> script but in future I will have about hundreds of subs and dispatch table
> will be too huge. In other words - one man adding data to database and I'm
> writing new subs when I get message from my error log ;-)
I'm not sure I follow this. If you have to write the subroutine anyway why is it
a problem to add one line to a dispatch table?
If you put all of the subs into a separate package you could generate the
dispatch table at runtime. (Although in this case symrefs would work just as well.)
-mjc
------------------------------
Date: Tue, 21 Aug 2007 01:58:56 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Mail::Sender problem
Message-Id: <5iuo6bF3qgfv0U1@mid.individual.net>
jis wrote:
> I wrote a program to send email. It looks as below
>
> use strict;
> use Mail::Sender;
<snip>
> This works fine for me without any issues.
> I converted this script to exe using p2x-8.80-Win32.It gave warnings
> initially with
> 1. Config file missing.
> 2. Langinfo.pm missing.
> 3. Digest::Perl::MD5 missing
>
> I re installed Mail::Sender to make sure that there is a config file.
Did that really make a difference with respect to the config file
Perl2Exe complained about?
> I manually copied LangInfo.pm to the I18N folder under C:\\perl\\lib.
> ALso installed MD5 from cpan.
>
> I converted to exe without any warnings.
> But when I run exe it throws the error
> " -3Error Sending
> mail: Connect failed:An established connection was aborted by
> software
> in your host machine" . I do not have problems when I go back and run
> my perl file.
>
> I use Windows xp, Active perl 5.8.8 Build 820, Mail::sender 0.8.13
> I use p2x-8.80-Win32 to convert .pl to .exe.I did not have any
> problems while converting to exe before.Ofcourse I never used
> Mail::Sender before.
I know that Mail::Sender was written with conversion to .exe files in
mind, so it ought to be a good choice for the purpose.
Maybe you should try to get in touch with the Mail::Sender author.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Tue, 21 Aug 2007 04:42:20 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Tue Aug 21 2007
Message-Id: <Jn3x2K.1FDE@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
App-Grepl-0.01
http://search.cpan.org/~ovid/App-Grepl-0.01/
PPI-powered grep
----
Authen-Prepare-0.03
http://search.cpan.org/~dnarayan/Authen-Prepare-0.03/
Prepare a set of authentication credentials
----
Authen-Prepare-0.04
http://search.cpan.org/~dnarayan/Authen-Prepare-0.04/
Prepare a set of authentication credentials
----
Catalyst-Action-RenderView-ErrorHandler-0.0105
http://search.cpan.org/~andremar/Catalyst-Action-RenderView-ErrorHandler-0.0105/
Custom errorhandling in deployed applications
----
Catalyst-Plugin-RequestToken-0.05
http://search.cpan.org/~hide/Catalyst-Plugin-RequestToken-0.05/
Handling transaction token for Catalyst
----
Catalyst-View-Mason-0.12
http://search.cpan.org/~flora/Catalyst-View-Mason-0.12/
Mason View Class
----
Catalyst-View-Reproxy-0.05
http://search.cpan.org/~zigorou/Catalyst-View-Reproxy-0.05/
Reproxing View for lighty and perlbal.
----
Class-ReturnValue-0.55
http://search.cpan.org/~jesse/Class-ReturnValue-0.55/
A return-value object that lets you treat it as as a boolean, array or object
----
Class-Trigger-0.12
http://search.cpan.org/~miyagawa/Class-Trigger-0.12/
Mixin to add / call inheritable triggers
----
Clutter-0.410
http://search.cpan.org/~ebassi/Clutter-0.410/
Simple GL-based canvas library
----
Config-Properties-1.67
http://search.cpan.org/~salva/Config-Properties-1.67/
Read and write property files
----
Crypt-AllOrNothing-Util-0.07
http://search.cpan.org/~zandet/Crypt-AllOrNothing-Util-0.07/
Util functions for Crypt::AllOrNothing
----
Crypt-AllOrNothing-Util-0.08
http://search.cpan.org/~zandet/Crypt-AllOrNothing-Util-0.08/
Util functions for Crypt::AllOrNothing
----
DBD-Unify-0.65
http://search.cpan.org/~hmbrand/DBD-Unify-0.65/
DBI driver for Unify database systems
----
Data-Hexdumper-1.3
http://search.cpan.org/~dcantrell/Data-Hexdumper-1.3/
Make binary data human-readable
----
DateTime-TimeZone-0.67
http://search.cpan.org/~drolsky/DateTime-TimeZone-0.67/
Time zone object base class and factory
----
Devel-PPPort-3.11_04
http://search.cpan.org/~mhx/Devel-PPPort-3.11_04/
Perl/Pollution/Portability
----
Devel-PPPort-3.11_05
http://search.cpan.org/~mhx/Devel-PPPort-3.11_05/
Perl/Pollution/Portability
----
Device-Jtag-USB-FTCJTAG-0.10
http://search.cpan.org/~tdeitrich/Device-Jtag-USB-FTCJTAG-0.10/
Perl extension for communicating with JTAG devices using the FTDI FTCJTAG driver.
----
File-GetLineMaxLength-1.01
http://search.cpan.org/~robm/File-GetLineMaxLength-1.01/
Get lines from a file, up to a maximum line length
----
File-Path-2.00_09
http://search.cpan.org/~dland/File-Path-2.00_09/
Create or remove directory trees
----
Flickr-Simple-0.01
http://search.cpan.org/~sneak/Flickr-Simple-0.01/
Perl object library for manipulating Flickr data via the Flickr API
----
Games-Dissociate-0.19
http://search.cpan.org/~avif/Games-Dissociate-0.19/
a Dissociated Press algorithm and filter
----
HTML-WebDAO-0.82
http://search.cpan.org/~zag/HTML-WebDAO-0.82/
Perl extension for create complex web application
----
IO-Pty-Easy-0.03
http://search.cpan.org/~doy/IO-Pty-Easy-0.03/
Easy interface to IO::Pty
----
Lingua-EN-Titlecase-0.01
http://search.cpan.org/~ashley/Lingua-EN-Titlecase-0.01/
Titlecasing of English words by traditional editorial rules.
----
Lingua-EN-Titlecase-0.02
http://search.cpan.org/~ashley/Lingua-EN-Titlecase-0.02/
Titlecasing of English words by traditional editorial rules.
----
Lingua-EN-Titlecase-0.03
http://search.cpan.org/~ashley/Lingua-EN-Titlecase-0.03/
Titlecasing of English words by traditional editorial rules.
----
Lingua-ZH-Segment-0.02
http://search.cpan.org/~clsung/Lingua-ZH-Segment-0.02/
Chinese Text Segmentation
----
Log-Trivial-0.30
http://search.cpan.org/~atrickett/Log-Trivial-0.30/
Very simple tool for writing very simple log files
----
Net-SFTP-Foreign-1.29
http://search.cpan.org/~salva/Net-SFTP-Foreign-1.29/
Secure File Transfer Protocol client
----
POE-Component-Jabber-2.02
http://search.cpan.org/~nperez/POE-Component-Jabber-2.02/
A POE Component for communicating over Jabber
----
Pushmi-v1.0.0
http://search.cpan.org/~clkao/Pushmi-v1.0.0/
Subversion repository replication tool
----
Rcs-Agent-1.05
http://search.cpan.org/~nickh/Rcs-Agent-1.05/
an RCS archive manipulation method library
----
TAP-Harness-Archive-0.01
http://search.cpan.org/~wonko/TAP-Harness-Archive-0.01/
Create an archive of TAP test results
----
WWW-Search-Ebay-2.231
http://search.cpan.org/~mthurn/WWW-Search-Ebay-2.231/
backend for searching www.ebay.com
----
WebService-Recruit-HotPepper-0.01
http://search.cpan.org/~bashi/WebService-Recruit-HotPepper-0.01/
perl interface for HotPepper Web Service
----
Win32-Snarl-0.01
http://search.cpan.org/~aberndt/Win32-Snarl-0.01/
Perl extension for blah blah blah
----
Win32-Snarl-0.02
http://search.cpan.org/~aberndt/Win32-Snarl-0.02/
Perl extension for Snarl notifications
----
Win32-Snarl-0.03
http://search.cpan.org/~aberndt/Win32-Snarl-0.03/
Perl extension for Snarl notifications
----
XML-Flow-0.83
http://search.cpan.org/~zag/XML-Flow-0.83/
Store (restore) perl data structures in XML stream.
----
pler-0.22
http://search.cpan.org/~adamk/pler-0.22/
The DWIM Perl Debugger
----
pler-0.23
http://search.cpan.org/~adamk/pler-0.23/
The DWIM Perl Debugger
----
pler-0.24
http://search.cpan.org/~adamk/pler-0.24/
The DWIM Perl Debugger
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
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: Mon, 20 Aug 2007 15:52:35 -0700
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: Newbie Perl question
Message-Id: <200820071552350175%brian.d.foy@gmail.com>
In article <1187550251.984577.255710@i38g2000prf.googlegroups.com>,
Zachary Turner <divisortheory@gmail.com> wrote:
> Hello,
>
> I'm just learning Perl and I'm going through a book and there was an
> exercise in one of the chapters to write a simple subroutine to add up
> all the values that were passed as arguments. Simple enough, I
> implemented this as follows:
>
> sub total {
> my $sum;
>
> foreach (@_) {
> $sum += $_;
> }
> return $sum;
> }
>
> However, in the same chapter it says that if you do not put a return
> statement, the return value of the function is the result of the last
> calculation that occured in the function. So to test this I deleted
> the "return $sum;" line from the function. When the return line was
> there, it returned the correct value. Without that line, it appears
> to return undef.
We say in that chapter that the return value would be the "last
evaluated expression", not the last calculation. When you omit the
'return $sum', you have to decide what the last evaluated expression
is. It turns out that it's not the stuff inside the loop, but something
that foreach does on the final go around.
If you're coming out of a looping structure, don't think that the last
evaluated expression in the one in its block. For instance, consider a
while loop:
while( $foo++ < 10 ) {
$sum += $foo;
}
The last evaluated expression is always false because the last
expression is the one in the conditional. Perl has to evaluate that to
see if it should loop again. The condition is the last evaluated
expression, not the line with $sum.
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: Mon, 20 Aug 2007 16:54:26 -0700
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: On redhat, different users = different @INC
Message-Id: <200820071654262850%brian.d.foy@gmail.com>
In article <1187636434.682093.27920@19g2000hsx.googlegroups.com>, Russ
<russell.brooks@perdue.com> wrote:
> We have RedHat 4EL and perl 5.8.5. Per a user's request I installed
> Date:Simple, using perl -MCPAN -e shell
> as the root user.
> Now root can find Date::Simple, but other users cannot. They do not
> want to include a lib statement in their scripts or invoke with a -I.
> The @INC libraries are close, but not identical.
Where did you install it? Simply being a root user doesn't mean it
installed it in the common Perl directories. The CPAN.pm config can set
options for Makefile.PL, and so on.
Have you inspected the @INC? I'd be curious to see how it differs
between users, or if this one user had puroposedly modified his @INC to
contain the libraries he knew Date::Simple would be in.
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: Tue, 21 Aug 2007 05:27:48 -0000
From: Saran.j.jegan@gmail.com
Subject: Re: Perl and JSP
Message-Id: <1187674068.111902.101340@e9g2000prf.googlegroups.com>
On Aug 20, 8:29 pm, xhos...@gmail.com wrote:
> Saran.j.je...@gmail.com wrote:
> > Hello,
>
> > we have developed an web based application for monitoring
> > and controlling some machines using Java & JSP in apache tomcat, now
> > we have planned to replace some java programs such as serial port
> > communications and socket level communication with CGI scripts using
> > perl & c , Hope it will be faster than old java codes,
>
> I see no reason to think that a *good* Perl implementation would be faster
> than a *good* Java implementation. And for sockets, I would expect that
> the bottleneck is at the system level anyway (or at least, I assume that if
> the bottleneck wasn't at the system level, it wouldn't be related to the
> sockets in the first place, but at what you are using the sockets to do,
> and since you specifically mention sockets and not what you are using the
> sockets to do....), and so even C probably wouldn't make much of a
> difference.
>
> > Am in need to
> > know inserting CGI is advisable and whether it will be faster &
> > reliable, can any suggest your experience in similar cases
>
> You can write slow and unreliable code in any language.
>
> My Perl-CGI tends to be more reliable than the JSP I've seen, and when
> speed was considered an important design criteria, my CGI were generally
> faster than the equivalent JSP I've seen. I suspect that this is largely
> because I'm a better programmer than the people writing the JSPs are. Some
> of it may be that with Perl's flexibility and speed-of-programming, I could
> try various techniques and choose the best one, while that is more
> difficult with JSP (at least for me).
>
> For some kinds of things, achieving high performance will require mod_perl
> rather than Perl CGI, so if you are unwilling to use mod_perl or its
> equivalent than that is one check for JSP. Also, if you are using Windows
> servers, I think that would be another check for JSP.
>
> But mostly it comes down to asking yourself what language are your best
> programmers best at programming?
-----------
Ofcourse Your points are more obvious ,we are in plan to make
the code to run in both windows and linux,let we see the difference ,
i think it will be a good experimental one , thanks for your time
------------------------------
Date: Tue, 21 Aug 2007 05:42:53 -0000
From: Saran.j.jegan@gmail.com
Subject: Re: Perl and JSP
Message-Id: <1187674973.248608.294390@x35g2000prf.googlegroups.com>
On Aug 21, 10:27 am, Saran.j.je...@gmail.com wrote:
> On Aug 20, 8:29 pm, xhos...@gmail.com wrote:
>
> > Saran.j.je...@gmail.com wrote:
> > > Hello,
>
> > > we have developed an web based application for monitoring
> > > and controlling some machines using Java & JSP in apache tomcat, now
> > > we have planned to replace some java programs such as serial port
> > > communications and socket level communication with CGI scripts using
> > > perl & c , Hope it will be faster than old java codes,
>
> > I see no reason to think that a *good* Perl implementation would be faster
> > than a *good* Java implementation. And for sockets, I would expect that
> > the bottleneck is at the system level anyway (or at least, I assume that if
> > the bottleneck wasn't at the system level, it wouldn't be related to the
> > sockets in the first place, but at what you are using the sockets to do,
> > and since you specifically mention sockets and not what you are using the
> > sockets to do....), and so even C probably wouldn't make much of a
> > difference.
>
> > > Am in need to
> > > know inserting CGI is advisable and whether it will be faster &
> > > reliable, can any suggest your experience in similar cases
>
> > You can write slow and unreliable code in any language.
>
> > My Perl-CGI tends to be more reliable than the JSP I've seen, and when
> > speed was considered an important design criteria, my CGI were generally
> > faster than the equivalent JSP I've seen. I suspect that this is largely
> > because I'm a better programmer than the people writing the JSPs are. Some
> > of it may be that with Perl's flexibility and speed-of-programming, I could
> > try various techniques and choose the best one, while that is more
> > difficult with JSP (at least for me).
>
> > For some kinds of things, achieving high performance will require mod_perl
> > rather than Perl CGI, so if you are unwilling to use mod_perl or its
> > equivalent than that is one check for JSP. Also, if you are using Windows
> > servers, I think that would be another check for JSP.
>
> > But mostly it comes down to asking yourself what language are your best
> > programmers best at programming?
>
> -----------
>
Ofcourse Your points are more obvious ,we are in plan to make
the code to run in both windows and linux,
i think it will be a good experimental one ,certainly its going to be
implemented on a industrial PC which will be more compact one with XP
embedded and linux , so removing java fundas will give some space and
perl's flexibility will help a lot, as you said it also depends on the
programmers hands with the language
------------------------------
Date: Tue, 21 Aug 2007 00:47:01 -0000
From: elroyerni <davechunny@gmail.com>
Subject: Re: Perl sum of array and help with sorting
Message-Id: <1187657221.267184.116970@m37g2000prh.googlegroups.com>
On Aug 20, 2:56 pm, Paul Lalli <mri...@gmail.com> wrote:
> On Aug 20, 3:44 pm, elroyerni <davechu...@gmail.com> wrote:
>
>
>
> > Hi -
>
> > I have a array of a list of numbers:
>
> > 7.9216
> > 8.7583
> > 12.675
> > 0.8028
> > 6.9230
> > 1.1403
> > 6.0083
> > 0.1454
>
> > I wrote a sub-routine to add the list, but i'm getting these syntax
> > errors, and was wondering if someone could tell me what i'm doing
> > wrong. here's my code for the sub-routine:
> > sub sum_array {
> > my($sum) = 0; # initialize the sum to 0
> > foreach $i (@array_data) {
> > $sum = $sum + $i;
> > }
> > return($sum);
>
> > }
>
> > It's returning this error: isn't numeric in addition (+)
>
> Okay, first of all, that's a warning, not an error. In any event,
> basically this means your array's contents aren't what you think they
> are. You have at least one non-numeric element in that array. To see
> exactly what's in it, use these lines:
>
> use Data::Dumper;
> print Dumper(\@array_data);
>
>
>
> > Also I'm trying to write a sub-routine that will go through each
> > element in the array and tell me how many elements in the array are
> > less than a given value. For example in the array above say i want to
> > return the amount of elements that are less than 5 seconds. From the
> > array above I'd return 3.Here's what I have so far:
> > sub less_five {
> > foreach $r(@array_data){
> > count=0;
> > while ($count<5)
> > {
> > $count++;
>
> > }
> > }
> > return($data);
> > }
>
> > Cant seem to get this to work.
>
> Your logic on this one mystifies me. I don't at all understand what
> the while loop is supposed to do, nor do I understand where $data came
> from. This is a lot simpler than you're making it:
>
> sub less_five {
> my $count;
> foreach my $r (@array_data) {
> if ($r < 5) {
> $count++;
> }
> }
> return $count;
>
> }
>
> or, much more simply:
>
> my $count = grep { $_ < 5 } @array_data;
>
> Paul Lalli
Thanks for your help, that simplified things tremendously!!
------------------------------
Date: Mon, 20 Aug 2007 22:16:17 -0000
From: "steve.logan@gmail.com" <steve.logan@gmail.com>
Subject: Re: simple perl regex question
Message-Id: <1187648177.529263.161740@g4g2000hsf.googlegroups.com>
Wow - I need to read up on what some of that stuff does.
Thank you - it works like a charm!!
On Aug 20, 5:25 pm, Mirco Wahab <wa...@chemie.uni-halle.de> wrote:
> steve.lo...@gmail.com wrote:
> > Here's where I'm at - it runs ok, but the file isn't being updated:
> > perl -pi -e 's/\/([0-9]{10})([;])\//2007083100;/g' domain.com.db
> > I think I'm close here - maybe?
>
> Yes, hairs width (imho). But I've seen zone files with a \s in front
> of the ';' ...
>
> $> perl -i -pe 's/(?<!\d)\d{10}(?=\s*;)/2007083100/g' domain.com.db
>
> Regards
>
> M.
------------------------------
Date: 21 Aug 2007 03:42:24 GMT
From: xhoster@gmail.com
Subject: Re: Stumped: returning a read pipe from a function
Message-Id: <20070820234228.459$Zn@newsreader.com>
kj <socyl@987jk.com.invalid> wrote:
>
> use IPC::Open3 'open3';
> use IO::Unread 'unread';
Boy are you ever piling on the complications here.
>
> sub foo {
> my $pid =
> open3( my ( $wtr, $rdr, $err ), '/some/command', @_ );
>
> close $wtr;
>
> if ( defined ( my $first_line = <$rdr> ) ) {
> die $first_line if eof( $rdr );
> unread $rdr, $first_line;
> }
> return $rdr;
> }
>
> The oddity is that $err is not used! Inexplicably, if I use open3,
> errors appear via $rdr, not via $err, as one would expect.
From the docs:
If ERRFH is false, or the same file
descriptor as RDRFH, then STDOUT and STDERR of the child
are on the same filehandle.
In your case the newly my'ed $err, which is the argument in the ERRFH slot,
is false. Sad, but true.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Tue, 21 Aug 2007 00:38:54 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Symbolic representation of logical operators
Message-Id: <uvckc3l8psg3urnl4obei6mqn976gbrjlj@4ax.com>
Mark Hobley wrote:
>I am not looking for a bitwise operator, I am looking for a the
>symbolic form of a logical exclusive or to compliment the && and || operators,
There is none. You might have guessed that by now.
The logical choice would have been the double caret.
--
Bart.
------------------------------
Date: Mon, 20 Aug 2007 16:48:51 -0700
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: Symrefs
Message-Id: <200820071648512775%brian.d.foy@gmail.com>
In article <dtvic3hh7mc2f4nmrqugnr8t954g44rusj@4ax.com>, Michele Dondi
<bik.mido@tiscalinet.it> wrote:
> On Mon, 20 Aug 2007 11:59:05 +0200, Gunnar Hjalmarsson
> <noreply@gunnar.cc> wrote:
>
> >> The general rule is: don't use symrefs if you don't know what you're
> >> doing. But if you know what you're doing and you're doing it properly,
> >> then what's the problem.
> >
> >I'm not sure; Was rather referring to the numerous opinionated posters
> >in this group who basically say: "Do not use symrefs - they are bad".
>
> Yes of course: if you see the OP has no clue then you just tell her
> not to use symrefs, they're bad. It's a first order approximation.
My first approximation is "You can use symrefs yourself, but you can't
tell other people to use them".
This applies to everyone, not just to people who don't understand them.
:)
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: Tue, 21 Aug 2007 04:29:15 -0000
From: "L. D. James" <ljames@apollo3.com>
Subject: Re: Using Subroutines with CGI::Session::MySQL?
Message-Id: <1187670555.217946.275490@k79g2000hse.googlegroups.com>
On Aug 17, 10:14 pm, "Mumia W." <paduille.4061.mumia.w
+nos...@earthlink.net> wrote:
> This might be a bug in CGI::Session::MySQL (3.2.4.2). When a code block
> is exited, lexical variables within that block are supposed to become
> undefined; however, in CGI::Session::MySQL, this does not result in the
> session data being flushed back to the database.
>
> PS.
> As alternatives to "undef $session" for fixing the problem, one can use
> "$session->flush()" or "$session->close()" (at the end of the program).
Mumia, thanks again for all the research and discussion. There's a
definite difference between the behavior of the MySQL and File
driver. I was inclined to believe it was a bug in the MySQL driver.
I'm sure the File driver works properly.
I've been using MySQL for a long time with lots of applications.
MySQL doesn't normally act the way it does in CGI::Sessions:MySQL.
Neither does any of the other IO that I've use work that way.
I'm glad to have found some consistency. Now I have confidence in my
application. The bug is consistent and the workarounds works.
Reading the document, it says the "undef $session" isn't normally
necessary. However, from our studies it seems that it is always
necessary to undef, flush, or close the sessions.
It's been my experience (and reading the docs, you would expect it
would be consistent in this case) that the cleanup would be done upon
exit.
By the way, take a look at this code and tell me if you see anything
wrong with it. I don't see anything wrong with it. It works
perfectly on my machine and doesn't produce any errors. This is an
example of the way the many subroutines are called from my main
program.
With the workarounds that we have learned to overcome the bug, my
MySQL driver works like the File driver and like this fileio example.
Most of my actual programs use the BEGIN and use vars procedures at
the beginning of my main script. That is where the MySQL file is
actually open. Then all the other work is done by calling the various
subroutines.
I always run with Strict and warnings turned on and to insure the
integrity of my programs.
I appreciate all the discussion and suggestions from Xhoster. But at
present I can't produce an error that would suggest that my routines
request passing the public initialized variable to the subroutines.
The subroutines already have access.
The jury is still out, and I'm still taking my routines through very
stringent test.
Again, do you see a problem with the following code? If you don't see
a problem with it, how would you say it differs from the previous
code?
# ----- Code -----
#!/usr/local/bin/perl
use warnings;
use strict;
use CGI qw(:standard);
use Switch;
use CGI::Carp qw(fatalsToBrowser);
print header;
my $count;
if ( open (FILEIN,"testio.out") )
{
$count = <FILEIN> || "0";
close ( FILEIN );
}
open (FILEOUT,">testio.out") || die "Can't open output file...";
sub testio()
{
&menu1();
$count++;
print "<br>The Count: $count";
print FILEOUT "$count";
}
sub menu1()
{
print "<a href=testio.pl?cmd=testio>Testio<a>";
}
my $s = param('cmd') || $ARGV[0];
switch($s)
{
case "testio" { testio() }
else { menu1() }
}
close FILEOUT;
exit;
# ----- Code End -----
-- L. James
--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames
------------------------------
Date: 21 Aug 2007 05:18:09 GMT
From: xhoster@gmail.com
Subject: Re: Using Subroutines with CGI::Session::MySQL?
Message-Id: <20070821011814.008$ym@newsreader.com>
"L. D. James" <ljames@apollo3.com> wrote:
>
> It's been my experience (and reading the docs, you would expect it
> would be consistent in this case) that the cleanup would be done upon
> exit.
Sorry about that little digression/obsession with mod_perl. New theory,
same song, second verse. It is still based on your sub grabbing onto
lexicals which are outside of its scope. Since your sub is a global and it
holds a closure-like reference to the $session object, this prevents the
$session object from going out of scope, and hence from getting
its DESTROY method invoked, during the ref-counting part of perl's
shut-down. Instead, DESTROY gets invoked during "global destruction". The
problem is that during global destruction, DESTROY routines get called in
arbitrary order. So the $session's DESTROY invokes $session->flush, which
in turn invokes ->store on the underlying Session::Driver module, which
in turn tries to do the store with the mysql handle. However, that
mysql handle may have already been DESTROYed, and so the flush cannot
succeed. Why this doesn't give warning/error messages, I don't know.
If you do everything cleanly, meaning that named subs don't access lexicals
defined outside their scopes, then $session will be DESTROYed during the
ref-counting stage of shut-down. That means that anything which
DESTROY needs in order to operate correctly will still exist.
Or just add "undef $session" at the end.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Mon, 20 Aug 2007 18:22:19 -0400
From: "Albert Y. C. Lai" <trebla@vex.net>
Subject: Re: Xah's Edu Corner: Under the spell of Leibniz's dream
Message-Id: <fad46v02kb8@news3.newsguy.com>
Twisted wrote:
> A link to a copy in a non-toxic format would be nice.
http://www.cs.utexas.edu/users/EWD/transcriptions/EWD12xx/EWD1298.html
------------------------------
Date: Tue, 21 Aug 2007 08:36:21 +0930
From: Bikal KC <nepbabucxspamfree@yahoo.ca>
Subject: Re: Xah's Edu Corner: Under the spell of Leibniz's dream
Message-Id: <46ca1e65$1_3@news.chariot.net.au>
Ingo Menger wrote:
> On 20 Aug., 01:56, Xah Lee <x...@xahlee.org> wrote:
>
>> (for you math illiterates out there: ...
>> (for you mathematicians out there: ...
>
> Please, Xah Lee, could you possibly stop to "explain" things that are
> absolutely trivial? If somebody has doubts about the etymology of a
> word, he may use the dictionary, or he could ask.
>
>
I used usenet years ago then stopped for couple of years. I remember
seeing him/her on c.l.perl I believe doing the same thing he/she is
doing atm. I'd say the ultimate usenet superstar. Wow!
------------------------------
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 V11 Issue 778
**************************************