[30113] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1356 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 12 16:10:16 2008

Date: Wed, 12 Mar 2008 13: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           Wed, 12 Mar 2008     Volume: 11 Number: 1356

Today's topics:
    Re: Fastest way to send file to browser xhoster@gmail.com
    Re: Getting permissions using Win32::TieRegistry <ThomasKratz@REMOVEwebCAPS.de>
        help with a regex <donebrowsers@yahoo.com>
    Re: help with a regex <someone@example.com>
    Re: How to send email with perl, or at least control Ou <jack_posemsky@yahoo.com>
        new CPAN modules on Wed Mar 12 2008 (Randal Schwartz)
    Re: Perl pattern matching and extraction dummy@phony.info
    Re: timeout problem with Net::Telnet <szrRE@szromanMO.comVE>
    Re: timeout problem with Net::Telnet <tadmc@seesig.invalid>
        What is weak references? <sonet.all@gmail.com>
    Re: What is weak references? <devnull4711@web.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 12 Mar 2008 18:04:50 GMT
From: xhoster@gmail.com
Subject: Re: Fastest way to send file to browser
Message-Id: <20080312140452.149$HG@newsreader.com>

howa <howachen@gmail.com> wrote:
> On 3$B7n(B12$BF|(B, $B>e8a(B12$B;~(B49$BJ,(B, xhos...@gmail.com
> wrote:
> > howa <howac...@gmail.com> wrote:
> > > In order to hidden the real path, I send the png file via CGI, e.g.
> >
> > > ##############
> >
> > > print "Content-type:image/png\n\n";
> > > my $file = "test.png";
> >
> > > open INPUT_FILE, "$file" or die "Couldn't open file: $!";
> > > while( sysread(INPUT_FILE, $data, 10240) ) {
> > >         print $data;
> > > }
> > > close FILE;
> >
> > > ##############
> >
> > > Any faster/better method?
> >
> > Take a step back and do some introspection on why you want to hide the
> > real path in the first place.
> >
> > Xho
>
> An example would be captcha images, good reason?

Probably not. I would expect captcha images to be either generated on the
fly or stored in a database, so there is no path to hide.  Or selected on
the fly, in which case your goal is not to hide the path but to select the
path.

Given that you are going to start up Perl in the first place, I don't
see any obvious problems with our code, other than possibly a lack of
error checking on the sysread.  And that the file handle you close
is different than the file handle you open.

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: Wed, 12 Mar 2008 11:17:59 +0100
From: Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de>
Subject: Re: Getting permissions using Win32::TieRegistry
Message-Id: <47d7add6$0$2620$bb690d87@news.main-rheiner.de>

Cosmic Cruizer wrote:
> 
> Thank you for the suggestion, but I'm not seeing how this will read the 
> permissions on a registry entry. It looks like it's geared towards file 
> permissions.

To quote directly from the Readme:

Currently the following objects are supported:
     files
     directories
     registry keys
     network shares
     printer shares

Take a look at the example scripts, there are examples of getting and 
setting registry permissions.

Thomas

-- 
$/=$,,$_=<DATA>,s,(.*),$1,see;__END__
s,^(.*\043),,mg,@_=map{[split'']}split;{#>J~.>_an~>>e~......>r~
$_=$_[$%][$"];y,<~>^,-++-,?{$/=--$|?'"':#..u.t.^.o.P.r.>ha~.e..
'%',s,(.),\$$/$1=1,,$;=$_}:/\w/?{y,_, ,,#..>s^~ht<._..._..c....
print}:y,.,,||last,,,,,,$_=$;;eval,redo}#.....>.e.r^.>l^..>k^.-


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

Date: Wed, 12 Mar 2008 12:31:20 -0700 (PDT)
From: donebrowsers <donebrowsers@yahoo.com>
Subject: help with a regex
Message-Id: <25129595-4f6f-471c-b605-c606c2ecd6fc@u72g2000hsf.googlegroups.com>

I have the following dataset:
zoo-2.10.1p1
mutt-1.4.2.3-compressed
lha-1.14i.ac20050924.1
mysql-server-5.0.45
p5-Archive-Tar-1.30
php5-gd-5.2.3-no_x11

There are package listings on an OpenBSD machine. I want to parse the
package name, the version, and if there is a flavor, that too. I want
the following:
[zoo] [2.10.1p1]
[mutt] [1.4.2.3] [compressed]
[lha] [1.14i.ac20050924.1]
[mysql-server] [5.0.45]
[p5-Archive-Tar] [1.30]
[php5-gd] [5.2.3] [no_x11]

I currently have this regex (which is close but doesn't quite work):
/(^.*)-(.*)($-\w)?/

It currently gives me:
[zoo] [2.10.1p1]
[mutt-1.4.2.3] [compressed]
[lha] [1.14i.ac20050924.1]
[mysql-server] [5.0.45]
[p5-Archive-Tar] [1.30]
[php5-gd-5.2.3] [no_x11]

As you can see I'm having issues with the flavor (the last part of the
package name which not every package has) part. Any help?


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

Date: Wed, 12 Mar 2008 20:06:11 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: help with a regex
Message-Id: <TIWBj.76842$FO1.55863@edtnps82>

donebrowsers wrote:
> I have the following dataset:
> zoo-2.10.1p1
> mutt-1.4.2.3-compressed
> lha-1.14i.ac20050924.1
> mysql-server-5.0.45
> p5-Archive-Tar-1.30
> php5-gd-5.2.3-no_x11
> 
> There are package listings on an OpenBSD machine. I want to parse the
> package name, the version, and if there is a flavor, that too. I want
> the following:
> [zoo] [2.10.1p1]
> [mutt] [1.4.2.3] [compressed]
> [lha] [1.14i.ac20050924.1]
> [mysql-server] [5.0.45]
> [p5-Archive-Tar] [1.30]
> [php5-gd] [5.2.3] [no_x11]

$ echo "zoo-2.10.1p1
mutt-1.4.2.3-compressed
lha-1.14i.ac20050924.1
mysql-server-5.0.45
p5-Archive-Tar-1.30
php5-gd-5.2.3-no_x11" | \
perl -lne'
   print join " ", map $_ ? "[$_]" : (), split /-?(\d[\w.]*\d)-?/, $_, 2
'
[zoo] [2.10.1p1]
[mutt] [1.4.2.3] [compressed]
[lha] [1.14i.ac20050924.1]
[mysql-server] [5.0.45]
[p5-Archive-Tar] [1.30]
[php5-gd] [5.2.3] [no_x11]



John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


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

Date: Tue, 11 Mar 2008 22:34:27 -0700 (PDT)
From: Jack <jack_posemsky@yahoo.com>
Subject: Re: How to send email with perl, or at least control Outlook Express
Message-Id: <8e4f04ef-b55e-49e3-a16c-a364bb45e597@d21g2000prf.googlegroups.com>

On Mar 11, 8:52=A0pm, Michael Goerz <newsgroup898s...@8439.e4ward.com>
wrote:
> Michael Goerz wrote, on 03/11/2008 06:23 PM:
>
>
>
> > Jack wrote, on 03/11/2008 03:59 PM:
> >> On Mar 11, 11:08 am, Michael Goerz <newsgroup898s...@8439.e4ward.com>
> >> wrote:
> >>> Jack wrote, on 03/11/2008 11:39 AM:
>
> >>>> Hi for some reason I can send email and the target receives it with m=
y
> >>>> James mailserver via Outlook Express, but not via BLAT. =A0I am using=

> >>>> user/pass authentication.. can anyone point me to a script that works=

> >>>> and is simple for
> >>>> 1- send an email directly (problem with below is email never shows up=

> >>>> at destination)
> >>> Does this help
> >>> you?http://www.physik.fu-berlin.de/~goerz/programs/mailpl/mailpl.html
>
> >>> Michael Goerz
>
> >> Hi excellent for those looking for all the bells and whistles
> >> (encryption, etc etc) - good work .however way too much code,
> >> complexity, dependencies requiring install, etc for me,
> > You can try to comment out some of the dependencies. You can definitely
> > get rid of 'use Mail::GPG;' and 'use Archive::Zip qw( :ERROR_CODES
> > :CONSTANTS );'. The program will fail if you actually use encryption or
> > zipped attachments, of course, but you should be find for you basic
> > functionality. Most of the other dependencies are probably essential,
> > all the network communication stuff. You can play around with commenting=

> > out any of them, see what works and and doesn't.... But, there will
> > always be some dependencies left. What's the problem with using 'perl
> > -MCPAN'? Installing missing modules in Perl should be quite easy
> > =A0> and when I got
> > =A0> it to run, ctrl-D didnt work..
> > You're on Windows, right?... I don't think I ever tested the script on
> > Windows. It should work though. crtl+D is supposed to end standard
> > input. It's not a feature of the script, but of the shell. There's got
> > to be something equivalent on Windows. But, entering the email text on
> > the console is only a fallback anyway. You should call an editor for
> > that (--editor=3Dnotepad). It's best to set this up in the config file.
> > (at "$ENV{HOME}/.mailpl/mailpl.rc" by default, but you can change that
> > at the beginning of the script).
>
> > Next time I'll be on a Windows machine, I'll try to find out what's up
> > with this CTRL+D... it might be a while, though.
>
> I just googled it. On Windows, you have to press CTRL+Z instead of CTRL+D:=
http://www.mhuffman.com/notes/dos/bash_cmd.htm- Hide quoted text -
>
> - Show quoted text -

Michael - no sweat - got it to work - GREAT work on your end..just
added --text=3Djunk and it didnt prompt me for ctrl-d..  thanks for all
your help.

Best,
Jack


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

Date: Wed, 12 Mar 2008 04:42:18 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Mar 12 2008
Message-Id: <JxLp2I.C88@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.

Algorithm-LBFGS-0.17
http://search.cpan.org/~laye/Algorithm-LBFGS-0.17/
Perl extension for L-BFGS 
----
CGI-Application-Dispatch-2.13_02
http://search.cpan.org/~wonko/CGI-Application-Dispatch-2.13_02/
Dispatch requests to CGI::Application based objects 
----
CGI-CMS-0.29
http://search.cpan.org/~lze/CGI-CMS-0.29/
Content Managment System that runs under mod_perl and and as cgi script. 
----
CPAN-LinksToDocs-0.001
http://search.cpan.org/~zoffix/CPAN-LinksToDocs-0.001/
get links to http://search.cpan.org documentation by giving short "tags" 
----
CPAN-LinksToDocs-No404s-0.001
http://search.cpan.org/~zoffix/CPAN-LinksToDocs-No404s-0.001/
get links to http://search.cpan.org documentation by giving short "tags" and make sure all of them point to existant documentation 
----
Config-Model-TkUI-0.102
http://search.cpan.org/~ddumont/Config-Model-TkUI-0.102/
Perl/Tk widget to edit content of Config::Model 
----
Curses-UI-0.9603
http://search.cpan.org/~mdxi/Curses-UI-0.9603/
A curses based OO user interface framework 
----
DateTime-Format-Flexible-0.03
http://search.cpan.org/~thinc/DateTime-Format-Flexible-0.03/
DateTime::Format::Flexible - Flexibly parse strings and turn them into DateTime objects. 
----
Gtk2-Ex-Geo-0.58
http://search.cpan.org/~ajolma/Gtk2-Ex-Geo-0.58/
The main module to use for geospatial applications 
----
HTML-Menu-TreeView-0.87
http://search.cpan.org/~lze/HTML-Menu-TreeView-0.87/
----
HTTP-Daemon-Threaded-0.91
http://search.cpan.org/~darnold/HTTP-Daemon-Threaded-0.91/
Apartment threaded HTTP::Daemon-based server 
----
HTTP-Server-Simple-0.30
http://search.cpan.org/~jesse/HTTP-Server-Simple-0.30/
Lightweight HTTP server 
----
IO-Unread-1.03
http://search.cpan.org/~bmorrow/IO-Unread-1.03/
push more than one character back onto a filehandle 
----
JavaScript-Bookmarklet-0.02
http://search.cpan.org/~tima/JavaScript-Bookmarklet-0.02/
utility library and command-line script for converting human-readable JavaScript code into bookmarklet form. 
----
Lingua-PT-ProperNames-0.08
http://search.cpan.org/~ambs/Lingua-PT-ProperNames-0.08/
Simple module to extract proper names from Portuguese Text 
----
Net-IMAP-Server-0.3
http://search.cpan.org/~alexmv/Net-IMAP-Server-0.3/
A single-threaded multiplexing IMAP server implementation, using Net::Server::Coro. 
----
OpenResty-0.1.0
http://search.cpan.org/~agent/OpenResty-0.1.0/
General-purpose web service platform for web applications 
----
POE-Component-Client-Stomp-0.05
http://search.cpan.org/~kesteb/POE-Component-Client-Stomp-0.05/
Perl extension for the POE Environment 
----
POE-Component-IRC-Plugin-QueryDNSBL-0.02
http://search.cpan.org/~bingos/POE-Component-IRC-Plugin-QueryDNSBL-0.02/
A POE::Component::IRC plugin for IRC based DNSBL queries 
----
POE-Component-Server-IRC-1.30
http://search.cpan.org/~bingos/POE-Component-Server-IRC-1.30/
A fully event-driven networkable IRC server daemon module. 
----
Parallel-SubFork-0.03
http://search.cpan.org/~potyl/Parallel-SubFork-0.03/
Manage Perl functions in forked processes. 
----
RDF-Server-0.03
http://search.cpan.org/~jsmith/RDF-Server-0.03/
toolkit for building RDF servers 
----
RDF-Server-0.04
http://search.cpan.org/~jsmith/RDF-Server-0.04/
toolkit for building RDF servers 
----
RRDTool-Creator-0.9
http://search.cpan.org/~jacquelin/RRDTool-Creator-0.9/
Creators for round robin databases (RRD) 
----
Run-Env-0.01_02
http://search.cpan.org/~jkutej/Run-Env-0.01_02/
running environment detection 
----
SNMP-Query-Asynch-v0.1_36
http://search.cpan.org/~sscaffidi/SNMP-Query-Asynch-v0.1_36/
Fast asynchronous execution of batches of SNMP queries 
----
SNMP-Query-Asynch-v0.1_38
http://search.cpan.org/~sscaffidi/SNMP-Query-Asynch-v0.1_38/
Fast asynchronous execution of batches of SNMP queries 
----
Sphinx-Search-0.11
http://search.cpan.org/~jjschutz/Sphinx-Search-0.11/
Sphinx search engine API Perl client 
----
Test-Server-0.02_01
http://search.cpan.org/~jkutej/Test-Server-0.02_01/
what about test driven administration? 
----
Test-Trap-0.1.1
http://search.cpan.org/~ebhanssen/Test-Trap-0.1.1/
Trap exit codes, exceptions, output, etc. 
----
Text-CSV_XS-0.37
http://search.cpan.org/~hmbrand/Text-CSV_XS-0.37/
comma-separated values manipulation routines 
----
Text-Template-Simple-0.52
http://search.cpan.org/~burak/Text-Template-Simple-0.52/
Simple text template engine 
----
Tk-PerlInheritanceTree-0.04
http://search.cpan.org/~lamprecht/Tk-PerlInheritanceTree-0.04/
Display a graphical representation of the inheritance tree for a given class-name. 
----
WWW-Ohloh-API-0.0.8
http://search.cpan.org/~yanick/WWW-Ohloh-API-0.0.8/
Ohloh API implementation 
----
WordNet-Similarity-2.03
http://search.cpan.org/~tpederse/WordNet-Similarity-2.03/
modules for computing semantic relatedness. 
----
__-0.01
http://search.cpan.org/~jrockway/__-0.01/
----
perfSONAR_PS-Services-PingER-0.08
http://search.cpan.org/~perfsonar/perfSONAR_PS-Services-PingER-0.08/


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: Wed, 12 Mar 2008 05:08:35 -0700
From: dummy@phony.info
Subject: Re: Perl pattern matching and extraction
Message-Id: <23hft3df133h8nd42q61obsgoktqle08bn@4ax.com>

On Sat, 8 Mar 2008 05:48:25 -0800 (PST), "Deepan - M.Sc(SE) - 03MW06"
<deepan.17@gmail.com> wrote:

>Hi,
>     I would like to thank everyone for their help to my previous
>post. Actually i didn't explained my need completely. Here's it
>
>     my $url = "/pages-cell.net/deepan/sony/";
>
>     if($url =~ m/\/(.*)\//g)
>     {
>                my @result = $1;
>                return @result;
>     }
>
>What i need is that i should be able to extract "sony" from it. In the
>sense i should be able to extract whatever that is available in the
>last between "/" and "/". Please help me to solve this.
>
>Thanks,
>Deepan

This seems to be what you're trying to get:

use strict; use warnings;
my $s = " junk /fee/fie/fum/sony/Help! I'm stuck in a regex!/ foo";
(my @result) = $s =~ m!/([^/]+)(?=/)!g;
map {print "[$_]\n"}@result;

The output is:

[fee]
[fie]
[fum]
[sony]
[Help! I'm stuck in a regex!]


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

Date: Tue, 11 Mar 2008 21:11:26 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: timeout problem with Net::Telnet
Message-Id: <fr7l5f02igs@news2.newsguy.com>

Ben Morrow wrote:
> Quoth "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>:
>> Mr_Noob wrote:
>>>
>>> Here is my perl script that make a telnet connection with a
>>> windows2k3 box :
>
> Have you read the notes in Net::Telnet about Microsoft's telnet
> server?
>
>>> #!/usr/bin/perl -w
>>> use strict;
>>> use warnings;
>>> use Net::Telnet ();
>>> my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt
>>> =>
>
> Using 'indirect object syntax' (new Net::Telnet (...)) is a bad idea.
> Perl's parsing of it is somewhat flakey, and it's better to use normal
> object syntax:
>
>    my $telnet = Net::Telnet->new(...);

I have never had an issue using the indirect syntax. I find it more 
comfortable, having a c++/java background before I learned Perl some 
time ago. Exactly what difference does it make, if any (as I have never 
found any) ?

-- 
szr 




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

Date: Wed, 12 Mar 2008 05:35:27 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: timeout problem with Net::Telnet
Message-Id: <slrnftfcff.n8n.tadmc@tadmc30.sbcglobal.net>

szr <szrRE@szromanMO.comVE> wrote:
> Ben Morrow wrote:

>> Using 'indirect object syntax' (new Net::Telnet (...)) is a bad idea.

> I have never had an issue using the indirect syntax. I find it more 
> comfortable, having a c++/java background before I learned Perl some 
> time ago. Exactly what difference does it make, if any (as I have never 
> found any) ?


See the "Indirect Object Syntax" section in perlobj.pod.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Wed, 12 Mar 2008 23:17:29 +0800
From: "mynews" <sonet.all@gmail.com>
Subject: What is weak references?
Message-Id: <fr8s9r$781$1@netnews.hinet.net>

The document 
(http://search.cpan.org/~rgarcia/perl-5.9.3/pod/perl593delta.pod#Core_Enhancements)
say that "Weak references are cheaper...".
But what is the weak references?




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

Date: Wed, 12 Mar 2008 16:23:25 +0100
From: Frank Seitz <devnull4711@web.de>
Subject: Re: What is weak references?
Message-Id: <63qarfF28brs2U2@mid.individual.net>

mynews wrote:

> But what is the weak references?

http://perldoc.perl.org/Scalar/Util.html#weaken-REF

Frank
-- 
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel


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

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


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