[30992] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2237 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 26 06:09:44 2009

Date: Thu, 26 Feb 2009 03:09:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 26 Feb 2009     Volume: 11 Number: 2237

Today's topics:
    Re: debugging on stdout <ben@morrow.me.uk>
    Re: Email Purge Again <tadmc@seesig.invalid>
    Re: Email Purge Again <tadmc@seesig.invalid>
    Re: Email Purge Again <tadmc@seesig.invalid>
        Forcing list context on <$fh> <Alexander.Farber@gmail.com>
    Re: Forcing list context on <$fh> <ben@morrow.me.uk>
    Re: Net::SSH2 scp_put not working! <schaitan@gmail.com>
    Re: Net::SSH2 scp_put not working! <ben@morrow.me.uk>
    Re: Net::SSH2 scp_put not working! <schaitan@gmail.com>
    Re: Net::SSH2 scp_put not working! <ben@morrow.me.uk>
        new CPAN modules on Thu Feb 26 2009 (Randal Schwartz)
        perl implicit loop switch <alexxx.magni@gmail.com>
    Re: utf8 and chomp <whynot@pozharski.name>
    Re: very simple file stitching problem <bugbear@trim_papermule.co.uk_trim>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 26 Feb 2009 02:48:17 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: debugging on stdout
Message-Id: <hgch76-osi.ln1@osiris.mauzo.dyndns.org>


Quoth mike <no_th@nks.org>:
> 
> I appreciate your time and great perl tips, thanks.
> 
> > I will ask you again: why on earth are you keeping the offset in a file
> > at all? Just keep it in a variable.
> 
> unless you mean keep it in a var only while the script is running, I have
> stacks of instructional videos and using respectively named text files
> allows me to have mplayer automatically seek to the position I last left
> off at when I reload a vid that has such a file (and obv if it doesn't my
> script creates one for it).  there's a 15s loop which repeatedly updates
> that file w/current vid position while the video remains loaded or
> running.

OK, that's a good reason. You definitely want to read the contents of
the file in Perl before you try to overwrite it, though.

> > > 5. mplayer whether started with a vid arg or not appears to start with two
> > >    consecutive pids where the second indicates that a video is loaded or
> > >    running - to guarantee I can find mplayer's responses to my queries I
> > >    throw away everything up to "Starting..."; to guarantee I'll find 
> > >    "Starting..." I don't look for it until the "L" in ps shows up.
> > 
> > You shouldn't need to mess about with ps: just read from mplayer's
> > output until it gets to "Starting...".
> 
> obv I'm just sort of fumbling through this but how I have it now is, my
> script needs both video filename and current time position and to get
> either of them (at various places) I do:
> 
> 	$video = vid_filename_query();
> and/or
> 	print SEEK_FH vid_position_query();
> 
> 
> # -------------------
> # ask mplayer current vid's filename and return it (never includes its path):
> sub vid_filename_query {
>    writer->print("pausing_keep get_file_name\n");
>    $_ = <reader>;
>    /ANS_FILENAME=\'(.*)\'/;

This isn't safe. Firstly you are not checking the match succeeded;
secondly, if it failed you will need to read another line and try again.
It may not have happened to you yet, but mplayer can return other output
before the output you want (status updates, warnings about dropped
frames, &c.) and you want to be able to ignore it and look for the
answer to your question; you also probably want to time out if mplayer
is not responding. I would recommend you look at either Expect.pm or
IPC::Run.

>    return $1;

$1 only contains what you think it does if the match succeeded.
Generally it's better to avoid the $N variables and assign the match
result instead:

    my ($filename) = /ANS_FILENAME='(.*)'/;
    return $filename;

> "pages locked in memory" for mplayer's pid (or "Starting..." for that
> matter) appear only once a video is loaded.  until that happens mplayer
> ignores or fails to respond to the specific things I ask it (obv "get_*"
> would be meaningless if no video is loaded; and mplayer may be accepting a
> meaningless instruction and simply dropping it, I don't know).

That's not what I see. With mplayer 1.0rc2-4.2.1 I get

    ~% echo "get_time_pos" | mplayer -slave -quiet -vo null -ss 250 vid_file
    MPlayer 1.0rc2-4.2.1 (C) 2000-2007 MPlayer Team
    CPU: Intel(R) Pentium(R) 4 CPU 1500MHz (Family: 15, Model: 0, Stepping: 10)
    <snip>
    Starting playback...
    VDec: vo config request - 640 x 360 (preferred colorspace: Planar YV12)
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
    VO: [null] 640x360 => 640x360 Planar YV12  [fs] [zoom]
    ANS_TIME_POSITION=252.4
    ^C

    MPlayer interrupted by signal 2 in module: sleep_timer
    ~%

so even if the command is sent before mplayer starts I still get a
response, there's just a whole lot of other stuff in between. Expect can
handle this extremely well (including setting timeouts after which it
will give up).

> so I test for ps "L" (coincidental to "Starting...") to inform my script
> whether or not mplayer is going to respond before sending it an
> instruction (and since ps "L" is valid whether vid is running or just
> loaded but stopped, I only need to do this pid chk once/video).

It seems an extremely crude (not to mention fragile) way of checking
mplayer has finished initializing. For example, on my system mplayer
never goes into the RL state, presumably because it doesn't have
permission to lock itself into memory. 

Ben



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

Date: Wed, 25 Feb 2009 18:29:20 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Email Purge Again
Message-Id: <slrngqboj0.htu.tadmc@tadmc30.sbcglobal.net>

perl <tod@asgweb.net> wrote:


> BUT.. it's not eliminating duplicates...?


How do you know?

Did you print out the keys of %emails and see a duplicate or something?


> my $list2 = "$userpath/files/$list";
> my %emails;
> open(my $USERS, '<', $list2)
> or error("Open failed $list2 $!");
> while (<$USERS>) {
>        chomp if defined;
>        next if /^\s*$/;
>        $emails{lc $_} = 1 if ! exists $emails{lc $_};
>        #%emails = map { chomp; $_, 1 } <$USERS>;
>
> }
>
> close($USERS) or warn $!;


You should try and make a short and complete program *that we can run*
as suggested in the Posting Guidelines that are posted here frequently.


-----------------------
#!/usr/bin/perl
use warnings;
use strict;

my %emails;
while (<DATA>) {
       chomp;
       next if /^\s*$/;
       $emails{lc $_} = 1 if ! exists $emails{lc $_};
}

print "$_\n" for sort keys %emails;

__DATA__
Larry Ellison
Todd Anderson
Bill Gates
Todd Anderson
Meg Whitman
-----------------------


Works for me...


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


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

Date: Wed, 25 Feb 2009 18:23:01 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Email Purge Again
Message-Id: <slrngqbo75.htu.tadmc@tadmc30.sbcglobal.net>

perl <tod@asgweb.net> wrote:


> With this code.. %emails = map { chomp; $_, 1 } <$list>;
>  I get this error
> Can't modify concatenation (.) or string in scalar assignment at
> email.cgi line 535, near "<$list>;"


It is not possible that you are getting that error message
with that code.

There is no scalar assignment in that code, only a list assignment.


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


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

Date: Wed, 25 Feb 2009 18:18:24 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Email Purge Again
Message-Id: <slrngqbnug.htu.tadmc@tadmc30.sbcglobal.net>

perl <tod@asgweb.net> wrote:

> I'm not using strict. Any ideas?


Yes.

Start using strict.

:-)


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


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

Date: Thu, 26 Feb 2009 02:25:44 -0800 (PST)
From: "A. Farber" <Alexander.Farber@gmail.com>
Subject: Forcing list context on <$fh>
Message-Id: <75c3345e-8b0e-4bd7-a39b-6b8ac4645da4@a39g2000yqc.googlegroups.com>

Hello,

I have a CGI-script for creating new users.
You can either upload a CSV file for a batch
of users or fill out a web for for just 1 user.

So I have a ref to array which contains
either lines from the uploaded CSV file or
just 1 line constructed from the web form:

        my $input = $fh ? [ <$fh> ] :
            # trick: create a line as if a Lotus Notes CSV-file has
been uploaded
            [ sprintf '%s;%s;;;%s;XXX;%s;;;XXX;%s-%s;;%s%s.
%s@mycompany.com;;XXX;;;;%s;',
                $QUERY->param('last'),
                $QUERY->param('first'),
                $QUERY->param('pass'),
                $QUERY->param('user'),
                $QUERY->param('company'),
                $QUERY->param('city'),
                ($QUERY->param('company') =~ /^mycompany$/i ? '' :
'ext-'),
                $QUERY->param('first'),
                $QUERY->param('last'),
                ($QUERY->param('inform') =~ /nobody/i ? '' : $QUERY-
>param('inform')) ];

        my $loh = validate_input($input);

My problem above is that [ <$fh> ] seems
to be evaluated in a scalar context and
I get just 1 line instead of all.

Is there a nice way to force list context on it?

Thanks
Alex


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

Date: Thu, 26 Feb 2009 10:41:18 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Forcing list context on <$fh>
Message-Id: <e78i76-18n.ln1@osiris.mauzo.dyndns.org>


Quoth "A. Farber" <Alexander.Farber@gmail.com>:
> 
> I have a CGI-script for creating new users.
> You can either upload a CSV file for a batch
> of users or fill out a web for for just 1 user.
> 
> So I have a ref to array which contains
> either lines from the uploaded CSV file or
> just 1 line constructed from the web form:
> 
>         my $input = $fh ? [ <$fh> ] :
>             # trick: create a line as if a Lotus Notes CSV-file has
> been uploaded
<snip>
> 
> My problem above is that [ <$fh> ] seems
> to be evaluated in a scalar context

Nope. The inside of [ ] is in list context.

> and I get just 1 line instead of all.

Then your problem is somewhere else.

Ben



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

Date: Wed, 25 Feb 2009 23:25:00 -0800 (PST)
From: Krishna Chaitanya <schaitan@gmail.com>
Subject: Re: Net::SSH2 scp_put not working!
Message-Id: <90860434-eef5-47c4-92ce-a3a267e98735@b16g2000yqb.googlegroups.com>

> Have you seen =A0http://perlmonks.org?node_id=3D635521=A0

Yes, I'd seen it earlier. I hope blocking(0) means asynchronous or non-
blocking I/O. It poses a problem for me : (a) I've nothing else to do
while waiting for async I/O to complete and why is the program hanging
anyway just because blocking(1) is used? (b) blocking(0) causes
scp_put to fail since this function requires blocking I/O.

In closing, it'd be great to know why blocking I/O poses a problem for
issuing commands and gathering output.....it's not like the network is
super-busy or something. Traffic's pretty relaxed here. Also, the
scp_put command sends the files real fast if blocking(1) is used. Any
help?


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

Date: Thu, 26 Feb 2009 08:01:01 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Net::SSH2 scp_put not working!
Message-Id: <tquh76-ecm.ln1@osiris.mauzo.dyndns.org>


Quoth Krishna Chaitanya <schaitan@gmail.com>:
> > Have you seen  http://perlmonks.org?node_id=635521 
> 
> Yes, I'd seen it earlier. I hope blocking(0) means asynchronous or non-
> blocking I/O. It poses a problem for me : (a) I've nothing else to do
> while waiting for async I/O to complete and why is the program hanging
> anyway just because blocking(1) is used? (b) blocking(0) causes
> scp_put to fail since this function requires blocking I/O.
> 
> In closing, it'd be great to know why blocking I/O poses a problem for
> issuing commands and gathering output.....it's not like the network is
> super-busy or something. Traffic's pretty relaxed here. Also, the
> scp_put command sends the files real fast if blocking(1) is used. Any
> help?

I'm not sure you understand what non-blocking IO means. All it means is
that if you have to wait for something (either a response from the other
side or buffer space to send a request) then the function will fail
immediately with EAGAIN so you can do something else in the meanwhile.
If a program is hanging on a blocking call, setting non-blocking mode
won't help: you'll still end up having to wait for the block to go away,
it's just a lot harder to do right. 

None of this is in any way affected by netwrok speed, or affects the
speed of your program. It's just a question of how you want to structure
your program, and for simple programs only doing one thing at a time the
right-side-out model (blocking IO) is always the right answer.

Ben



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

Date: Thu, 26 Feb 2009 01:37:42 -0800 (PST)
From: Krishna Chaitanya <schaitan@gmail.com>
Subject: Re: Net::SSH2 scp_put not working!
Message-Id: <b4ea8138-25d9-4020-9506-c62b865003dc@f33g2000vbf.googlegroups.com>

I understood what you said. Maybe I'm not able to communicate my
concern in the right manner...my program structure is this:

#!/usr/bin/perl

use warnings;
use strict;

use Net::SSH2;

my $ssh2 = Net::SSH2->new();

$ssh2->debug(1);

$ssh2->connect('10.0.1.174') or die;

if ($ssh2->auth_password('inmdev','inmdev')) {
        print "Authorization successful\n";
        my $chan2 = $ssh2->channel();
        $chan2->blocking(0);
        $chan2->shell();
        print $chan2 "uname -a\n";
        print "LINE : $_" while <$chan2>;
        $chan2->close();
        $chan2->blocking(1);
        $ssh2->scp_put("/root/perl_progs/1.pl","/tmp/1.pl") or warn
"Could not scp the file  ", $ssh2->error;
} else {
        print "Authorization failure\n";
}

If I don't put the "$chan2->blocking(0);" or if I put "$chan2->blocking
(1);", it just hangs after the "Authorization successful" message.
Every single time. Any reason for this to happen? Something wrong in
the code above?

If you think blocking I/O is the way to go, it's OK with me provided
the hangs don't occur.....I've been at this problem now since many
days, as you can see. :-(

The basic problem I'm trying to solve is to be able to run commands on
remote linux machines through ssh 2 and copy some files to remote
linux machines. Do you have any suggestion for the program structure?
Can you pls. point me in the right direction if I approached the
problem wrongly? Thanks a lot, Ben, for your time and thought.


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

Date: Thu, 26 Feb 2009 10:36:21 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Net::SSH2 scp_put not working!
Message-Id: <5u7i76-18n.ln1@osiris.mauzo.dyndns.org>


Quoth Krishna Chaitanya <schaitan@gmail.com>:
> I understood what you said. Maybe I'm not able to communicate my
> concern in the right manner...my program structure is this:
> 
> #!/usr/bin/perl
> 
> use warnings;
> use strict;
> 
> use Net::SSH2;
> 
> my $ssh2 = Net::SSH2->new();
> 
> $ssh2->debug(1);
> 
> $ssh2->connect('10.0.1.174') or die;
> 
> if ($ssh2->auth_password('inmdev','inmdev')) {
>         print "Authorization successful\n";
>         my $chan2 = $ssh2->channel();
>         $chan2->blocking(0);
>         $chan2->shell();

You *must* check for errors. As I keep telling you, the primary effect
of setting ->blocking(0) is that functions will fail with
LIBSSH2_ERROR_EAGAIN a lot. If you want to use non-blocking IO, you need
to check for and handle this error, which will certainly involve using
the ->poll method.

>         print $chan2 "uname -a\n";
>         print "LINE : $_" while <$chan2>;

Do you get any output here? I would expect that if you've set
nonblocking mode and it's trying to block that both the print and the <>
would immediately fail with EAGAIN as well, and you'd get no output. Is
this not the case?

>         $chan2->close();
>         $chan2->blocking(1);
>         $ssh2->scp_put("/root/perl_progs/1.pl","/tmp/1.pl") or warn
> "Could not scp the file  ", $ssh2->error;
> } else {
>         print "Authorization failure\n";
> }
> 
> If I don't put the "$chan2->blocking(0);" or if I put "$chan2->blocking
> (1);", it just hangs after the "Authorization successful" message.
> Every single time. Any reason for this to happen? Something wrong in
> the code above?

I don't know. Can you turn on some sort of debug trace, or use tcpdump,
to see what's actually happening? You will of course need to know more
about the ssh protocol that I do to make sense of it... :)

Since you're only executing a single command on your Channel, have you
tried using ->exec instead of ->shell? Messing around with talking to a
remote shell seems worth avoiding if you can.

Ben



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

Date: Thu, 26 Feb 2009 05:42:26 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Feb 26 2009
Message-Id: <KFnruq.18u6@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.

Any-Moose-0.05
http://search.cpan.org/~flora/Any-Moose-0.05/
use Moose or Mouse modules 
----
B-Hooks-OP-Annotation-0.40
http://search.cpan.org/~chocolate/B-Hooks-OP-Annotation-0.40/
annotate and delegate hooked OPs 
----
B-Hooks-OP-Annotation-0.41
http://search.cpan.org/~chocolate/B-Hooks-OP-Annotation-0.41/
annotate and delegate hooked OPs 
----
B-Hooks-OP-Annotation-0.42
http://search.cpan.org/~chocolate/B-Hooks-OP-Annotation-0.42/
annotate and delegate hooked OPs 
----
BioPerl-run-1.6.1
http://search.cpan.org/~cjfields/BioPerl-run-1.6.1/
----
CPAN-Mini-Indexed-0.02_01.1
http://search.cpan.org/~nkh/CPAN-Mini-Indexed-0.02_01.1/
Index the content of your CPAN mini repository 
----
CPANPLUS-Dist-Build-0.06_05
http://search.cpan.org/~bingos/CPANPLUS-Dist-Build-0.06_05/
CPANPLUS plugin to install packages that use Build.PL 
----
Capture-Tiny-0.04
http://search.cpan.org/~dagolden/Capture-Tiny-0.04/
Capture STDOUT and STDERR from Perl, XS or external programs 
----
Data-Localize-0.00003
http://search.cpan.org/~dmaki/Data-Localize-0.00003/
Alternate Data Localization API 
----
DateTime-Format-CLDR-1.04
http://search.cpan.org/~maros/DateTime-Format-CLDR-1.04/
Parse and format CLDR time patterns 
----
Device-MAC-1.00
http://search.cpan.org/~jasonk/Device-MAC-1.00/
Handle hardware MAC Addresses (EUI-48 and EUI-64) 
----
Device-OUI-1.01
http://search.cpan.org/~jasonk/Device-OUI-1.01/
Resolve an Organizationally Unique Identifier 
----
Device-WWN-1.00
http://search.cpan.org/~jasonk/Device-WWN-1.00/
Encode/Decode Fiber Channel World Wide Names 
----
Fey-ORM-0.21
http://search.cpan.org/~drolsky/Fey-ORM-0.21/
A Fey-based ORM 
----
Filter-1.35
http://search.cpan.org/~pmqs/Filter-1.35/
----
HTML-Parser-Simple-1.01
http://search.cpan.org/~rsavage/HTML-Parser-Simple-1.01/
Parse nice HTML files without needing a compiler 
----
IO-Async-Loop-Epoll-0.02
http://search.cpan.org/~pevans/IO-Async-Loop-Epoll-0.02/
a Loop using an IO::Epoll object 
----
Kools-Okapi-263.003
http://search.cpan.org/~muguet/Kools-Okapi-263.003/
Perl extension for the OKAPI api of Kondor+ 2.6 
----
Lexical-Types-0.02
http://search.cpan.org/~vpit/Lexical-Types-0.02/
Extend the semantics of typed lexicals. 
----
Linux-APT-0.01
http://search.cpan.org/~wilsond/Linux-APT-0.01/
Interface with APT for Debian distributions 
----
Mail-Builder-Simple-0.07
http://search.cpan.org/~teddy/Mail-Builder-Simple-0.07/
Send UTF-8 HTML and text email with attachments and inline images, eventually using templates 
----
MediaWiki-Bot-Plugin-ImageTester-0.2.3
http://search.cpan.org/~dcollins/MediaWiki-Bot-Plugin-ImageTester-0.2.3/
a plugin for MediaWiki::Bot which contains image copyright checking and analysis for the english wikipedia 
----
Module-Build-0.32
http://search.cpan.org/~ewilhelm/Module-Build-0.32/
Build and install Perl modules 
----
Net-DirectConnect-0.02
http://search.cpan.org/~pro/Net-DirectConnect-0.02/
Perl Direct Connect protocol implementation 
----
Net-Interface-1.004
http://search.cpan.org/~miker/Net-Interface-1.004/
Perl extension to access network interfaces 
----
NetHack-Item-0.07
http://search.cpan.org/~sartak/NetHack-Item-0.07/
parse and interact with a NetHack item 
----
POE-1.003_02
http://search.cpan.org/~rcaputo/POE-1.003_02/
portable multitasking and networking framework for Perl 
----
POE-Test-Loops-1.003_02
http://search.cpan.org/~rcaputo/POE-Test-Loops-1.003_02/
Reusable tests for POE::Loop authors 
----
Parse-Eyapp-1.142
http://search.cpan.org/~casiano/Parse-Eyapp-1.142/
Extensions for Parse::Yapp 
----
Perl-Dist-WiX-v0.14
http://search.cpan.org/~csjewell/Perl-Dist-WiX-v0.14/
Experimental 4th generation Win32 Perl distribution builder 
----
Perl-Dist-WiX-v0.1401
http://search.cpan.org/~csjewell/Perl-Dist-WiX-v0.1401/
Experimental 4th generation Win32 Perl distribution builder 
----
Pod-POM-View-DocBook-0.02
http://search.cpan.org/~andrewf/Pod-POM-View-DocBook-0.02/
DocBook XML view of a Pod Object Model 
----
Pod-POM-View-DocBook-0.03
http://search.cpan.org/~andrewf/Pod-POM-View-DocBook-0.03/
DocBook XML view of a Pod Object Model 
----
Pod-ToDocBook-0.5
http://search.cpan.org/~zag/Pod-ToDocBook-0.5/
Pluggable converter POD data to DocBook. 
----
Queue-Q4M-0.00018
http://search.cpan.org/~dmaki/Queue-Q4M-0.00018/
Simple Interface To q4m 
----
RDF-Converter-CSV-0.02
http://search.cpan.org/~arshad/RDF-Converter-CSV-0.02/
Converts comma separated CSV to RDF 
----
RDF-Converter-CSV-0.03
http://search.cpan.org/~arshad/RDF-Converter-CSV-0.03/
Converts comma separated CSV to RDF 
----
RSSycklr-0.09
http://search.cpan.org/~ashley/RSSycklr-0.09/
(beta) Highly configurable recycling of syndication (RSS/Atom) feeds into tailored, guaranteed XHTML fragments. 
----
Search-Sitemap-2.05
http://search.cpan.org/~jasonk/Search-Sitemap-2.05/
Perl extension for managing Search Engine Sitemaps 
----
Simo-Error-0.0205
http://search.cpan.org/~kimoto/Simo-Error-0.0205/
Error object for Simo 
----
Simo-Util-0.0203
http://search.cpan.org/~kimoto/Simo-Util-0.0203/
Utility Class for Simo 
----
Simo-Wrapper-0.0207
http://search.cpan.org/~kimoto/Simo-Wrapper-0.0207/
Object wrapper to manipulate attrs and methods. 
----
SystemC-Vregs-1.462
http://search.cpan.org/~wsnyder/SystemC-Vregs-1.462/
Utility routines used by vregs 
----
Test-LeakTrace-0.04
http://search.cpan.org/~gfuji/Test-LeakTrace-0.04/
Traces memory leaks 
----
Tie-DxHash-1.05
http://search.cpan.org/~kruscoe/Tie-DxHash-1.05/
keeps insertion order; allows duplicate keys 
----
Verilog-Perl-3.120
http://search.cpan.org/~wsnyder/Verilog-Perl-3.120/
----
Weather-Com-0.5.5
http://search.cpan.org/~schnueck/Weather-Com-0.5.5/
fetching weather information from *weather.com* 
----
WebDAO-1.00
http://search.cpan.org/~zag/WebDAO-1.00/
platform for easy creation of high-performance and scalable web applications 
----
WebDAO-1.01
http://search.cpan.org/~zag/WebDAO-1.01/
platform for easy creation of high-performance and scalable web applications 
----
WebDAO-Store-MLDBM-1.00
http://search.cpan.org/~zag/WebDAO-Store-MLDBM-1.00/
Implement session store using MLDBM 
----
local-lib-1.003002
http://search.cpan.org/~apeiron/local-lib-1.003002/
create and use a local lib/ for perl modules with PERL5LIB 
----
threads-1.72
http://search.cpan.org/~jdhedden/threads-1.72/
Perl interpreter-based threads 
----
threads-emulate-0.0.2
http://search.cpan.org/~fco/threads-emulate-0.0.2/
Create and use emulated threads (and share vars easyer) 
----
threads-emulate-0.0.3
http://search.cpan.org/~fco/threads-emulate-0.0.3/
Create and use emulated threads (and share vars easyer) 
----
threads-shared-1.28
http://search.cpan.org/~jdhedden/threads-shared-1.28/
Perl extension for sharing data structures between threads 


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, 26 Feb 2009 02:09:25 -0800 (PST)
From: "alexxx.magni@gmail.com" <alexxx.magni@gmail.com>
Subject: perl implicit loop switch
Message-Id: <36dd9905-c192-4c3b-8998-5f2df269b5a2@b16g2000yqb.googlegroups.com>

<disclaimer: I'm not an expert at all in oneliners>

 ... yet I sometimes use them to process datafiles.

And I often find it useful to use the -n switch to extract data, one
line at a time.
But what I'm really missing is the possibility to have an incremental
variable reminding me of which line I'm processing, e.g.:

perl -wne 'my $i=0;/(\S+)\s+(\S+)/;print "$i $2\n";$i++' e.dat

of course it doesnt work, but I'd like to have a way for $i to be
incremented - there is a hope of accomplishing this?

thanks!


alessandro


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

Date: Thu, 26 Feb 2009 01:43:03 +0200
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: utf8 and chomp
Message-Id: <slrngqblue.f9t.whynot@orphan.zombinet>

On 2009-02-25, Dr.Ruud <rvtol+usenet@xs4all.nl> wrote:
*SKIP*
> Even more impressive:
>
> $ perl -Mencoding=utf8 -wle '
>      my $c;
>      { use bytes;
>        $c = "EUR:\xE2\x82\xAC";
>        print length $c;
>      }
>      print length $c;
>      $c .= "";
>      print length $c;
> '
> 7
> 7
> 5
>
> (perl 5.8.5)
>

And I'm not impressed (any more) it's undocumented.


-- 
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom


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

Date: Thu, 26 Feb 2009 10:36:21 +0000
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: very simple file stitching problem
Message-Id: <f_qdnan5rtE47TvUnZ2dnUVZ8reWnZ2d@posted.plusnet>

Brian wrote:
> it may not be obvious from this novitiate perl code below, but i am
> trying to add the lines of one file to the lines of another file to
> create a third file.  the lines in each file are semantically related,
> and will always 'line up.'

If you're on *nix, use the "paste" command.

   BugBear


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

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


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