[31232] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2477 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 14 16:09:47 2009

Date: Sun, 14 Jun 2009 13:09:07 -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, 14 Jun 2009     Volume: 11 Number: 2477

Today's topics:
        DBI - get hostname? <ghaslbe@gmx.de>
    Re: DBI - get hostname? <ghaslbe@gmx.de>
        new CPAN modules on Sun Jun 14 2009 (Randal Schwartz)
    Re: reading a select form from perl <uri@StemSystems.com>
    Re: regex problem sln@netherlands.com
    Re: regex problem <cwilbur@chromatico.net>
    Re: require from autoload module <marc.girod@gmail.com>
    Re: require from autoload module <marc.girod@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 14 Jun 2009 10:50:27 +0200
From: Gerhard Haslberger <ghaslbe@gmx.de>
Subject: DBI - get hostname?
Message-Id: <h12dki$gd$1@online.de>

hi,
i want to know any Info (at least the hostname) of my dbi-connection?

Is that possible?
I cant find any informations at the docu?

Why?
I have 2 (1 read/write  and 1 read-only) and i want to write seperate 
logfiles for any of them so i want to use the hostname for that.

Ideas?
Thanks!


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

Date: Sun, 14 Jun 2009 11:08:25 +0200
From: Gerhard Haslberger <ghaslbe@gmx.de>
Subject: Re: DBI - get hostname?
Message-Id: <h12em9$18e$1@online.de>

found it myself

$db->get_info(13) = Localhost via UNIX socket


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

Date: Sun, 14 Jun 2009 04:42:31 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Jun 14 2009
Message-Id: <KL7p2w.tLG@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.

Archive-Tar-1.52
http://search.cpan.org/~kane/Archive-Tar-1.52/
module for manipulations of tar archives 
----
CPANPLUS-0.87_02
http://search.cpan.org/~kane/CPANPLUS-0.87_02/
API & CLI access to the CPAN mirrors 
----
CPANPLUS-Dist-Build-0.34
http://search.cpan.org/~bingos/CPANPLUS-Dist-Build-0.34/
CPANPLUS plugin to install packages that use Build.PL 
----
CatalystX-CRUD-0.45
http://search.cpan.org/~karman/CatalystX-CRUD-0.45/
CRUD framework for Catalyst applications 
----
CatalystX-CRUD-Model-RDBO-0.21
http://search.cpan.org/~karman/CatalystX-CRUD-Model-RDBO-0.21/
Rose::DB::Object CRUD 
----
CatalystX-CRUD-ModelAdapter-DBIC-0.09
http://search.cpan.org/~karman/CatalystX-CRUD-ModelAdapter-DBIC-0.09/
CRUD for Catalyst::Model::DBIC::Schema 
----
CatalystX-Component-Traits-0.01
http://search.cpan.org/~rkitover/CatalystX-Component-Traits-0.01/
Automatic Trait Loading and Resolution for Catalyst Components 
----
Chart-Clicker-2.34
http://search.cpan.org/~gphat/Chart-Clicker-2.34/
Powerful, extensible charting. 
----
Data-Dumper-2.124
http://search.cpan.org/~smueller/Data-Dumper-2.124/
stringified perl data structures, suitable for both printing and eval 
----
DateTime-Format-Natural-0.76_04
http://search.cpan.org/~schubiger/DateTime-Format-Natural-0.76_04/
Create machine readable date/time with natural parsing logic 
----
DateTime-Format-Sybase-0.01
http://search.cpan.org/~rkitover/DateTime-Format-Sybase-0.01/
Parse and format Sybase datetimes 
----
DateTime-Format-Sybase-0.02
http://search.cpan.org/~rkitover/DateTime-Format-Sybase-0.02/
Parse and format Sybase datetimes 
----
Email-Send-2.197
http://search.cpan.org/~rjbs/Email-Send-2.197/
Simply Sending Email 
----
Event-Lite-0.005
http://search.cpan.org/~johnd/Event-Lite-0.005/
Distributed Event Broadcast System for Perl 
----
Grades-0.04
http://search.cpan.org/~drbean/Grades-0.04/
A collocation of homework, classwork and exams 
----
HTML-FormWidgets-0.5.184
http://search.cpan.org/~pjfl/HTML-FormWidgets-0.5.184/
Create HTML form markup 
----
IO-AIO-3.22
http://search.cpan.org/~mlehmann/IO-AIO-3.22/
Asynchronous Input/Output 
----
IO-AIO-3.23
http://search.cpan.org/~mlehmann/IO-AIO-3.23/
Asynchronous Input/Output 
----
IPC-SRLock-0.3.125
http://search.cpan.org/~pjfl/IPC-SRLock-0.3.125/
Set/reset locking semantics to single thread processes 
----
Interpolation-0.73
http://search.cpan.org/~jenda/Interpolation-0.73/
Arbitrary string interpolation semantics (using tie()) 
----
Module-Build-0.33_01
http://search.cpan.org/~dagolden/Module-Build-0.33_01/
Build and install Perl modules 
----
MooseX-Workers-0.06_99
http://search.cpan.org/~jhannah/MooseX-Workers-0.06_99/
Provides a simple sub-process management for asynchronous tasks. 
----
Muldis-D-0.79.0
http://search.cpan.org/~duncand/Muldis-D-0.79.0/
Formal spec of Muldis D relational DBMS lang 
----
Nagios-Plugin-OverHTTP-0.08
http://search.cpan.org/~dougdude/Nagios-Plugin-OverHTTP-0.08/
Nagios plugin to check over the HTTP protocol. 
----
Net-Amazon-0.53
http://search.cpan.org/~boumenot/Net-Amazon-0.53/
Framework for accessing amazon.com via REST 
----
Net-GitHub-0.18
http://search.cpan.org/~fayland/Net-GitHub-0.18/
Perl Interface for github.com 
----
Net-IMAP-Simple-1.1899_04
http://search.cpan.org/~jettero/Net-IMAP-Simple-1.1899_04/
Perl extension for simple IMAP account handling. 
----
NetHack-Monster-Spoiler-0.03
http://search.cpan.org/~sorear/NetHack-Monster-Spoiler-0.03/
information on a type of monster 
----
Object-Simple-2.0004
http://search.cpan.org/~kimoto/Object-Simple-2.0004/
Light Weight Minimal Object System 
----
PDL-Graphics-OpenGL-Perl-OpenGL-0.01_05
http://search.cpan.org/~chm/PDL-Graphics-OpenGL-Perl-OpenGL-0.01_05/
v0.01_03 Perl OpenGL (POGL) module for PDL to display 3D data using OpenGL, FreeGLUT/GLUT, and GLX 
----
Parse-ExuberantCTags-1.00
http://search.cpan.org/~smueller/Parse-ExuberantCTags-1.00/
Efficiently parse exuberant ctags files 
----
Politics-AU-Geo-0.01
http://search.cpan.org/~adamk/Politics-AU-Geo-0.01/
An ORLite-based ORM Database API 
----
Script-Carp-0.03
http://search.cpan.org/~ktat/Script-Carp-0.03/
provide some way to leave messages when script died 
----
Sort-SQL-0.04
http://search.cpan.org/~karman/Sort-SQL-0.04/
manipulate SQL sort strings 
----
Sort-SQL-0.05
http://search.cpan.org/~karman/Sort-SQL-0.05/
manipulate SQL sort strings 
----
Test-Warn-0.11_01
http://search.cpan.org/~chorny/Test-Warn-0.11_01/
Perl extension to test methods for warnings 
----
Text-Chomped-0.02
http://search.cpan.org/~rkrimen/Text-Chomped-0.02/
A chomp and chop that will return the chomped and chopped 
----
Text-Median-0.01
http://search.cpan.org/~lmetcalf/Text-Median-0.01/
Perl extension for determining the set median of a set of strings 
----
Vote-1.00
http://search.cpan.org/~nanardon/Vote-1.00/
Catalyst based application 
----
XHTML-Instrumented-0.09
http://search.cpan.org/~gam/XHTML-Instrumented-0.09/
packages to control XHTML 
----
XHTML-Instrumented-0.091
http://search.cpan.org/~gam/XHTML-Instrumented-0.091/
packages to control XHTML 
----
XHTML-Instrumented-0.092
http://search.cpan.org/~gam/XHTML-Instrumented-0.092/
packages to control XHTML 
----
jmx4perl-0.20_3
http://search.cpan.org/~roland/jmx4perl-0.20_3/
JMX acccess tools and modules 


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/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Sat, 13 Jun 2009 20:07:31 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: reading a select form from perl
Message-Id: <87tz2jzni4.fsf@quad.sysarch.com>

>>>>> "TJM" == Tad J McClellan <tadmc@seesig.invalid> writes:

  TJM> Uri Guttman <uri@StemSystems.com> wrote:

  >> the only issue i hear is the closing token

  TJM> An issue I had meant to mention but forgot was:

  TJM> Here-docs can easily morph into a "templating system", and applying
  TJM> "system" to here-docs isn't something that I am able to do with
  TJM> a straight face.

and that happened to me. i started with a basic hash and s/// technique
using various strings including here docs. it evolved to something more
complex and when it hit 37 lines i had a neat little templater. the next
step was cpanning it into template::simple and it is now bloated to 150
lines!

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Sat, 13 Jun 2009 16:21:03 -0700
From: sln@netherlands.com
Subject: Re: regex problem
Message-Id: <etc835l0s2lb55ti8fmscf8ojafjoa4u6p@4ax.com>

On Sat, 13 Jun 2009 02:11:44 -0700, sln@netherlands.com wrote:

>On Fri, 12 Jun 2009 12:20:05 -0700 (PDT), sstark <sstark@us.ibm.com> wrote:
>
>>Hi all, I know I will be told that I should be using one of the HTML
>>or XML parsers to perform this task, and you're right! :-) but still
>>I'd like to know why my little regex while() loop isn't working.
>>
>>Here's a sample XHTML code snippet that I'm working on:
>>
>>[code]<pre>
>><li>description <a href="overview_mh.html#overview">(1)</a>, <a
>>href="catalog.html#catalog">(2)</a>
>></pre>[code]
>>
>>My goal:
>>
>>1. Read a line of an XHTML file.
>>2. If it contains an href= attribute, grab everything up to the
>>opening href quote and print it out to a file.
>>3. Read the href attribute itself, change it and print the changed
>>version out to the file.
>>4. Delete everything from the beginning of the line up to the closing
>>quote of the href attribute.
>>5. Check to see if there's another href on the line; if so, repeat. If
>>not, print out the rest to the file.
>>
>>Here's a code snippet:
>>
>>[code]<pre>
>>   while($line =~ /^(.*?href\s*=\s*\")([^\"]+)(\".*)/i){	#"
>                                    ^     ^     ^
>Don't need to escape these dbl quotes.
>and you probably need /is at the end.
>plus there doesen't seem to be a need to have capture #3
>or the .* in #3's group since it looks like your buffering
>$line .= <DATA> somewhere. If so, the line will always contain
>the remainder after substitution and pos() will always be reset.
>I could be wrong.
>
>>    my $prev =$1;
>>    my $href =$2;
>>    print NEW $prev;
>>    # do some stuff to the href
>>    # ...
>>    print NEW $href;
>>    # remove both $prev and $href from $line and continue
>>    print "VALUE OF prev: $prev\n";
>>    print " BEFORE: $line";
>>    $line =~ s/^$prev//;
>>    print " AFTER: $line";
>>    $line =~ s/^$href//;
>>   }
>>  print $line;
>></pre>[/code]
>>
>>For some reason, the s/^$prev//; isn't working; The result looks
>>something like this:
>>
>>VALUE OF prev: ">(1)</a>, <a href="
>>BEFORE: ">(1)</a>, <a href="catalog.html#catalog">(2)</a>
>>AFTER: ">(1)</a>, <a href="catalog.html#catalog">(2)</a>
>>
>>Why isn't it deleting the value of $prev in $line?
>>
>>Meanwhile, yes I'm looking at one of the parsers.
>>
>>thanks,
>>Scott
>
>Somebody already mentioned the parenths metachars as a
>pattern in the substitution. So thats your problem.
>
>However, it might be less expensive if you slurped in the
>whole file and avoid the substitution altogether. But, the
>substitution is a easy buffering mechanism, albeit expensive
>on time.
>
Better written as:

use strict;
use warnings;

# /(?:(.*?href\s*=\s*)(["'])(.*?)\2)|(.+)/isg

my $line = join ( '', <DATA>);
my $count = 1;

while( 	$line =~ /
	  (?:
	    (.*?href\s*=\s*)  # $1  all up to the next and including href=
		(["'])        # $2  " or '  (1+2 = prev)
		   (.*?)      # $3  attribute value  (unquoted)
		\2            # what $2 is (" or ')
	  )
	    |     # or
	  (.+) # $4  the remainder (no more href)
	/xisg)
{
	print "Pass ".$count++.":\n------------\n";
	if (defined $1) {
		print "prev:\n".$1.$2."\n";	# previous plus quote, print to file
		print "val:\n".$3."\n";		# unquoted href value, modify & print to file
		print "end:\n".$2."\n";		# closing quote, print to file
	}
	if (defined $4) {
		print "final:\n".$4."\n";	# remainder, no hrefs, print to file
	}
}


__DATA__
<pre>
<li>description <a href="overview_mh.html#overview">(1)</a>,
<a href="catalog.html#catalog">(2)</a>
</pre>



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

Date: Sun, 14 Jun 2009 15:26:16 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: regex problem
Message-Id: <86k53ewraf.fsf@mithril.chromatico.net>

>>>>> "BM" == Ben Morrow <ben@morrow.me.uk> writes:

    BM> Quoth Charlton Wilbur <cwilbur@chromatico.net>:
    >> >>>>> "s" == sstark <sstark@us.ibm.com> writes:

    BM> [ sstark's code was

    BM>     $line =~ s/^$prev//;

    BM> ]

    s> Why isn't it deleting the value of $prev in $line?

    >> Because ^ doesn't do what you think it does, and it only works in
    >> the code you have there out of pure luck and coincidence.

    BM> Please explain further. ^ means 'match at the beginning of the
    BM> string', unless /m is given, in which case it means 'match at
    BM> the beginning of any line'. How is this not what the OP thought
    BM> it meant?

Because the strings he wants are at the start of the strings he's
looking at purely by accident -- it's not part of his specification.

Charlton

-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: Sun, 14 Jun 2009 04:08:28 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: require from autoload module
Message-Id: <d5210d90-19ab-4f2b-8068-8b51e3c8bbb9@w40g2000yqd.googlegroups.com>

On Jun 13, 9:39=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:

> Not with require (that's sort-of the point).

Thanks (and to A. Sinan Unur).
This helpped to clean up my code.

Marc


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

Date: Sun, 14 Jun 2009 04:13:22 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: require from autoload module
Message-Id: <de6d8d8c-d622-4a75-a772-ea05963ee04d@f19g2000yqo.googlegroups.com>

On Jun 13, 8:24=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:

> What do you have to change to get it to stop working?

Without the import, I had to use 'no AutoLoad'
to call the function from the required module.

I guess I don't anymore, but I'll verify it only later.
Thanks.
Marc


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

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


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