[30170] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1413 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 2 03:09:41 2008

Date: Wed, 2 Apr 2008 00: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           Wed, 2 Apr 2008     Volume: 11 Number: 1413

Today's topics:
    Re: Can I iterate through a file on a CGI  page? <usenet@davidfilmer.com>
    Re: Can I iterate through a file on a CGI  page? xhoster@gmail.com
    Re: Control actions of DOS in perl <see.my.signature@for.my.email.address>
    Re: every combination of Y/N in 5 positions <source@netcom.com>
    Re: every combination of Y/N in 5 positions <see.my.signature@for.my.email.address>
    Re: every combination of Y/N in 5 positions <someone@example.com>
    Re: every combination of Y/N in 5 positions <tadmc@seesig.invalid>
    Re: every combination of Y/N in 5 positions <ben@morrow.me.uk>
    Re: Good documentation or good source examples for Imag <source@netcom.com>
    Re: Good documentation or good source examples for Imag <news1234@free.fr>
    Re: Good documentation or good source examples for Imag <news1234@free.fr>
        ID3v2 cover art insertion with Perl? <seppo.ingalsuo@iki.fi>
        new CPAN modules on Wed Apr  2 2008 (Randal Schwartz)
    Re: NIC Configurations <XXjbhuntxx@white-star.com>
    Re: printf: zero pad after the decimal a given amount jidanni@jidanni.org
    Re: printf: zero pad after the decimal a given amount <rvtol+news@isolution.nl>
        RE Perl Pattern matching <deepan.17@gmail.com>
    Re: RE Perl Pattern matching <benkasminbullock@gmail.com>
    Re: RE Perl Pattern matching <deepan.17@gmail.com>
        TieRegistry with IPConfig <XXjbhuntxx@white-star.com>
        tricky use of print? <ela@yantai.org>
    Re: tricky use of print? <usenet@davidfilmer.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 01 Apr 2008 18:41:05 -0700
From: David Filmer <usenet@davidfilmer.com>
Subject: Re: Can I iterate through a file on a CGI  page?
Message-Id: <WJidnTKgWcOdeW_a4p2dnAA@giganews.com>

Rich Grise wrote:
> for each $line in <file> {

This is gonna be your problem.  CGI is stateless.  Each time you hit one 
of the submit buttons you will re-invoke the program, and the new 
invocation knows nothing about the state of the previous invocation.  If 
  you attempted something like you wrote then you would keep showing the 
first item over and over again, because it would start at the beginning 
of the file each time you invoked the program.

There are several things you can do to get around this issue. My 
preference is to use a database instead of a file, and run my CGI under 
a mod_perl webserver which is smart enough to cache the database handle. 
But maybe that's overkill for what you want to do.

If you are willing to pay the price of opening up your flatfile each 
time you invoke the program, you could pass the current (or next) line 
number as a hidden() parameter.  Thus the program knows which line of 
the file to process next (I would recommend tying the file to an array 
so the line number simply becomes the array subscript).





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

Date: 02 Apr 2008 04:07:42 GMT
From: xhoster@gmail.com
Subject: Re: Can I iterate through a file on a CGI  page?
Message-Id: <20080402000745.992$ON@newsreader.com>

Rich Grise <rich@example.net> wrote:
> Apologies to Perl purists - comp.infosystems.www.authoring.cgi doesn't
> work on my newsreader, and this is a CGI question:
>
> What I want to do is, I've got a large collection of image files:
> $ wc gallery-pix
>   37448   62619 3218967 gallery-pix
>
> and what I'd like to do is look at each of the 37488 image files on
> some kind of page, with buttons like "Keep", "Skip", and "Quit",
> so I can page through all of these images, which are strewn all
> over the Samba server, and decide which ones might look good on
> the website.
>
> So, is it possible to do something like (in pseudocode):
>
> for each $line in <file> {

In CGI, your program won't survive for the loop to iterate.  Unless
you are making one page with all 37448 files on it.

>  show webpage with <img> tag, and the three buttons;
>  get button response, decide what to do with file;

What would you do with the file in each case?

>  if button == "Quit", save place in source file;
> next;

Make one directory with all the files (or with a symbolic links for each
file).  Each time the program is invoked, take the first entry in the
directory and display it.  Based on the response, either move it to the
accept directory or the reject directory (or move it to accept vs delete
it, whatever.)  Since the file is no longer there, place is inherently
saved. Quit doesn't have to do anything, nor even have to exist--closing
the browser without responding is a form of quiting.

Or use a database.

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: Tue, 1 Apr 2008 18:49:53 -0800
From: "Robbie Hatley" <see.my.signature@for.my.email.address>
Subject: Re: Control actions of DOS in perl
Message-Id: <QuOdnRfjjpage2_anZ2dnUVZ_oaonZ2d@giganews.com>


"rajendra" wrote:

> I would like to know is it possible to execute control operations like
> Ctrl-C(to abort an action), Ctrl-Q(to mark an email as read) etc in a perl
> script.

Dunno if Perl can do that or not, but when I need to automate stuff in
Windows, I use AutoIt3:  http://www.autoitscript.com/autoit3/
That allows you to write and run scripts that can move and click the
mouse any place you like, depress any keys you want, etc.

-- 
Cheers,
Robbie Hatley
lonewolf aatt well dott com
www dott well dott com slant user slant lonewolf slant




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

Date: Tue, 01 Apr 2008 19:28:48 -0700
From: David Harmon <source@netcom.com>
Subject: Re: every combination of Y/N in 5 positions
Message-Id: <fb6dnc-9EJLmcm_anZ2dnUVZ_rSrnZ2d@earthlink.com>

On Mon, 31 Mar 2008 23:23:25 +0200 in comp.lang.perl.misc, Gunnar
Hjalmarsson <noreply@gunnar.cc> wrote,
>I do, I hope. :)
>
>     foreach my $num ( 0 .. 0b11111 ) {
>         local *_ = \ sprintf '%05b', $num;

What is *_ ?  It looks like one of those magic perl variables,  but
I don't find any documentation on it.


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

Date: Tue, 1 Apr 2008 19:34:16 -0800
From: "Robbie Hatley" <see.my.signature@for.my.email.address>
Subject: Re: every combination of Y/N in 5 positions
Message-Id: <vLSdnexpl944bW_anZ2dnUVZ_jWdnZ2d@giganews.com>


Gunnar Hjalmarsson wrote:

> ... it's easy to write obfuscated code using Perl...
> perl -le"do{$_=sprintf'%05b',$_;y/01/NY/;print}for(0..0b11111)"

Huh.  That doesn't look "obfuscated" to me at all.  I read "write $_
back to itself as a 0-padded 5-position binary field, transliterate
01 to NY, print, repeat for $_ = 0 through 31".  Outputs "NNNNN"
through "YYYYY", each on its own line.

(As a newbie Perl programmer, I don't know whether the fact that the
above one-liner doesn't seem "obfuscated" to me should make me happy
or terrified.  Perhaps a little of both.)

Maybe you're using the wrong language.  Try C for obfuscation:

#include <stdio.h>
main(t,_,a)char* a;\
{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,\
main(-86, 0, a+1 )+a)):1,t<_?main(t+1, _, a ):3,main ( -94, -27+t, a\
)&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d %d\n" ):9:16:t<0?t<-72?main(_,\
t,"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+\
,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/\
+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){n\
l]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#\
n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;\
#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")\
:t<-50?_==*a ?putchar(a[31]):main(-65,_,a+1):main((*a == '/')+t,_,a\
+1 ):0<t?main ( 2, 2 , "%s"):*a=='/'||main(0,main(-61,*a, "!ek;dc \
i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}

(Note: I'm not the author of that.)

Compile that with a C compiler and run it.  You'll be amazed at what
it does.  Ho, ho, ho!  Merry Christmas!  Or Merry April Fools Day,
as the case may be.

BONUS PROBLEM FOR PERL HACKERS HERE:  Translate the above C program
into Perl... and be sure you make it just as obfuscated!  (I tried,
but didn't get very far; trying to figure it out gave me a headache.
The fact that main calls itself recursively in 11 different places
is enough to fill me with horror.)

-- 
Cheers,
Robbie Hatley
lonewolf aatt well dott com
www dott well dott com slant user slant lonewolf slant




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

Date: Wed, 02 Apr 2008 02:45:11 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: every combination of Y/N in 5 positions
Message-Id: <XqCIj.11499$pb5.4509@edtnps89>

David Harmon wrote:
> On Mon, 31 Mar 2008 23:23:25 +0200 in comp.lang.perl.misc, Gunnar
> Hjalmarsson <noreply@gunnar.cc> wrote,
>> I do, I hope. :)
>>
>>     foreach my $num ( 0 .. 0b11111 ) {
>>         local *_ = \ sprintf '%05b', $num;
> 
> What is *_ ?  It looks like one of those magic perl variables,  but
> I don't find any documentation on it.

It is a typeglob.  It means that you want all of the _ variables to have 
a local value.  See the "Typeglobs and Filehandles" section of perldata.pod.

perldoc perldata


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, 1 Apr 2008 22:34:21 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: every combination of Y/N in 5 positions
Message-Id: <slrnfv5vlt.u0f.tadmc@tadmc30.sbcglobal.net>

David Harmon <source@netcom.com> wrote:
> On Mon, 31 Mar 2008 23:23:25 +0200 in comp.lang.perl.misc, Gunnar
> Hjalmarsson <noreply@gunnar.cc> wrote,
>>I do, I hope. :)
>>
>>     foreach my $num ( 0 .. 0b11111 ) {
>>         local *_ = \ sprintf '%05b', $num;
>
> What is *_ ?  


It is a typeglob of the variables named underscore.


> It looks like one of those magic perl variables,  
                ^^^
                ^^^

It is many of those magic perl variables.

It is $_ and @_ and _ and ...


> but
> I don't find any documentation on it.


See the "Typeglobs and Filehandles" section in perldata.pod.


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


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

Date: Wed, 2 Apr 2008 05:58:21 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: every combination of Y/N in 5 positions
Message-Id: <dcgbc5-0la.ln1@osiris.mauzo.dyndns.org>


Quoth "Newsgroup only please, address is no longer replyable."
<bad@example.invalid>:
> On Mon, 31 Mar 2008 23:23:25 +0200 in comp.lang.perl.misc, Gunnar
> Hjalmarsson <noreply@gunnar.cc> wrote,
> >I do, I hope. :)
> >
> >     foreach my $num ( 0 .. 0b11111 ) {
> >         local *_ = \ sprintf '%05b', $num;
> 
> What is *_ ?  It looks like one of those magic perl variables,  but
> I don't find any documentation on it.

What noone has said yet is why Gunnar used it. Due to a rather nasty bug
in perl, under certain rather obscure circumstances[0] $_ doesn't
localise properly, so if you need to do so it is safer to localise the
whole of *_. Unfortunately, besides being ugly, this means you lose your
sub arguments (and the magic stat filehandle, of course, but that's
likely less important); personally I would always rather use a for loop
over one element

    for (sprintf '%05b', $num) {

or, with 5.10, either 'given' (like for, but gives scalar context to its
argument) or 'my $_'. None of these suffer from the bug.

Ben

[0] If $_ is an alias to an element of a tied hash or array, the value
of that element will be localised along with $_. A simple example is

    use Tie::Hash;

    tie my %h, 'Tie::StdHash';
    $h{a} = 1;

    for ($h{a}) {
        local $_ = 2;
        print $h{a};    # 2, but should be 1
    }
    print $h{a};        # back to 1 again

This is only really important if you call external code in the scope of
the 'local': if that code reads the hash, it will be surprised to find
the values have changed.



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

Date: Tue, 01 Apr 2008 20:30:53 -0700
From: David Harmon <source@netcom.com>
Subject: Re: Good documentation or good source examples for Image::Magick or converter from commandline to perl
Message-Id: <Cr-dnf9ykbXMY2_anZ2dnUVZ_rmjnZ2d@earthlink.com>

On Wed, 02 Apr 2008 00:07:15 +0200 in comp.lang.perl.misc, nntpman68
<news1234@free.fr> wrote,
>$err = $tile->Draw( %textopts );
>warn "$err" if "$err";
>
>Produces the message:
>Exception 410: unrecognized option `text' at ./test.pl line 103.

draw "text" is no longer supported in recent versions of
ImageMagick; annotate must be used instead.


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

Date: Wed, 02 Apr 2008 08:39:17 +0200
From: nntpman68 <news1234@free.fr>
Subject: Re: Good documentation or good source examples for Image::Magick or converter from commandline to perl
Message-Id: <47f32a14$0$19548$426a34cc@news.free.fr>

Thanks a lot.

This was just a typo. however it also didn't work when I used $g on both 
places.


bye

N
J. Gleixner wrote:
> nntpman68 wrote:
>> Hi,
>>
>> I'm still not succeeding with drawing a text :-( .
>>
>>
>> Following attempt doesn't produce any text, put doesn't print any 
>> error / warning:
> 
> Of course, you didn't provide anything for it to 'Draw'. :-)
> 
>>
>>  my %textopts = (
>>                 primitive  => 'text' ,
>>                     stroke => 'red' ,
>>                  pointsize => 12  ,
>>                  points => "20,20"
>>             );
>>
>> $err = $g->Draw( %textopts );
>>  warn "$err" if "$err";
>>
>>
>> whereas following command (with same %textopts as above)
>>
>> $err = $tile->Draw( %textopts );
>> warn "$err" if "$err";
>>
>> Produces the message:
>> Exception 410: unrecognized option `text' at ./test.pl line 103.
> 
> I guess $tile and $g aren't the same class.
> 
> Try either of these:
> 
> $obj->Annotate(
>     x => 0,
>     y => 20,
>     text => 'Blah' );
> 
> $obj->Draw(
>     primitive => 'Text',
>     points => '0,20 "Blah"' );
> 
> Graphics Programming with Perl
> http://www.manning.com/verbruggen/


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

Date: Wed, 02 Apr 2008 08:43:29 +0200
From: nntpman68 <news1234@free.fr>
Subject: Re: Good documentation or good source examples for Image::Magick or converter from commandline to perl
Message-Id: <47f32b10$0$19548$426a34cc@news.free.fr>

Hi J,


I tried both of your examples.
With my version of Image::Magick both work.


Excellent. Thanks a lot :-)

Looking at David Harmon's reply it seems better to stick with annotate.
I'll do so.


bye


N


J. Gleixner wrote:
> nntpman68 wrote:
>> Hi,
>>
>> I'm still not succeeding with drawing a text :-( .
>>
>>
>> Following attempt doesn't produce any text, put doesn't print any 
>> error / warning:
> 
> Of course, you didn't provide anything for it to 'Draw'. :-)
> 
>>
>>  my %textopts = (
>>                 primitive  => 'text' ,
>>                     stroke => 'red' ,
>>                  pointsize => 12  ,
>>                  points => "20,20"
>>             );
>>
>> $err = $g->Draw( %textopts );
>>  warn "$err" if "$err";
>>
>>
>> whereas following command (with same %textopts as above)
>>
>> $err = $tile->Draw( %textopts );
>> warn "$err" if "$err";
>>
>> Produces the message:
>> Exception 410: unrecognized option `text' at ./test.pl line 103.
> 
> I guess $tile and $g aren't the same class.
> 
> Try either of these:
> 
> $obj->Annotate(
>     x => 0,
>     y => 20,
>     text => 'Blah' );
> 
> $obj->Draw(
>     primitive => 'Text',
>     points => '0,20 "Blah"' );
> 
> Graphics Programming with Perl
> http://www.manning.com/verbruggen/


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

Date: Wed, 02 Apr 2008 06:21:46 GMT
From: Seppo Ingalsuo <seppo.ingalsuo@iki.fi>
Subject: ID3v2 cover art insertion with Perl?
Message-Id: <_BFIj.31$pv2.16@read4.inet.fi>

Hi,

I'm struggling with my flac->mp3 music library maintenance script. based 
on some net articles I have used MP3::Tag to attach cover art this way

use constant HEADER => ( chr(0x0) , "image/jpeg" , chr(0x0), "");

$img = new Image::Magick;
if (! $img->Read("$flacdir/cover.jpg")) {
  $id3v2->add_frame( "APIC", HEADER, $img->ImageToBlob(magick => 'jpg'));
}

There is also setting

MP3::Tag->config("id3v23_unsync_size_w" => "TRUE");

See e.g. http://perl.thiesen.org/scripts/id3image

But I get corrupted cover art images in Amarok. iTunes and Windows Media 
  Player seem to work with it. MediaTomb uPnP server + PS3 doesn't find 
the pictures. I'd like to get MediaTomb that uses taglib for metadata to 
work.

There are Perl bindings for taglib in Audio::TagLib in CPAN. I'm able to 
generate basic ID3v1 tags with it but nothing else since the 
documentation is missing/minimal and I'm far from fluent in Perl to get 
the information from Audio::TagLib source code. Any pointers how to do 
proper ID3v2 APIC tags with Perl would be really helpful.

I found this but it seems to generate only ID3v1 tags based on "id3v2 
-l" output and there is no example of 
Audio::TagLib::ID3v2::AttachedPictureFrame

http://www.mfischer.com/2007/11/21/mp3-metadata-tagging/

BR,
Seppo


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

Date: Wed, 2 Apr 2008 04:42:19 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Apr  2 2008
Message-Id: <JyoL2J.oq4@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.

Apache-FakeTable-0.03
http://search.cpan.org/~dwheeler/Apache-FakeTable-0.03/
Pure Perl implementation of the Apache::Table interface. 
----
Array-Splice-0.03
http://search.cpan.org/~nobull/Array-Splice-0.03/
Splice aliases into arrays 
----
AutoXS-0.01
http://search.cpan.org/~smueller/AutoXS-0.01/
Speed up your code after compile time 
----
AutoXS-Header-0.01
http://search.cpan.org/~smueller/AutoXS-Header-0.01/
Container for the AutoXS header files 
----
B-Utils-0.05_04
http://search.cpan.org/~smueller/B-Utils-0.05_04/
Helper functions for op tree manipulation 
----
B-Utils-0.05_05
http://search.cpan.org/~smueller/B-Utils-0.05_05/
Helper functions for op tree manipulation 
----
CallOfDuty-LANMapper-0.01
http://search.cpan.org/~psinnott/CallOfDuty-LANMapper-0.01/
COD Server detection and query 
----
Catalyst-Controller-SOAP-0.3
http://search.cpan.org/~druoso/Catalyst-Controller-SOAP-0.3/
Catalyst SOAP Controller 
----
Catalyst-Plugin-SmartURI-0.01_01
http://search.cpan.org/~rkitover/Catalyst-Plugin-SmartURI-0.01_01/
Configurable URIs for Catalyst 
----
Catalyst-Plugin-Wizard-0.01
http://search.cpan.org/~davinchi/Catalyst-Plugin-Wizard-0.01/
making multipart (e.g. wizard) actions: registering an user via several steps, submit something large (like application forms). 
----
Crypt-ECDSA-0.061
http://search.cpan.org/~billh/Crypt-ECDSA-0.061/
Elliptical Cryptography Digital Signature Algorithm 
----
DBIx-Class-Service-0.01
http://search.cpan.org/~zigorou/DBIx-Class-Service-0.01/
Aggregate DBIC processes between multiple tables. 
----
DBIx-RetryOverDisconnects-0.02
http://search.cpan.org/~syber/DBIx-RetryOverDisconnects-0.02/
DBI wrapper that helps to deal with databases connection problems 
----
DBIx-SearchBuilder-1.52
http://search.cpan.org/~ruz/DBIx-SearchBuilder-1.52/
Encapsulate SQL queries and rows in simple perl objects 
----
DateTime-Event-Klingon-1.0
http://search.cpan.org/~jaldhar/DateTime-Event-Klingon-1.0/
Determine events of Klingon cultural significance 
----
Devel-Backtrace-0.10
http://search.cpan.org/~pepe/Devel-Backtrace-0.10/
Object-oriented backtrace 
----
Devel-CoverX-Covered-0.001
http://search.cpan.org/~johanl/Devel-CoverX-Covered-0.001/
Collecting and report caller and covered statistics from the cover_db 
----
Devel-CoverX-Covered-0.002
http://search.cpan.org/~johanl/Devel-CoverX-Covered-0.002/
Collecting and report caller and covered statistics from the cover_db 
----
Domain-PublicSuffix-0.01
http://search.cpan.org/~nmelnick/Domain-PublicSuffix-0.01/
Parse a domain down to root 
----
Encode-Argv-0.00001
http://search.cpan.org/~dmaki/Encode-Argv-0.00001/
Automatically Mess With @ARGV's Encoding 
----
File-Binary-1.7
http://search.cpan.org/~simonw/File-Binary-1.7/
Binary file reading module 
----
Games-Sudoku-CPSearch-0.07
http://search.cpan.org/~martyloo/Games-Sudoku-CPSearch-0.07/
Solve Sudoku problems quickly. 
----
Games-Sudoku-CPSearch-0.08
http://search.cpan.org/~martyloo/Games-Sudoku-CPSearch-0.08/
Solve Sudoku problems quickly. 
----
Games-Sudoku-CPSearch-0.09
http://search.cpan.org/~martyloo/Games-Sudoku-CPSearch-0.09/
Solve Sudoku problems quickly. 
----
Getopt-Param-Tiny-0.4
http://search.cpan.org/~dmuey/Getopt-Param-Tiny-0.4/
Subset of Getopt::Param functionality with smaller memory footprint 
----
Google-Adwords-v1.9.0
http://search.cpan.org/~rohan/Google-Adwords-v1.9.0/
an interface which abstracts the Google Adwords SOAP API 
----
Google-Adwords-v1.9.1
http://search.cpan.org/~rohan/Google-Adwords-v1.9.1/
an interface which abstracts the Google Adwords SOAP API 
----
IkiWiki-Plugin-syntax-0.20
http://search.cpan.org/~vmoral/IkiWiki-Plugin-syntax-0.20/
Add syntax highlighting to ikiwiki 
----
Image-OCR-Tesseract-1.03
http://search.cpan.org/~leocharre/Image-OCR-Tesseract-1.03/
read an image with tesseract and get output 
----
Image-OCR-Tesseract-1.10
http://search.cpan.org/~leocharre/Image-OCR-Tesseract-1.10/
read an image with tesseract and get output 
----
JavaScript-1.05
http://search.cpan.org/~andk/JavaScript-1.05/
Perl extension for executing embedded JavaScript 
----
JavaScript-1.05
http://search.cpan.org/~claesjac/JavaScript-1.05/
Perl extension for executing embedded JavaScript 
----
Math-Complex-1.53
http://search.cpan.org/~jhi/Math-Complex-1.53/
complex numbers and associated mathematical functions 
----
Module-Build-IkiWiki-0.0.5
http://search.cpan.org/~vmoral/Module-Build-IkiWiki-0.0.5/
Extension for develop Ikiwiki plugins 
----
Module-CoreList-2.15
http://search.cpan.org/~rgarcia/Module-CoreList-2.15/
what modules shipped with versions of perl 
----
Net-BitTorrent-0.008
http://search.cpan.org/~sanko/Net-BitTorrent-0.008/
peer ID Specification 
----
Net-Partty-Screen-0.01
http://search.cpan.org/~yappo/Net-Partty-Screen-0.01/
Term::Screen for Net::Partty 
----
PDF-GetImages-1.01
http://search.cpan.org/~leocharre/PDF-GetImages-1.01/
get images from pdf document 
----
PDF-GetImages-1.07
http://search.cpan.org/~leocharre/PDF-GetImages-1.07/
get images from pdf document 
----
PDF-OCR-1.06
http://search.cpan.org/~leocharre/PDF-OCR-1.06/
get ocr and images out of a pdf file 
----
POE-Component-CPAN-YACSmoke-1.22
http://search.cpan.org/~bingos/POE-Component-CPAN-YACSmoke-1.22/
Bringing the power of POE to CPAN smoke testing. 
----
POE-Component-DirWatch-0.100000
http://search.cpan.org/~groditi/POE-Component-DirWatch-0.100000/
POE directory watcher 
----
POE-Component-Net-FTP-0.001
http://search.cpan.org/~zoffix/POE-Component-Net-FTP-0.001/
non-blocking wrapper around Net::FTP 
----
Proc-SafeExec-1.3
http://search.cpan.org/~bilbo/Proc-SafeExec-1.3/
Convenient utility for executing external commands in various ways. 
----
RSH-Logging-0.3.2
http://search.cpan.org/~mluker/RSH-Logging-0.3.2/
Utility for instrumenting code using Log::Log4perl. 
----
Rose-DB-0.742
http://search.cpan.org/~jsiracusa/Rose-DB-0.742/
A DBI wrapper and abstraction layer. 
----
Rose-DB-Object-0.769
http://search.cpan.org/~jsiracusa/Rose-DB-Object-0.769/
Extensible, high performance object-relational mapper (ORM). 
----
Sjis-0.10
http://search.cpan.org/~ina/Sjis-0.10/
allows you to write your script in ShiftJIS again 
----
Sub-ForceEval-2.04
http://search.cpan.org/~lembark/Sub-ForceEval-2.04/
eval subroutines, re-throw exceptions if there is an eval; otherwise cluck and return undef. 
----
Teradata-SQL-0.04
http://search.cpan.org/~grommel/Teradata-SQL-0.04/
Perl interface to Teradata SQL 
----
Unix-PID-Tiny-0.3
http://search.cpan.org/~dmuey/Unix-PID-Tiny-0.3/
Subset of Unix::PID functionality with smaller memory footprint 
----
Win32-0.35
http://search.cpan.org/~jdb/Win32-0.35/
Interfaces to some Win32 API Functions 
----
lib-tiny-0.1
http://search.cpan.org/~dmuey/lib-tiny-0.1/
use lib, without having to use Config! 
----
lib-tiny-0.2
http://search.cpan.org/~dmuey/lib-tiny-0.2/
use lib, without having to use Config! 
----
lib-tiny-0.4
http://search.cpan.org/~dmuey/lib-tiny-0.4/
use lib, without having to use Config! 


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, 02 Apr 2008 02:13:07 GMT
From: Cosmic Cruizer <XXjbhuntxx@white-star.com>
Subject: Re: NIC Configurations
Message-Id: <Xns9A73C374F8A5ccruizermydejacom@207.115.33.102>

Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de> wrote in news:47f0a7a2$0$2601
$bb690d87@news.main-rheiner.de:

> Cosmic Cruizer wrote:
> 
>> Thanks Ron. It looks like Win32::IPConfig will do what I need.
> 
> If you are interested in the special NIC configuration (such as media 
> speed etc.) you'll have to use WMI.
> 
> I can post a script if needed.
> 
> Thomas
> 

Thomas, I would really appriciate it if you could post your script. It's 
not what I'm really try to grab, but I can use it for a learning 
experience. (Besides, maybe it is what I need, but don't know it.)

What I need to capture is the Internet Protocol properties such as the IP 
address, subnet mask, default gateway, and the preferred and alternate 
DNS servers. 

Thanks.


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

Date: Wed, 02 Apr 2008 10:40:00 +0800
From: jidanni@jidanni.org
Subject: Re: printf: zero pad after the decimal a given amount
Message-Id: <87ve31ou7z.fsf@jidanni.org>

Hi, it's me, the Original Poster. Thanks for all the replies. Mr.
Krahn employed [perlform - Perl formats], but did not check if he
produced the required results. User srz followed with a map()
solution, but my screensaver kicked in before I could figure it out
staring at it so long :-) The solution employing reverse() indeed blew
up on different input. The remaining map() solutions I will study later.

OK, this gives me what I want in the right column it makes,
and is not obfuscated to me:

use constant S     => 10000000;
for (
    1000000, 500000,        300000,       250000, 200000,
    150000,  125000,        100000,       90000,  62500,
    50000,   1.987654321E1, 777700000000, -44,    -660000000
  )
{
    for ( $_ / S ) {
        printf "%-7g:", $_;
        $_ = sprintf "%f", $_;
        /.*\.\d{3}(.*[^0])?/;
        print "$&\n";
    }
}

OK, it seems like I accept some truncation for tiny numbers.

Mainly what is bothering me about %g and %f is that apparently they
don't make full use of what they could have, if implemented.

> The 0 in .03 is useless.

e.g., %-#05.-#03f or something, whatever that would mean. Or at least
%-05.03f etc. What I'm saying is %f and/or %g are like when you
parents chose the two door sedan instead of the four door model that
it could have been, with all the bells and whistles.

Now if it is appropriate to add more creeping features to %f or %g at
this "late stage" is another question. P.S., %g is particular squishy,
turning into "e" notation if fed caterpillars, etc. Scary.


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

Date: Wed, 2 Apr 2008 04:41:28 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: printf: zero pad after the decimal a given amount
Message-Id: <fsv2ui.bk.1@news.isolution.nl>

Frank Seitz schreef:
> Dr.Ruud:

>> $ perl -wle'
>>     print "".reverse sprintf "%05.1f", "".reverse sprintf "%f", $_
>>         for qw/.1 .05 .03 .025 .02 .015 .0125 .01 .009 .00625 .005
>> 1.987654321E1/
>> '
>> 0.100
>> [...]
>> 9.876543
>>
>> ;)
>
> And how do you deal with negative numbers and numbers >= 10? ;)

Hey! There were only numbers in [0..1>, so I already extended it to
[0..10>.

Oh well,

perl -wle'
    $n=length(int abs),
    print+($_<0?"-":"").reverse sprintf"%0*.*f",$n+4,$n,
         "".reverse sprintf"%f",abs
    for qw/0 .1 .05 .03 .025 .02 .015 .0125 .01 .009 .00625 .005
1234567.89 -9876543.21/
'
0.000
0.100
0.050
0.030
0.025
0.020
0.015
0.0125
0.010
0.009
0.00625
0.005
1234567.890
-9876543.210

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

Date: Tue, 1 Apr 2008 22:23:43 -0700 (PDT)
From: Deepan Perl XML Parser <deepan.17@gmail.com>
Subject: RE Perl Pattern matching
Message-Id: <5b42482d-d60e-4906-9536-a3db3711b122@c19g2000prf.googlegroups.com>

Hi,
            I am having a string say $str, the value of it is as
below:

<responseStatus>HTTP/1.1 200 OK</responseStatus>

		<cookies>

			<cookie name="ASPSESSIONIDSQDCBDBA" path="/" domain="www-
int.juniper.net">DOCFGJEAKNOMBLHCGEMOIMBA</cookie>

		</cookies>

		<headers>

			<header name="Cache-control">private</header>

			<header name="Content-Encoding">deflate</header>

			<header name="Content-Type">text/html</header>

			<header name="Date">Wed, 26 Mar 2008 04:48:16 GMT</header>

			<header name="Server">Concealed by Juniper Networks Redline EX</
header>

			<header name="Set-
Cookie">ASPSESSIONIDSQDCBDBA=DOCFGJEAKNOMBLHCGEMOIMBA; path=/</header>

			<header name="Transfer-Encoding">chunked</header>

			<header name="Vary">Accept-Encoding, User-Agent</header>

			<header name="Via">1.1 sac-p-green-dx2 (Juniper Networks
Application Acceleration Platform - DX 5.1.8 0)</header>

			<header name="Warning">214 www-int.juniper.net &quot;Juniper
Networks DX Active&quot;</header>

			<header name="X-Powered-By">ASP.NET</header>

		</headers>

		<content>

			<contentLength>27887</contentLength>

			<compression>71.3</compression>

			<encodingScheme>deflate</encodingScheme>

			<text><![CDATA[
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"..."http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">..<html>..<head>....<title>
Intranet Home Page</title>..<script language="JavaScript" type="text/
javascript">..function clicker()..{..document.seek2.qt.value =
document.seek1.qt.value;..return true;..}</form>..  <!-- close Main2 --
>..</div><!-- close Main1 -->....</body>..</html>..
]]></text>

			<mimeType>text/html</mimeType>

		</content>

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

Now i want to get everything between "<text><![CDATA[" and "]]></
text>" [ie i need to capture the CDATA section]and i am using the
below code

if( $str =~ m#<text><!\[CDATA\[(.*)\]\]></text># )
{
	print $1;
}


But not getting anything. Can anyone find out the fault in it?


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

Date: Tue, 1 Apr 2008 22:30:04 -0700 (PDT)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: RE Perl Pattern matching
Message-Id: <519a563d-3b3f-4cd2-a1d2-c49cb5f3813a@q27g2000prf.googlegroups.com>

On Apr 2, 2:23 pm, Deepan Perl XML Parser <deepan...@gmail.com> wrote:

> if( $str =~ m#<text><!\[CDATA\[(.*)\]\]></text># )
> {
>         print $1;
>
> }
>
> But not getting anything. Can anyone find out the fault in it?

You need an "s" at the end:

if( $str =~ m#<text><!\[CDATA\[(.*)\]\]></text>#s )

See http://perldoc.perl.org/perlre.html#Modifiers


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

Date: Tue, 1 Apr 2008 22:35:35 -0700 (PDT)
From: Deepan Perl XML Parser <deepan.17@gmail.com>
Subject: Re: RE Perl Pattern matching
Message-Id: <60433791-be0d-4edd-a0b8-b673fda78d19@e10g2000prf.googlegroups.com>

On Apr 2, 10:30 am, Ben Bullock <benkasminbull...@gmail.com> wrote:
> On Apr 2, 2:23 pm, Deepan Perl XML Parser <deepan...@gmail.com> wrote:
>
> > if( $str =~ m#<text><!\[CDATA\[(.*)\]\]></text># )
> > {
> >         print $1;
>
> > }
>
> > But not getting anything. Can anyone find out the fault in it?
>
> You need an "s" at the end:
>
> if( $str =~ m#<text><!\[CDATA\[(.*)\]\]></text>#s )
>
> Seehttp://perldoc.perl.org/perlre.html#Modifiers

Thank You Ben!


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

Date: Wed, 02 Apr 2008 02:17:02 GMT
From: Cosmic Cruizer <XXjbhuntxx@white-star.com>
Subject: TieRegistry with IPConfig
Message-Id: <Xns9A73C41EB28B0ccruizermydejacom@207.115.33.102>

I'm trying to remotely look at the NIC cards on W2K3 servers that I have 
admin accounts on. When I run the following it gives me an error:

use strict;
use Win32::IPConfig;

my $ipconfig;
my $host = "some IP address"; # Changed the IP address for posting
$ipconfig = Win32::IPConfig->new($host); # This is where it fails when 
ran with admin account.
print "hostname=", $ipconfig->get_hostname, "\n"; # This is where it 
fails when ran without admin account.

This happens with admin account
C:\NIC>nic.pl
Can't use an undefined value as an ARRAY reference at 
C:/Perl/site/lib/Win32/TieRegistry.pm line 720.

This happens without using admin account (It's not first getting 
Win32::IPConfig->new($host))
C:\NIC>nic.pl
Can't call method "get_hostname" on an undefined value at C:\\NIC\nic1.pl 
line 7.

Any suggestions on what I need to do to fix this problem?

Is it failing because TieRegistry.pm is not able to get the registry 
settings for the NIC?

(I have not been having luck with anything I've tried to do to get the 
NIC info from remote servers.) 


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

Date: Wed, 2 Apr 2008 14:57:52 +0800
From: "Ela" <ela@yantai.org>
Subject: tricky use of print?
Message-Id: <fsvapi$91k$1@ijustice.itsc.cuhk.edu.hk>

I found that little can be done on debugging a variable on print, after 
visiting a page containing the module PadWalker.

I wonder whether in Perl can do something like:

$newline = '\n'

print
foo
$foo

print $newline;


I use the vim editor, in this sense, rapid coding and debugging can achieve. 
But i at least know that the newline trick doesn't work... 




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

Date: Wed, 02 Apr 2008 00:06:09 -0700
From: David Filmer <usenet@davidfilmer.com>
Subject: Re: tricky use of print?
Message-Id: <WJidnS2gWcOyrW7a4p2dnAA@giganews.com>

Ela wrote:
> $newline = '\n'

In Perl, single-quotes are not interpolated (meaning $newline is set to 
backslash-n).  You would need to use double-quotes (or qq{}) to 
interpolate \n as a newline.


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

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


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