[24271] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6462 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 25 18:05:40 2004

Date: Sun, 25 Apr 2004 15: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, 25 Apr 2004     Volume: 10 Number: 6462

Today's topics:
        [ANNOUNCE] SPOPSx::Ginsu (inheritance for SPOPS) <rz10@cornell.edu>
        ANN: CamelBones 0.2.3 <spamtrap@dot-app.org>
    Re: autobox <tassilo.parseval@rwth-aachen.de>
    Re: noob question: Trying to extract part of a string i <tadmc@augustmail.com>
    Re: noob question: Trying to extract part of a string i <tadmc@augustmail.com>
    Re: noob question: Trying to extract part of a string i <tadmc@augustmail.com>
    Re: Object method and file handle creates "bareword" er <mirod@xmltwig.com>
    Re: Pipe outputs response to browser <tadmc@augustmail.com>
    Re: Pipe outputs response to browser <robin @ infusedlight.net>
    Re: Pipe outputs response to browser <e01@removethis.toao.net>
    Re: Please Recommend A Good Perl Book. <shailesh@nothing.but.net>
    Re: slurp not working? ideas please! <tassilo.parseval@rwth-aachen.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 24 Apr 2004 01:48:19 GMT
From: Ray Zimmerman <rz10@cornell.edu>
Subject: [ANNOUNCE] SPOPSx::Ginsu (inheritance for SPOPS)
Message-Id: <Hwqsz4.1J58@zorch.sf-bay.org>

The uploaded file

    SPOPSx-Ginsu-0.57.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/Z/ZM/ZMAN/SPOPSx-Ginsu-0.57.tar.gz
  size: 66975 bytes
   md5: 7b6f18bc0d1f8a7ecb8612c909d61632


SPOPSx::Ginsu (which began its life as ESPOPS) stands for SPOPS 
eXtension for Generalized INheritance SUpport. It is a Perl object 
oriented persistence tool. To put it in the context of the other tools 
summarized at (http://poop.sourceforge.net/) it essentially adds some of 
Tangram's functionality to SPOPS.

SPOPS::DBI implements an inherited persistence mechanism for classes 
whose objects are each stored as a row in a single database table. Each 
class has its own table and all of the persistent fields are stored in 
that table. Ginsu extends this implementation to handle subclassing of 
such objects, including polymorphic retrieval. The fields of a given 
object are stored across several database tables, one for each parent 
class with persistent fields. A Ginsu object is simply an SPOPS::DBI 
object stored across multiple database tables.

Ginsu and SPOPS also differ in the usage style. With standard SPOPS, 
classes are typically created at runtime from configuration files and 
any code for the classes is imported from a separate code class. With 
Ginsu, each class looks like a standard Perl class, with its own .pm 
file containing the class's code. The BEGIN block includes variables 
containing the SPOPS configuration data for the class. To use a Ginsu 
class, you simply 'use' it as you would any other Perl class.

Currently, Ginsu has only been tested with MySQL, since that's what we 
use. It should be fairly easy to make it work with any database SPOPS 
supports, but that has not become a priority for my own use.

Any help with any of the following development tasks is appreciated.
 - making Ginsu database independent
 - fixing some of the SPOPS functionality that we've broken or ignored in
   Ginsu (security, lazy loading, database independence, strict fields)
 - integrating Ginsu functionality into the SPOPS core
 - implementing the enhanced object relationship configuration


--
Ray Zimmerman
Director, Laboratory for Experimental Economics and Decision Research
428-B Phillips Hall, Cornell University, Ithaca, NY 14853
phone:  (607) 255-9645       fax: (815) 377-3932




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

Date: Sun, 25 Apr 2004 19:17:22 GMT
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: ANN: CamelBones 0.2.3
Message-Id: <HwqszI.1J69@zorch.sf-bay.org>

CamelBones is a framework for writing GUI apps using the Cocoa API for Mac
OS X.

Version 0.2.3 is now available for downloading on SourceForge. This is
mostly a bug-fix and packaging release, although there are some new
additions such as threading support.

The "Fat Camel" package of is a new option with CamelBones 0.2.3. This
package includes everything in the CamelBones-Dev package, plus compiled
binaries for Perl 5.8.4 and the DBI, DBD::mysql, and Mac::Carbon modules
from CPAN.

The CamelBones home page is at:
        <http://camelbones.sourceforge.net>

Read more about the 0.2.3 release at:
        <http://camelbones.sourceforge.net/delta_2_3.php>

Read more about the "Fat Camel" package at:
        <http://camelbones.sourceforge.net/download/fat-install.php>

sherm--




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

Date: Sun, 25 Apr 2004 22:37:44 +0200
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: autobox
Message-Id: <c6h7ir$c13tc$1@ID-231055.news.uni-berlin.de>

Also sprach Michele Dondi:

> On 21 Apr 2004 20:57:06 GMT, "Tassilo v. Parseval"
><tassilo.parseval@rwth-aachen.de> wrote:
> 
>>You find the complete thread starting with this article here:
>>
>>    http://tinyurl.com/3cegc
> 
> TY, I've read it at length: hope they will change their mind first or
> later! BTW: since it has not been mentioned in that thread, but it has
> here, what goes on with qr//?!? i.e., does it return a *blessed*
> refence into Regexp or does perl just fake it has? 

It's a real blessed object with some qr-specific magic attached to it.

> Also, I'd like to know what those objecting that autoboxing is not
> consistent with current Perl's semantics think about this particular,
> isolated, instance of autoboxing...

The discussion following the suggested patch was IMO not very rational.
The main reason against it appeared to be that it reminded some people
of pseudo-hashes. However, they weren't really able to give any evidence
for potential problems that could arise from it. Those examples that
were given did in fact turn out to be false alarm.

I don't know, maybe it should be put onto the agenda once again. I
wouldn't expect much from it, though. I also have the impression that the
birth of ponie has made it more difficult to get new features into Perl
as people now say that one should wait for perl5.12. This happened to me
anyway when I proposed to extend the tie() interface with stuff like
SUBSTR, INDEX etc. for which I provided an outline on how this could be
implemented.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Sun, 25 Apr 2004 12:59:30 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: noob question: Trying to extract part of a string in a variable to another variable
Message-Id: <slrnc8nv42.m6m.tadmc@magna.augustmail.com>

Jürgen Exner <jurgenex@hotmail.com> wrote:

> Just use grouping:
> 
> my $mail_address = 'fred jones <fred_jones@somewhere.com>';
> $mail_address =~ /(\w+)@/;
> print $1;


But don't use it like that!

You should never use the dollar-digit variables without first ensuring
that the match *succeeded*.

   if ( $mail_address =~ /(\w+)@/ ) {
      print $1;
   }


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sun, 25 Apr 2004 13:01:41 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: noob question: Trying to extract part of a string in a variable to another variable
Message-Id: <slrnc8nv85.m6m.tadmc@magna.augustmail.com>

Milo Minderbinder <noMail@fmail.com> wrote:

[ snip full-quote, please don't do that]

> you have to mark the part you want to get.
> 
> $mail_address =~ m/(\w+?)@/;
> $name = $1;
> 
> Take brackets to mark what you want. You will find the result in $1.
                                           ^^^^
                                           ^^^^

No, you *might* find the result in $1.

If you've tested that the match *succeeded*, 
_then_ you will find the result in $1.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sun, 25 Apr 2004 13:02:38 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: noob question: Trying to extract part of a string in a variable to another variable
Message-Id: <slrnc8nv9u.m6m.tadmc@magna.augustmail.com>

Web Surfer <raisin@delete-this-trash.mts.net> wrote:

> $mail_address =~ /(\w+)@/;
> $userid = $1;


What is with this epidemic of teaching the WRONG way in this thread?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sun, 25 Apr 2004 22:57:37 +0200
From: Michel Rodriguez <mirod@xmltwig.com>
Subject: Re: Object method and file handle creates "bareword" error.  How to code?
Message-Id: <c6h3mp$mas$1@news-reader4.wanadoo.fr>

Uri Guttman wrote:
>>>>>>"GJ" == Glenn Jackman <xx087@freenet.carleton.ca> writes:
> 
> 
>   GJ> The XML::Twig docs show:
>   GJ>      print            ($optional_filehandle, %options)
>   GJ>          Prints the whole document associated with the twig. To
>   GJ>          be used only AFTER the parse.
> 
>   GJ> Oh, perhaps the filehandle is optional but the options are mandatory.
>   GJ> In that case add an empty hash to the end:
> 
>   GJ>     $fd->print($xmlout, ());
> 
> that is no different from $fd->print($xmlout). the called method
> couldn't tell the diff from those two calls.
> 
> and they are called 'options' so they are optional :)

Indeed, the options are optional!

The problem in the initial post was to use XMLOUT instead of \*XMLOUT to 
pass the filehandle to the sub, and then to check the return of print, 
which doesn't return anything meaningfull.

-- 
Michel Rodriguez
Perl &amp; XML
http://www.xmltwig.com



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

Date: Sun, 25 Apr 2004 13:03:52 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Pipe outputs response to browser
Message-Id: <slrnc8nvc8.m6m.tadmc@magna.augustmail.com>

Experienced but Undocumented <e01@removethis.toao.net> wrote:

> Are there any better ways?  My mailing list is about 100 people and could
> potentially grow to 5-600.


   use Mail::Bulkmail;


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sun, 25 Apr 2004 11:24:44 -0700
From: "Robin" <robin @ infusedlight.net>
Subject: Re: Pipe outputs response to browser
Message-Id: <c6h0vq$cdf$1@reader2.nmix.net>


"Experienced but Undocumented" <e01@removethis.toao.net> wrote in message
news:fQKic.8316$en3.4090@edtnps89...
> I'm using the following script which outputs the response from the SMTP
> server to the browser.  What should I do to make it work silently?  Using
> PERL 5.6.1 on Redhat Linux 7.3.
> Thanks
>
>
>
> open(MAIL, "|/usr/sbin/sendmail -bs") or die "Could not launch Mailer";
>
> print MAIL "HELO LONGLOSTFRIEND\n";
> print MAIL "MAIL FROM: $mailfrom\n";
> print MAIL "$rcpt_to";
> print MAIL "DATA\n";
> print MAIL "From: $from\n";
> print MAIL "Reply-to: $replyto\n";
> print MAIL "Bcc:\n";
> print MAIL "Subject: $subject\n";
> print MAIL "\n";
> print MAIL "$message\n";
> print MAIL ".\n";
> print MAIL "QUIT\n";
>
> close MAIL;

die usually doesn't output to the browser, you have to trap it with an eval
call or something like that. If you want to say:

open(MAIL, "|/usr/sbin/sendmail -bs") or print "Content-Type:text/html\n\n",
"Error, I dunno about die calls yet, and neither does Robin" and exit; #the
output.

That'd probably do what you want to do.
-Robin





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

Date: Sun, 25 Apr 2004 18:31:11 GMT
From: "Experienced but Undocumented" <e01@removethis.toao.net>
Subject: Re: Pipe outputs response to browser
Message-Id: <PtTic.9693$en3.7262@edtnps89>

"Robin" <robin @ infusedlight.net> wrote
> die usually doesn't output to the browser, you have to trap it with an
eval
> call or something like that. If you want to say:
>
> open(MAIL, "|/usr/sbin/sendmail -bs") or print
"Content-Type:text/html\n\n",
> "Error, I dunno about die calls yet, and neither does Robin" and exit;
#the
> output.


The script actually isn't dying; it runs, but the browser gets output like
the following, which is what I want to avoid.

220-server ESMTP Exim 4.24 #1 Sun, 25 Apr 2004 14:27:02 -0400
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
250 server Hello user at TEST
250 OK
250 Accepted
354 Enter message, ending with "." on a line by itself
250 OK id=2BHaoLG-00423-Si
221 SERVE closing connection




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

Date: Sun, 25 Apr 2004 18:34:14 GMT
From: Shailesh <shailesh@nothing.but.net>
Subject: Re: Please Recommend A Good Perl Book.
Message-Id: <GwTic.20620$Gp.17975@fe1.columbus.rr.com>

This book takes a really hands-on, task-oriented approach, and has 
lots of examples.  I would highly recommend it.

"Perl Black Book: The Most Comprehensive Perl Reference Available Today"
http://www.amazon.com/exec/obidos/ASIN/1576104656/somacon-20

This book concisely summarizes Perl features:

"Perl in a Nutshell"
http://www.amazon.com/exec/obidos/ASIN/0596002416/somacon-20


Being an experienced (non-Perl) programmer myself, I have been able to 
get by with the above two books, the newsgroup, and the perldoc 
documentation.  The first book I use when I need some example code to 
get something working quickly, and the second book I use for reference 
when I need to look up some regular expression syntax or a specific 
function call.  The Nutshell book is easier to use on my desk as a 
reference, because it is lightweight. However, if I were to own one 
book, I would own the Perl Black Book.  Neither of these books is for 
newbie programmers who don't understand things like control structures 
and functions.


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

Date: Sun, 25 Apr 2004 22:12:50 +0200
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: slurp not working? ideas please!
Message-Id: <c6h644$c18o7$1@ID-231055.news.uni-berlin.de>

Also sprach Geoff Cox:

> On 25 Apr 2004 04:55:42 GMT, "Tassilo v. Parseval"
><tassilo.parseval@rwth-aachen.de> wrote:
> 
>>  package main;
>>    use IO::Handle;
>>
>>    open OUT, ">>results.htm" or die $!;
>>    OUT->autoflush(1);
> 
> Tassilo,
> 
> Sorry for the delay in replying. Have tried above but still get the
> wrong order!

That is somewhat unfortunate as the problem in question does not occur
when I run your code. It's a bit tricky to address a bug that is not
reproducible.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

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


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