[30651] in Perl-Users-Digest
Perl-Users Digest, Issue: 1896 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 3 03:09:45 2008
Date: Fri, 3 Oct 2008 00:09:08 -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 Fri, 3 Oct 2008 Volume: 11 Number: 1896
Today's topics:
Re: Basic pattern matching - baffled xhoster@gmail.com
Can I use a function ref to call a function in a web sc <cartercc@gmail.com>
Re: Can I use a function ref to call a function in a we <ben@morrow.me.uk>
Re: Can I use a function ref to call a function in a we <ced@blv-sam-01.ca.boeing.com>
Re: extracting strings from a text file <glex_no-spam@qwest-spam-no.invalid>
Re: Handling Huge Data xhoster@gmail.com
Re: Handling Huge Data <glex_no-spam@qwest-spam-no.invalid>
Re: Handling Huge Data <nospam-abuse@ilyaz.org>
is Win32::GUI thread safe? <starbuck42+newsgroup@gmail.com>
new CPAN modules on Fri Oct 3 2008 (Randal Schwartz)
Proxy in perl <bhasin@pacbell.net>
Re: Proxy in perl <ben@morrow.me.uk>
Re: Question about regex (nagios plugin) <xml.devel@gmail.com>
Re: Sybase::CTLib ct_connect problem somyasharma@gmail.com
Re: sysopen - die only if EBUSY? <ben@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 02 Oct 2008 16:04:54 GMT
From: xhoster@gmail.com
Subject: Re: Basic pattern matching - baffled
Message-Id: <20081002120456.139$7E@newsreader.com>
Xainin <63f2-oyik@dea.spamcon.org> wrote:
> Help! I don't understand why this script:
>
> #!perl -w
>
> $a = 'C:\WINDOWS';
> $b = 'C:\WINDOWS';
>
> if ( $a =~ /^$b$/i ) {
> print "matched '$a' to '$b'\n";
> }
> else {
> print "UNMATCHED '$a' vs. '$b'\n";
> }
\W is special in a regex.
>
> $ta = quotemeta "$a";
$a is not used as a regex, it is treated as a literal string. Protecting
characters special to regexes in something not used that way is
counterproductive.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Thu, 2 Oct 2008 11:50:19 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: Can I use a function ref to call a function in a web script?
Message-Id: <f6bedf31-6a22-4c59-882d-5f7b9c8f58b2@q9g2000hsb.googlegroups.com>
Can I assign a function to a scalar as a ref in a module file and call
the function by using the scalar in a heredoc?This is for a web app. I
have three components, a module, a CGI script, and a database. This is
a front end to a database which runs select, update, insert, and
delete queries and displays the results.
I have a bunch of standard functions in the module, such as
print_header(), print_footer(), print_link(), connect_to_database(),
etc., along with some global variables.
I have a CGI script that starts off like this:
use CGI;
use DBI;
use WebModule;
And mostly consists of a heredocs that output pure html.
And I have a database (Postgres).
The CGI script contains mostly forms for passing data to the
database. I'm using heredocs to spit out the html. I'm finding that I
am repeating a bunch of code, six times now, which looks like this:
<td><select name="postype">
<option>Classified</option>
<option>Faculty</option>
<option>Lecturer</option>
<option>PartTime</option>
<option>Professional</option>
<option>RFP</option>
<option>Vacant</option>
</select>
</td>
I can create a function that prints this to the html document, but
that involves ending the heredoc, calling the function, and then
starting the heredoc, like this:
print <<form;
<!-- pure html -->
form
print_select_element_in_form();
print <<form;
<!-- more pure html -->
form
Here is the question: Can I assign this function to a scalar ref in my
module file and call the function by using the scalar in the heredoc?
I'm slightly frustrated as I have spent most of the morning in a
futile attempt to do this (and I'm sure that I'm making some stupid
mistake, or maybe it can't be done.)
TIA, CC.
------------------------------
Date: Thu, 2 Oct 2008 20:30:26 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Can I use a function ref to call a function in a web script?
Message-Id: <i3kfr5-94b1.ln1@osiris.mauzo.dyndns.org>
Quoth cartercc <cartercc@gmail.com>:
> Can I assign a function to a scalar as a ref in a module file and call
> the function by using the scalar in a heredoc?This is for a web app.
<snip>
>
> The CGI script contains mostly forms for passing data to the
> database. I'm using heredocs to spit out the html. I'm finding that I
> am repeating a bunch of code, six times now, which looks like this:
> <td><select name="postype">
> <option>Classified</option>
> <option>Faculty</option>
> <option>Lecturer</option>
> <option>PartTime</option>
> <option>Professional</option>
> <option>RFP</option>
> <option>Vacant</option>
> </select>
> </td>
>
> I can create a function that prints this to the html document, but
> that involves ending the heredoc, calling the function, and then
> starting the heredoc, like this:
>
> print <<form;
> <!-- pure html -->
> form
> print_select_element_in_form();
> print <<form;
> <!-- more pure html -->
> form
>
> Here is the question: Can I assign this function to a scalar ref in my
> module file and call the function by using the scalar in the heredoc?
> I'm slightly frustrated as I have spent most of the morning in a
> futile attempt to do this (and I'm sure that I'm making some stupid
> mistake, or maybe it can't be done.)
If the repeated HTML really is the same every time you can simply assign
it to a variable and interpolate that, but I guess you've worked that
out. Otherwise, the only way to interpolate random expressions is the
rather ugly
@{ [ print_select_element_in_form() ] }
which calls the function (in list context), builds an anon array out of
the results, and then interpolates that array.
You would be *much* better off using a real template system, with your
HTML in separate files from your code. It sounds to me like
HTML::Template would fit your needs nicely; if you need more power the
usual tool is Template.
Ben
--
Heracles: Vulture! Here's a titbit for you / A few dried molecules of the gall
From the liver of a friend of yours. / Excuse the arrow but I have no spoon.
(Ted Hughes, [ Heracles shoots Vulture with arrow. Vulture bursts into ]
'Alcestis') [ flame, and falls out of sight. ] ben@morrow.me.uk
------------------------------
Date: Thu, 2 Oct 2008 16:54:15 -0700 (PDT)
From: "C.DeRykus" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Can I use a function ref to call a function in a web script?
Message-Id: <83ffabce-daf8-4f1f-ba93-cc886217ddf1@b1g2000hsg.googlegroups.com>
On Oct 2, 11:50 am, cartercc <carte...@gmail.com> wrote:
> Can I assign a function to a scalar as a ref in a module file and call
> the function by using the scalar in a heredoc?This is for a web app. I
> have three components, a module, a CGI script, and a database. This is
> a front end to a database which runs select, update, insert, and
> delete queries and displays the results.
>
> I have a bunch of standard functions in the module, such as
> print_header(), print_footer(), print_link(), connect_to_database(),
> etc., along with some global variables.
>
> I have a CGI script that starts off like this:
> use CGI;
> use DBI;
> use WebModule;
> And mostly consists of a heredocs that output pure html.
>
> And I have a database (Postgres).
>
> The CGI script contains mostly forms for passing data to the
> database. I'm using heredocs to spit out the html. I'm finding that I
> am repeating a bunch of code, six times now, which looks like this:
> <td><select name="postype">
> <option>Classified</option>
> <option>Faculty</option>
> <option>Lecturer</option>
> <option>PartTime</option>
> <option>Professional</option>
> <option>RFP</option>
> <option>Vacant</option>
> </select>
> </td>
>
> I can create a function that prints this to the html document, but
> that involves ending the heredoc, calling the function, and then
> starting the heredoc, like this:
>
> print <<form;
> <!-- pure html -->
> form
> print_select_element_in_form();
> print <<form;
> <!-- more pure html -->
> form
>
> Here is the question: Can I assign this function to a scalar ref in my
> module file and call the function by using the scalar in the heredoc?
> I'm slightly frustrated as I have spent most of the morning in a
> futile attempt to do this (and I'm sure that I'm making some stupid
> mistake, or maybe it can't be done.)
>
Not much easier on the eyes but
you could pare down to a single
print with a stacked heredoc:
print <<FORM, func(), <<FORM;
foo bar
FORM
bat boom
FORM
--
Charles DeRykus
------------------------------
Date: Thu, 02 Oct 2008 17:06:42 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: extracting strings from a text file
Message-Id: <48e545f3$0$89869$815e3792@news.qwest.net>
Andry wrote:
>> Andry wrote:
>>> Hi,
>>> I have a text file captured from an SSH session.
>>> Each line of the text looks like this (opened with VI editor):
>> ***********************************************************************************> -rw-r--r-- 1 root root 2389787 Sep 30 10:45 ^[[00mfilename.pl^[[00m
>>
>> **********************************************************************************> As you can see a lot of spurious/control/special characters are shown
>>> (in VI editor).
>>> I need to extract just the filenames at the end of each line (getting
[...]
If you don't need any of the 'long' output, why not use
the correct option to 'ls' in the first place?
------------------------------
Date: 02 Oct 2008 17:06:20 GMT
From: xhoster@gmail.com
Subject: Re: Handling Huge Data
Message-Id: <20081002130622.531$I6@newsreader.com>
"John W. Krahn" <jwkrahn@shaw.ca> wrote:
> Vishal G wrote:
> > Hello Guys,
> >
> > Thanks for your advice and sorry for being so vague...
> >
> > In simple words if I have this code...
> >
> > my $unitlength = 3;
> > my $dnaLength = 100000000;
> >
> > my $A = sprintf("%3d", 0) x $dnaLength;
> > my $C = sprintf("%3d", 0) x $dnaLength;
> > my $G = sprintf("%3d", 0) x $dnaLength;
> > my $T = sprintf("%3d", 0) x $dnaLength;
> > my $I = sprintf("%3d", 0) x $dnaLength;
>
> Why not just:
>
> my $A = '000' x $dnaLength;
> my $C = '000' x $dnaLength;
> my $G = '000' x $dnaLength;
> my $T = '000' x $dnaLength;
> my $I = '000' x $dnaLength;
>
> Or even:
>
> my $A = my $C = my $G = my $T = my $I = '000' x $dnaLength;
Or better yet:
my %h;
$h{$_}='000' x $dnaLength foreach qw/A C G T I/;
Or, because $num is numbers:
$h{$_}='000' x $dnaLength foreach 1..5;
This cuts the memory use almost in half, as each of the lexicals instances
of '000' x $dnaLength takes up memory and doesn't seem to release it.
> > # Assign quality information of DNA
> > print "DNA Processing";
> > my ($num, $qual);
> > for (my $i = 0; $i < $dnaLength; $i++) {
> > $num = int(rand(5)) + 1;
> > $qual = int(rand(99)) + 1;
> >
> > if ($num == 1) {
> > # Base A at position $i with base quality $qual
> > substr($A, $i * $unitlength, $unitlength, sprintf("%$
> > {unitlength}d", $qual));
replace the ugly switch statement with:
substr($h{$num}, $i * $unitlength, #....
> > print "Member Processing\n";
> > my ($start, $stop);
> > for (my $j = 0; $j < 50000; $j++) {
> > # Start and Stop of memeber with respect to DNA
> > $start = int(rand($dnaLength - 2000)) + 1; # Member start with
> > respect to DNA
> > $stop = $dnaLength; # Finish at end
Shouldn't it finish at its own end, $start+2000-1, not at the main sequence
end?
> > if ($num == 1) {
> > $qual = $qual + int( substr($A, $i * $unitlength,
> > $unitlength) );
This too could be replaced by $h{$num} in the substr and getting rid of
the big if blocks.
...
> >
> > I ran this code and it consumes around 3.0 GB of memory...
>
> You are running out of memory because when you add the numbers together
> they are sometimes longer than $unitlength which causes the strings to
> expand.
>
> $ perl -le'printf "%3d\n", 900 + 800'
> 1700
This is truly a problem, but it is a correctness problem. In my hands
it leads to almost no size inflation. The way he stores data, the minimum
possible size would be 1.5e9 bytes, (5*3*1e8) and the way the x operator
works inflates that to 3e9 bytes if you have 5 literal instances of it.
> >
> > Is there any other way to store the information using less memory.
I've show how to cut it almost in half (but you will need to increase
$unitlength unless you want to get wrong answers or lose data, which will
cost you more space.)
But the real answer is not to store the entire set in RAM at all.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Thu, 02 Oct 2008 13:46:09 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Handling Huge Data
Message-Id: <48e516f1$0$33223$815e3792@news.qwest.net>
Vishal G wrote:
> Hi Guys,
>
> I am trying to edit some bioinformatic package written in perl which
> was written to handle DNA sequence of about 500,000 base long (a
> string containg 500000 chrs)..
[...]
If you haven't read it yet, this might be useful:
http://www.perl.com/pub/a/2003/09/10/bioinformatics.html
------------------------------
Date: Fri, 3 Oct 2008 03:41:16 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Handling Huge Data
Message-Id: <gc448s$1tr9$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
John W. Krahn
<jwkrahn@shaw.ca>], who wrote in article <_pZEk.3778$eZ6.1353@newsfe14.iad>:
> my $A = my $C = my $G = my $T = my $I = '000' x $dnaLength;
For best results, use
my $I = '000';
$I x= $dnaLength;
my $A = my $C = my $G = my $T = $I;
(otherwise '000' x $dnaLength is computed at compile time, and remains
in the compiled tree).
And do not have anything "large" as a last statement of a subroutine -
unless you want it to be duplicated to create a return value of the
subroutine.
Hope this helps,
Ilya
------------------------------
Date: Thu, 02 Oct 2008 23:36:16 -0400
From: "Tom F." <starbuck42+newsgroup@gmail.com>
Subject: is Win32::GUI thread safe?
Message-Id: <gc43vi$rqi$1@aioe.org>
I've been working on a script for a little while now
It's a program that will periodically log me into my campus's content
filtering device (Barracuda). Of course, it makes sense to implement
some sort of timeout handling, just in case I lose the net connection or
happen to have my laptop somewhere else.
Here's the problem: the script keeps crashing with the following message:
Free to wrong pool 3d9b108 not 1981c78 at C:/Perl/site/lib/Win32/GUI.pm
line 3480 during global destruction.
the crazy thing is, no GUI element is changed during the spot where I
split into threads and then re-join into one. through the use of print
statements, I've narrowed it down to the statement where I join a thread.
(2 threads: 1 timer, 1 do-er; if the timer is ready but the do-er isn't,
then kill it)
and it happens no matter which thread is joined!
I've tested all the net stuff without the GUI (but using threads) and it
works fine. So, that leads me to think Win32::GUI is not thread safe,
and the mere presence of any of the different GUI objects is causing my
problem.
Google has only revealed very old information and other dead ends. Help!
------------------------------
Date: Fri, 3 Oct 2008 04:42:22 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Fri Oct 3 2008
Message-Id: <K85BqM.479@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.
Acme-Magic-Pony-0.01
http://search.cpan.org/~jlavallee/Acme-Magic-Pony-0.01/
Schwern asked for a Magic Pony!
----
B-Hooks-OP-Check-0.02
http://search.cpan.org/~flora/B-Hooks-OP-Check-0.02/
Wrap OP check callbacks
----
Beanstalk-Client-1.00
http://search.cpan.org/~gbarr/Beanstalk-Client-1.00/
Client class to talk to beanstalkd server
----
Beanstalk-Client-1.0000
http://search.cpan.org/~gbarr/Beanstalk-Client-1.0000/
Client class to talk to beanstalkd server
----
Catalyst-Authentication-Store-FromSub-Hash-0.07
http://search.cpan.org/~fayland/Catalyst-Authentication-Store-FromSub-Hash-0.07/
A storage class for Catalyst Authentication using one Catalyst Model class (hash returned)
----
Catalyst-Authenticaton-Store-Htpasswd-1.002
http://search.cpan.org/~bobtfish/Catalyst-Authenticaton-Store-Htpasswd-1.002/
----
Catalyst-Plugin-DebugCookie-0.999002
http://search.cpan.org/~jgoulah/Catalyst-Plugin-DebugCookie-0.999002/
Catalyst plugin to turn on debug when a secure cookie and a query param are set
----
Catalyst-Plugin-PageCache-0.20
http://search.cpan.org/~agrundma/Catalyst-Plugin-PageCache-0.20/
Cache the output of entire pages
----
Catalyst-Plugin-PageCache-0.21
http://search.cpan.org/~agrundma/Catalyst-Plugin-PageCache-0.21/
Cache the output of entire pages
----
Clutter-0.820
http://search.cpan.org/~ebassi/Clutter-0.820/
Simple GL-based canvas library
----
Combine-3.9
http://search.cpan.org/~aardo/Combine-3.9/
Focused Web crawler framework
----
Coro-4.8
http://search.cpan.org/~mlehmann/Coro-4.8/
coroutine process abstraction
----
Crypt-SMIME-0.09
http://search.cpan.org/~mikage/Crypt-SMIME-0.09/
S/MIME message signing, verification, encryption and decryption 1
----
Data-Valve-0.00010
http://search.cpan.org/~dmaki/Data-Valve-0.00010/
Throttle Your Data
----
Devel-Autoflush-0.04
http://search.cpan.org/~dagolden/Devel-Autoflush-0.04/
Set autoflush from the command line
----
Devel-Gladiator-0.01
http://search.cpan.org/~nuffin/Devel-Gladiator-0.01/
Walk Perl's arena
----
Dynamic-Loader-1.00
http://search.cpan.org/~alexmass/Dynamic-Loader-1.00/
call a script without to know where is his location.
----
Email-MessageID-1.400
http://search.cpan.org/~rjbs/Email-MessageID-1.400/
Generate world unique message-ids.
----
Enbugger-Restarts-0.01_03
http://search.cpan.org/~whitepage/Enbugger-Restarts-0.01_03/
Reach around in your stack and restart execution from arbitrary places
----
Foorum-0.2.7
http://search.cpan.org/~fayland/Foorum-0.2.7/
forum system based on Catalyst
----
Geo-Proj4-1.00
http://search.cpan.org/~markov/Geo-Proj4-1.00/
PROJ.4 cartographic projections library
----
HTML-CTPP2-2.3.11
http://search.cpan.org/~stellar/HTML-CTPP2-2.3.11/
Perl interface for CTPP2 library
----
HTML-Tested-0.41
http://search.cpan.org/~bosu/HTML-Tested-0.41/
Provides HTML widgets with the built-in means of testing.
----
HTML-Tested-ClassDBI-0.20
http://search.cpan.org/~bosu/HTML-Tested-ClassDBI-0.20/
Enhances HTML::Tested to work with Class::DBI
----
Helios-Panoptes-1.42
http://search.cpan.org/~lajandy/Helios-Panoptes-1.42/
CGI::Application providing web admin interface to Helios distributed job processing system
----
IO-AIO-3.1
http://search.cpan.org/~mlehmann/IO-AIO-3.1/
Asynchronous Input/Output
----
IPTables-IPv4-DBTarpit-0.40
http://search.cpan.org/~miker/IPTables-IPv4-DBTarpit-0.40/
----
Inline-Python-0.24
http://search.cpan.org/~nine/Inline-Python-0.24/
Write Perl subs and classes in Python.
----
Inline-Python-0.25
http://search.cpan.org/~nine/Inline-Python-0.25/
Write Perl subs and classes in Python.
----
LaTeX-Table-0.9.5
http://search.cpan.org/~limaone/LaTeX-Table-0.9.5/
Perl extension for the automatic generation of LaTeX tables.
----
MIKER-CPAN-ForceSmokerTest-0.001
http://search.cpan.org/~miker/MIKER-CPAN-ForceSmokerTest-0.001/
Stuff to run through CPAN smokers
----
MIME-Structure-0.04
http://search.cpan.org/~nkuitse/MIME-Structure-0.04/
determine structure of MIME messages
----
MIME-Structure-0.05
http://search.cpan.org/~nkuitse/MIME-Structure-0.05/
determine structure of MIME messages
----
Mail-SpamCannibal-0.96
http://search.cpan.org/~miker/Mail-SpamCannibal-0.96/
A tool to stop SPAM
----
Module-Collect-0.04
http://search.cpan.org/~yappo/Module-Collect-0.04/
module files are collected from some directories
----
Module-PortablePath-0.07
http://search.cpan.org/~rpettett/Module-PortablePath-0.07/
Perl extension follow modules to exist in different non-core locations on different systems without having to refer to explicit library paths in code.
----
Module-Setup-0.02
http://search.cpan.org/~yappo/Module-Setup-0.02/
a simple module maker "yet another Module::Start(?:er)?"
----
Moose-Test-0.01
http://search.cpan.org/~sartak/Moose-Test-0.01/
A Test Runner for the Moose test suite
----
MooseX-AttributeHelpers-0.14
http://search.cpan.org/~sartak/MooseX-AttributeHelpers-0.14/
Extend your attribute interfaces
----
Moxy-0.46
http://search.cpan.org/~tokuhirom/Moxy-0.46/
Mobile web development proxy
----
Net-Calais-1.00
http://search.cpan.org/~aar/Net-Calais-1.00/
Interface to OpenCalais web service
----
Net-Connection-Sniffer-0.25
http://search.cpan.org/~miker/Net-Connection-Sniffer-0.25/
gather stats on network connections
----
Net-DNS-ToolKit-0.38
http://search.cpan.org/~miker/Net-DNS-ToolKit-0.38/
tools for working with DNS packets
----
Net-LDAP-FilterBuilder-1.0001
http://search.cpan.org/~oliver/Net-LDAP-FilterBuilder-1.0001/
Build LDAP filter statements
----
Net-SSH-Perl-1.31
http://search.cpan.org/~turnstep/Net-SSH-Perl-1.31/
Perl client Interface to SSH
----
Net-eBay-0.51
http://search.cpan.org/~ichudov/Net-eBay-0.51/
Perl Interface to XML based eBay API.
----
Parse-Eyapp-1.114
http://search.cpan.org/~casiano/Parse-Eyapp-1.114/
Extensions for Parse::Yapp
----
Parse-RecDescent-1.96.0
http://search.cpan.org/~dconway/Parse-RecDescent-1.96.0/
Generate Recursive-Descent Parsers
----
Postfix-Parse-Mailq-0.001
http://search.cpan.org/~rjbs/Postfix-Parse-Mailq-0.001/
parse the output of the postfix mailq command
----
RWDE-522
http://search.cpan.org/~damjanp/RWDE-522/
Rapid Web Development Framework
----
RWDE-524
http://search.cpan.org/~damjanp/RWDE-524/
Rapid Web Development Framework
----
Rose-DB-Object-0.773
http://search.cpan.org/~jsiracusa/Rose-DB-Object-0.773/
Extensible, high performance object-relational mapper (ORM).
----
Shell-Amazon-S3-0.041
http://search.cpan.org/~kitano/Shell-Amazon-S3-0.041/
Shell for Amazon S3
----
Task-BeLike-FAYLAND-0.04
http://search.cpan.org/~fayland/Task-BeLike-FAYLAND-0.04/
Modules Fayland loves!
----
Test-HTTP-Server-Simple-StashWarnings-0.03
http://search.cpan.org/~sartak/Test-HTTP-Server-Simple-StashWarnings-0.03/
catch your forked server's warnings
----
Text-Template-Simple-0.54_17
http://search.cpan.org/~burak/Text-Template-Simple-0.54_17/
Simple text template engine
----
Text-Template-Simple-0.54_18
http://search.cpan.org/~burak/Text-Template-Simple-0.54_18/
Simple text template engine
----
WWW-Contact-0.01
http://search.cpan.org/~fayland/WWW-Contact-0.01/
Get contacts/addressbook from Web
----
Win32-API-0.56
http://search.cpan.org/~cosimo/Win32-API-0.56/
Perl Win32 API Import Facility
----
Win32-GuiTest-1.56
http://search.cpan.org/~karasik/Win32-GuiTest-1.56/
Perl GUI Test Utilities.
----
indirect-0.05
http://search.cpan.org/~vpit/indirect-0.05/
Lexically warn about using the indirect object syntax.
----
subs-auto-0.04
http://search.cpan.org/~vpit/subs-auto-0.04/
Read barewords as subroutine names.
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: Thu, 02 Oct 2008 15:00:44 -0700
From: secSwami <bhasin@pacbell.net>
Subject: Proxy in perl
Message-Id: <hwbFk.3022$be.1440@nlpi061.nbdc.sbc.com>
Thanks Tim and Martein for your reponses on this. Here is what I am
doing to setup a simple proxy on my box localy using HTTP::Proxy module.
#!/usr/bin/perl
use HTTP::Proxy;
my $proxy=HTTP::Proxy->new (port => 3128);
$proxy->start;
Just these 4 lines starts up the proxy server on my local machine
listening on port 3128 and then I point my browser's proxy setting to
"localhost" and port "3128". This all works great. No issues there.
However, I would like to see the URL that the user just typed in the
broswer and then take the URL and see if another upstream server app
thinks its blocked or not (a central server) and if the central server
returns a block then spit that out to the users browser. How can I
intercept the user request? and see what that request was in the code above.
Thanks a bunch guys. Really appreciate it.
------------------------------
Date: Fri, 3 Oct 2008 00:52:08 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Proxy in perl
Message-Id: <8e3gr5-hrj1.ln1@osiris.mauzo.dyndns.org>
Quoth secSwami <bhasin@pacbell.net>:
> Thanks Tim and Martein for your reponses on this. Here is what I am
> doing to setup a simple proxy on my box localy using HTTP::Proxy module.
>
> #!/usr/bin/perl
> use HTTP::Proxy;
>
>
> my $proxy=HTTP::Proxy->new (port => 3128);
>
> $proxy->start;
>
>
> Just these 4 lines starts up the proxy server on my local machine
> listening on port 3128 and then I point my browser's proxy setting to
> "localhost" and port "3128". This all works great. No issues there.
>
> However, I would like to see the URL that the user just typed in the
> broswer and then take the URL and see if another upstream server app
> thinks its blocked or not (a central server) and if the central server
> returns a block then spit that out to the users browser. How can I
> intercept the user request? and see what that request was in the code above.
You need to use the ->push_filter method on the proxy object before you
call ->start. See the documentation for HTTP::Proxy.
Ben
--
You poor take courage, you rich take care:
The Earth was made a common treasury for everyone to share
All things in common, all people one.
'We come in peace'---the order came to cut them down. [ben@morrow.me.uk]
------------------------------
Date: Thu, 2 Oct 2008 22:16:10 -0700 (PDT)
From: Ashish Kumar <xml.devel@gmail.com>
Subject: Re: Question about regex (nagios plugin)
Message-Id: <67677e5e-a62a-4188-9504-36acb8f398aa@t42g2000hsg.googlegroups.com>
> Instead, you should do something like (watch for word-wrap):
>
> if ($get_cpu_util =~ m/^\s*(?:\d+\s+){12
> (\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s*(\d+)?\s*$/) {
>
I have got it now. I appreciate your time and efforts.
Thanks.
------------------------------
Date: Thu, 2 Oct 2008 21:42:19 -0700 (PDT)
From: somyasharma@gmail.com
Subject: Re: Sybase::CTLib ct_connect problem
Message-Id: <a734535c-4745-41b8-a691-39e5ca751a18@t54g2000hsg.googlegroups.com>
On Oct 1, 9:37=A0pm, Ted Zlatanov <t...@lifelogs.com> wrote:
> On Tue, 30 Sep 2008 09:47:49 -0700 (PDT) somyasha...@gmail.com wrote:
>
> s> Thanks for the reply. Actually the scene is that if i use
> s> Sybase::DBlib instead of CTlib, everything works fine. Adding to that,
> s> there are lots of existing C++ components which use =A0Sybase's CTLib.=
I
> s> get this error when i try to use Sybperl in a perl script.
>
> s> The issue is somewhat baffling :(
>
> Have you checked your environment carefully? =A0What does
> "use Data::Dumper; print Dumper \%ENV" produce?
>
> s> I am trying this out in a very restricted environment,so not pretty
> s> sure if i will be allowed to experiment with the $SYBASE directory.
> s> Thanks for the inputs though :)
>
> You can just set things up in /var/tmp or any other directory, as long
> as $SYBASE points to it.
>
> Ted
Hi Ted,
Sorry for the delayed response.
The Data Dumper produced expected output. for example, it showed the
following settings in the environment related to sybase :
'SYBASE' =3D> '/export/opt/sybocs/obOpnClt/default_5/etc/openclient',
'SYBIN' =3D> '/export/opt/sybocs/obOpnClt/default_5/etc/openclient/
OCS-1
2_5/bin',
'SYBASE_OCS' =3D> 'OCS-12_5'
will try and configure it in a local temporary directory and update
you with the results.
Thanks for the inputs.
Best Regards,
Somya
------------------------------
Date: Thu, 2 Oct 2008 17:03:38 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: sysopen - die only if EBUSY?
Message-Id: <qv7fr5-ol5.ln1@osiris.mauzo.dyndns.org>
Quoth Peter Makholm <peter@makholm.net>:
> Tomasz Chmielewski <tch@nospam.wpkg.org> writes:
>
> > I want the script to take a specified action depending on
> > the error (EBUSY, ENOENT, etc.).
> > How can I read these values?
>
> The numeric value of $! would corrospond to the actual error code.
>
> If you 'use Errno;' you will have a magic %! which can be easier to
> use. If the error was EBUSY then $!{EBUSY} would be true, if the error
> wwas ENOENT $!{[ENOENT} is true, and so on.
You can also export the E* constants from POSIX:
use POSIX qw/:errno_h/;
if ($! == EBUSY) {
...
}
Ben
--
You poor take courage, you rich take care:
The Earth was made a common treasury for everyone to share
All things in common, all people one.
'We come in peace'---the order came to cut them down. [ben@morrow.me.uk]
------------------------------
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 1896
***************************************