[29073] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 317 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 9 03:09:59 2007

Date: Mon, 9 Apr 2007 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           Mon, 9 Apr 2007     Volume: 11 Number: 317

Today's topics:
        "Standard" template / config modules? (Jamie)
    Re: "Standard" template / config modules? <cwilbur@chromatico.net>
    Re: "Standard" template / config modules? <DJStunks@gmail.com>
    Re: "Standard" template / config modules? <spamtrap@dot-app.org>
    Re: "Standard" template / config modules? (Jamie)
    Re: How to turn off "Caps Lock" from Perl script. <jwkenne@attglobal.net>
        new CPAN modules on Mon Apr  9 2007 (Randal Schwartz)
    Re: Parallel::Pvm and Inline C <sisyphus1@nomail.afraid.org>
    Re: Parallel::Pvm and Inline C <ilpavox@gmail.com>
    Re: Parallel::Pvm and Inline C <ilpavox@gmail.com>
    Re: Parallel::Pvm and Inline C <sisyphus1@nomail.afraid.org>
        parsing / formatting historical dates <friendly@yorku.ca>
    Re: parsing / formatting historical dates <nospam@somewhere.com>
    Re: parsing / formatting historical dates usenet@DavidFilmer.com
    Re: parsing / formatting historical dates <noreply@gunnar.cc>
    Re: parsing / formatting historical dates <purlgurl@purlgurl.net>
    Re: Passing hash to a subroutine <raykyoto@gmail.com>
    Re: Passing hash to a subroutine <raykyoto@gmail.com>
        pp question (PAR::Packer) <iler.ml@gmail.com>
    Re: pp question (PAR::Packer) <lambik@kieffer.nl>
        what's wrong calling a Perl/CGI script in Perl/CGI scri <nitte.sudhir@gmail.com>
    Re: what's wrong calling a Perl/CGI script in Perl/CGI  <noreply@gunnar.cc>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 08 Apr 2007 18:22:21 GMT
From: nospam@geniegate.com (Jamie)
Subject: "Standard" template / config modules?
Message-Id: <Lc1176035609214910x8b9a588@pong.podro.com>

Hello Newsgroup,

Just soliciting conversation, not that I really could do anything
about it if I wanted to.. but..

Two of the things PHP have that perl has in triplicates are templates
and configuration modules. 

PHP ships with INI reading utilities and the <?php .. ?> "standard" 
approach to templates. Perl doesn't seem to ship with anything like
that. (the closest we get to a "standard" text template is the 
formatted reports, as far as I know, there is no standard 
configuration modules)

The perl flexibility is nice, however it makes it really difficult to
design web applications in a manner that allows them to *easily* adapt
into existing web sites. I know I've personally written several template
modules, each for a different itch and sometimes just so there are no
module dependencies.

With PHP, it's much easier. You get one choice and it'll probably fit
in (or can be made to do so). 

What do you think the chances are that they'll pick a standard, 
simple, no-fuss "tiny" template implementation and configuration 
module for the core modules?

Jamie
-- 
http://www.geniegate.com                    Custom web programming
Perl * Java * UNIX                        User Management Solutions


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

Date: 08 Apr 2007 15:32:02 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: "Standard" template / config modules?
Message-Id: <877ismaci5.fsf@mithril.chromatico.net>

>>>>> "J" == Jamie  <nospam@geniegate.com> writes:

    J> What do you think the chances are that they'll pick a standard,
    J> simple, no-fuss "tiny" template implementation and
    J> configuration module for the core modules?

Zero.  There are too many tradeoffs among the various options, and
TIMTOWDTI is a core value.

Charlton


-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: 8 Apr 2007 19:45:44 -0700
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: "Standard" template / config modules?
Message-Id: <1176086744.509549.18370@o5g2000hsb.googlegroups.com>

On Apr 8, 1:32 pm, Charlton Wilbur <cwil...@chromatico.net> wrote:
> >>>>> "J" == Jamie  <nos...@geniegate.com> writes:
>
>     J> What do you think the chances are that they'll pick a standard,
>     J> simple, no-fuss "tiny" template implementation and
>     J> configuration module for the core modules?
>
> Zero.  There are too many tradeoffs among the various options, and
> TIMTOWDTI is a core value.

This begs the question in my mind - who decides which modules are core
in a given release?  So, when 5.10 goes official, if it does, who
decides which modules not included in 5.8 will be included in the
distribution?  And do all 5.8 core modules automatically make the cut?

-jp



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

Date: Mon, 09 Apr 2007 00:06:00 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: "Standard" template / config modules?
Message-Id: <m21wiup4yf.fsf@local.wv-www.com>

"DJ Stunks" <DJStunks@gmail.com> writes:

> On Apr 8, 1:32 pm, Charlton Wilbur <cwil...@chromatico.net> wrote:
>> >>>>> "J" == Jamie  <nos...@geniegate.com> writes:
>>
>>     J> What do you think the chances are that they'll pick a standard,
>>     J> simple, no-fuss "tiny" template implementation and
>>     J> configuration module for the core modules?
>>
>> Zero.  There are too many tradeoffs among the various options, and
>> TIMTOWDTI is a core value.
>
> This begs the question in my mind - who decides which modules are core
> in a given release?

Perl5-Porters will hopefully come to an agreement on it. Failing that, I
believe the pumpking, who is after all basically the "release manager" for
that release, makes the decision.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Mon, 09 Apr 2007 06:13:58 GMT
From: nospam@geniegate.com (Jamie)
Subject: Re: "Standard" template / config modules?
Message-Id: <Lc1176078903214910x8b69da4@pong.podro.com>

In <877ismaci5.fsf@mithril.chromatico.net>,
Charlton Wilbur <cwilbur@chromatico.net> mentions:
>>>>>> "J" == Jamie  <nospam@geniegate.com> writes:
>
>    J> What do you think the chances are that they'll pick a standard,
>    J> simple, no-fuss "tiny" template implementation and
>    J> configuration module for the core modules?
>
>Zero.  There are too many tradeoffs among the various options, and
>TIMTOWDTI is a core value.

What are some strategies for handling the problem? As far as I can
tell, all hope is pretty much lost if you want to design something
to "fit in" with something else, since "something else" could be
in any template format (or PHP for that matter)

But as far as something like, "Config::General" (for example) is
it considered accepted practice to just include it with the script
and install it as a local package?

Jamie
-- 
http://www.geniegate.com                    Custom web programming
Perl * Java * UNIX                        User Management Solutions


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

Date: Sun, 08 Apr 2007 22:50:53 -0400
From: "John W. Kennedy" <jwkenne@attglobal.net>
Subject: Re: How to turn off "Caps Lock" from Perl script.
Message-Id: <sShSh.91$Ex6.61@newsfe12.lga>

Peter J. Holzer wrote:
> On 2007-04-04 16:03, Uri Guttman <uri@stemsystems.com> wrote:
>> easy way to redfine keys so capslock becomes control like it was
>> before ibm ruined the keyboard. know why they did that? capslock was a
>> useful key on manual typewriters since you had to really push hard on
>> shift to lift up the key carriage. when electric typewriters came out
>> they kept that evn though it wasn't hard to push shift anymore
>> (especially with the selectric golf ball where keys were all
>> electronic). so when ibm created the pc they wanted to keep it just
>> like the office typewriter to ease conversions. well, they kept
>> capslock but needed a control key so they put that in a lousy place.
> 
> Historically that can't be right. The first IBM keyboards did have the
> control key where caps lock is now and caps lock in the lower right
> corner[1][2]. The caps-lock key only moved to its current position in
> 1986. IBM may have considered catering to former typewriter users more
> important than catering to existing computer users, but they had to make
> a conscious decision to *change* the layout - they didn't just keep
> the typewriter layout.
> 
> (BTW, the story I heard at that time was that IBM had to change it to
> conform to existing standards: The layout for typewriters was
> standardized and the keyboards of "text processing systems" had to be
> the same as for typewriters, so if they wanted to sell their computers
> for that purpose they had to supply conforming keyboards).

The 3270 series of dumb terminals for mainframes and the 5250 series of 
dumb terminals for mid-size systems also had to be considered. (And they 
had multiple keyboards, too. The 3270 series had general-purpose, 
data-entry, mainframe-operator-console, APL, and text keyboards, not 
counting the special 3270-emulation PCs, which had keyboards of their 
very own.) IBM was making something like twenty basically different 
keyboard layouts for the US alone, and something had to be done.

-- 
John W. Kennedy
"...if you had to fall in love with someone who was evil, I can see why 
it was her."
   -- "Alias"
* TagZilla 0.066 * http://tagzilla.mozdev.org


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

Date: Mon, 9 Apr 2007 04:42:08 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Apr  9 2007
Message-Id: <JG7rq8.1wnM@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.

Audio-MPD-0.17.1
http://search.cpan.org/~jquelin/Audio-MPD-0.17.1/
class to talk to MPD (Music Player Daemon) servers
----
Audio-MPD-0.17.2
http://search.cpan.org/~jquelin/Audio-MPD-0.17.2/
class to talk to MPD (Music Player Daemon) servers
----
CGI-Minimal-1.26
http://search.cpan.org/~snowhare/CGI-Minimal-1.26/
A lightweight CGI form processing package
----
Data-Faker-JapaneseFemaleName-0.01
http://search.cpan.org/~bokutin/Data-Faker-JapaneseFemaleName-0.01/
Data::Faker plugin
----
Data-Throttler-0.01
http://search.cpan.org/~mschilli/Data-Throttler-0.01/
Limit data throughput
----
Devel-FastProf-0.07
http://search.cpan.org/~salva/Devel-FastProf-0.07/
"fast" perl per-line profiler
----
Finance-Bank-NetBranch-0.07
http://search.cpan.org/~kulp/Finance-Bank-NetBranch-0.07/
Manage your NetBranch accounts with Perl
----
GPS-Point-0.06
http://search.cpan.org/~mrdvt/GPS-Point-0.06/
Provides an object interface for a GPS point.
----
Graphics-ColorUtils-0.11
http://search.cpan.org/~janert/Graphics-ColorUtils-0.11/
Easy-to-use color space conversions and more.
----
Gungho-0.02
http://search.cpan.org/~dmaki/Gungho-0.02/
Yet Another High Performance Web Crawler Framework
----
HTML-Tested-JavaScript-0.05
http://search.cpan.org/~bosu/HTML-Tested-JavaScript-0.05/
JavaScript enabled HTML::Tested widgets.
----
IO-All-0.38
http://search.cpan.org/~ingy/IO-All-0.38/
IO::All of it to Graham and Damian!
----
Lingua-EN-Fathom-1.11
http://search.cpan.org/~kimryan/Lingua-EN-Fathom-1.11/
Measure readability of English text
----
POE-Component-AIO-1.00
http://search.cpan.org/~xantus/POE-Component-AIO-1.00/
Asynchronous Input/Output for POE
----
Test-Command-0.01
http://search.cpan.org/~danboo/Test-Command-0.01/
Test routines for external commands
----
Tk-WidgetDump-1.33
http://search.cpan.org/~srezic/Tk-WidgetDump-1.33/
dump the widget hierarchie
----
XML-Amazon-0.03
http://search.cpan.org/~hedwig/XML-Amazon-0.03/
Perl extension for getting information from Amazon
----
wxPerl-Constructors-v0.0.2
http://search.cpan.org/~ewilhelm/wxPerl-Constructors-v0.0.2/
parameterized constructors


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: Mon, 9 Apr 2007 00:48:19 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Parallel::Pvm and Inline C
Message-Id: <461900a8$0$9776$afc38c87@news.optusnet.com.au>


"ilp" <ilpavox@gmail.com> wrote in message 
news:1176009492.986524.219550@n76g2000hsh.googlegroups.com...
> Has anyone gotten inline C to work with Parallel::Pvm.  It seems to
> choke on the "use Inline C;" statement.  Thank.
>

Not sure that anyone has tried :-)

In general, there's no problem combining perl extensions with Inline::C. A 
simple demo script might help. (Make it as minimal as possible - and also 
provide a copy'n'paste of the error messages produced.)

Cheers,
Rob 



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

Date: 8 Apr 2007 21:35:21 -0700
From: "ilp" <ilpavox@gmail.com>
Subject: Re: Parallel::Pvm and Inline C
Message-Id: <1176093320.966534.237050@y66g2000hsf.googlegroups.com>

On Apr 8, 10:48 am, "Sisyphus" <sisyph...@nomail.afraid.org> wrote:
> "ilp" <ilpa...@gmail.com> wrote in message
>
> news:1176009492.986524.219550@n76g2000hsh.googlegroups.com...
>
> > Has anyone gotten inline C to work with Parallel::Pvm.  It seems to
> > choke on the "use Inline C;" statement.  Thank.
>
> Not sure that anyone has tried :-)
>
> In general, there's no problem combining perl extensions with Inline::C. A
> simple demo script might help. (Make it as minimal as possible - and also
> provide a copy'n'paste of the error messages produced.)
>
> Cheers,
> Rob

Welp, I'd have to butcher a rather long module, but here's the jist of
it:
Assume that pvm is running and has a few hosts added.
mod1.pl:

use Parallel::Pvm;

my ($ntask,$tids) = Parallel::Pvm::spawn( "/foo/bar.pl", 1);

1;
------
bar.pl:

use Inline CPP => DATA =>
    LIBS => '-lalib;

print "Hello Parallel World!";

1;
----

output:

Terminated



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

Date: 8 Apr 2007 21:38:13 -0700
From: "ilp" <ilpavox@gmail.com>
Subject: Re: Parallel::Pvm and Inline C
Message-Id: <1176093493.324717.106540@d57g2000hsg.googlegroups.com>

On Apr 9, 12:35 am, "ilp" <ilpa...@gmail.com> wrote:
> On Apr 8, 10:48 am, "Sisyphus" <sisyph...@nomail.afraid.org> wrote:
>
> > "ilp" <ilpa...@gmail.com> wrote in message
>
> >news:1176009492.986524.219550@n76g2000hsh.googlegroups.com...
>
> > > Has anyone gotten inline C to work with Parallel::Pvm.  It seems to
> > > choke on the "use Inline C;" statement.  Thank.
>
> > Not sure that anyone has tried :-)
>
> > In general, there's no problem combining perl extensions with Inline::C. A
> > simple demo script might help. (Make it as minimal as possible - and also
> > provide a copy'n'paste of the error messages produced.)
>
> > Cheers,
> > Rob
>
> Welp, I'd have to butcher a rather long module, but here's the jist of
> it:
> Assume that pvm is running and has a few hosts added.
> mod1.pl:
>
> use Parallel::Pvm;
>
> my ($ntask,$tids) = Parallel::Pvm::spawn( "/foo/bar.pl", 1);
>
> 1;
> ------
> bar.pl:
>
> use Inline CPP => DATA =>
>     LIBS => '-lalib;
>
> print "Hello Parallel World!";
>
> 1;
> ----
>
> output:
>
> Terminated


Sorry, 'bar.pl' would actually be:

 bar.pl:

 use Inline C => DATA =>
     LIBS => '-lalib;

 print "Hello Parallel World!";

 1;

__DATA__
__C__


__END__
__C__



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

Date: Mon, 9 Apr 2007 15:08:07 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Parallel::Pvm and Inline C
Message-Id: <4619ca2d$0$9771$afc38c87@news.optusnet.com.au>


"ilp" <ilpavox@gmail.com> wrote in message 
news:1176093493.324717.106540@d57g2000hsg.googlegroups.com...
 .
 .
>
> Sorry, 'bar.pl' would actually be:
>
> bar.pl:
>
> use Inline C => DATA =>
>     LIBS => '-lalib;
>
> print "Hello Parallel World!";
>
> 1;
>
> __DATA__
> __C__
>
>
> __END__
> __C__
>

You might get some hint of what's going wrong if you run verbosely - by 
starting  that script with:


 use Inline C => DATA =>
     BUILD_NOISY => 1,
     LIBS => '-lalib';

Do you really need the "LIBS => '-lalib'" entry to produce the error ? I 
wouldn't expect a line as inoccuous as that to have any effect on whether an 
error occurs or not - though, admittedly, I don't know what Parallel::Pvm 
does, and if it's doing something a bit weird then I guess anything is 
possible :-)

Cheers,
Rob




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

Date: 8 Apr 2007 16:47:47 -0700
From: "friendly@yorku.ca" <friendly@yorku.ca>
Subject: parsing / formatting historical dates
Message-Id: <1176076067.533148.69740@y66g2000hsf.googlegroups.com>

I'm reading/re-writing data files with historical dates that go back
potentially to antiquity. e.g., one such has name, lifespan, birth
date/place,
death date/place as \t separated fields.

Galilei, Galileo    1564-1642    b: 15 Feb 1564, Pisa  d: 8 Jan 1642,
Arcetri, Italy
Lalanne, Leon    1811-1892    b: Paris 3 Jul 1811 d:13 Mar 1892

I need to parse the dates and reformat them, e.g. in ISO 8601 --
'15 Feb 1564' => '1564-02-15'
I tried using Date:Parse and Date:Format,

my ($name, $lived, $born, $died) = split(/\s?[\t]/);
if ($born) {
    $born =~ s/^\s*b:\s+//;
    ($birthdate, $birthplace) = split(/,\s*/, $born, 2);
    my $date = str2time($birthdate);
    $birthdate = time2str("%Y-%m-%d", $date);
    }

but, as I see now, this converts to seconds since the epoch, 1-
jan-1970,
so it can't work.

Are there other modules that deal with historical dates? Assume that
I don't need time values.

thanks



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

Date: Sun, 8 Apr 2007 21:19:18 -0400
From: "Thrill5" <nospam@somewhere.com>
Subject: Re: parsing / formatting historical dates
Message-Id: <QradnQNzdYcLCYTbnZ2dnUVZ_oernZ2d@comcast.com>


<friendly@yorku.ca> wrote in message 
news:1176076067.533148.69740@y66g2000hsf.googlegroups.com...
> I'm reading/re-writing data files with historical dates that go back
> potentially to antiquity. e.g., one such has name, lifespan, birth
> date/place,
> death date/place as \t separated fields.
>
> Galilei, Galileo    1564-1642    b: 15 Feb 1564, Pisa  d: 8 Jan 1642,
> Arcetri, Italy
> Lalanne, Leon    1811-1892    b: Paris 3 Jul 1811 d:13 Mar 1892
>
> I need to parse the dates and reformat them, e.g. in ISO 8601 --
> '15 Feb 1564' => '1564-02-15'
> I tried using Date:Parse and Date:Format,
>
> my ($name, $lived, $born, $died) = split(/\s?[\t]/);
> if ($born) {
>    $born =~ s/^\s*b:\s+//;
>    ($birthdate, $birthplace) = split(/,\s*/, $born, 2);
>    my $date = str2time($birthdate);
>    $birthdate = time2str("%Y-%m-%d", $date);
>    }
>
> but, as I see now, this converts to seconds since the epoch, 1-
> jan-1970,
> so it can't work.
>
> Are there other modules that deal with historical dates? Assume that
> I don't need time values.
>
> thanks
>
Not sure why you need a module to do this.  Have you over simplified the 
problem?

 my %months = (Jan => 1, Feb => 2, Mar => 3, Apr => 4,
                May => 5, Jun => 6, Jul => 7, Aug => 8,
                Sep => 9, Oct => 10, Nov => 11, Dec => 12);

sub convdate {
  my ($day, $mon, $year) = split(/\s+/,shift);
  return sprintf("%04d-%02d-%02d",$year,$months{$mon},$day);
}

my ($name, $lived, $born, $died) = split(/\s?[\t]/);
if ($born) {
   $born =~ s/^\s*b:\s+//;
   ($birthdate, $birthplace) = split(/,\s*/, $born, 2);
   $birthdate = convdate($birthdate);
}

Scott 




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

Date: 8 Apr 2007 18:30:00 -0700
From: usenet@DavidFilmer.com
Subject: Re: parsing / formatting historical dates
Message-Id: <1176082200.891934.146410@n59g2000hsh.googlegroups.com>

On Apr 8, 4:47 pm, "frien...@yorku.ca" <frien...@yorku.ca> wrote:
> I'm reading/re-writing data files with historical dates that go back
> potentially to antiquity.

The Date::Manip module does not rely on epoch seconds to store its
objects.  It will work for your purposes.




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

Date: Mon, 09 Apr 2007 05:00:41 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: parsing / formatting historical dates
Message-Id: <57tomvF2ed9foU1@mid.individual.net>

friendly@yorku.ca wrote:
> I need to parse the dates and reformat them, e.g. in ISO 8601 --
> '15 Feb 1564' => '1564-02-15'
> I tried using Date:Parse and Date:Format,

<snip>

>     my $date = str2time($birthdate);
>     $birthdate = time2str("%Y-%m-%d", $date);

Try this instead:

   my ($d, $m, $y) = (strptime $birthdate)[3..5];
   $birthdate = sprintf '%d-%02d-%02d', $y<1000 ? 1900+$y : $y, $m+1, $d;

> but, as I see now, this converts to seconds since the epoch,
> 1-jan-1970, so it can't work.

The Date::Parse::strptime() function does not have that limitation, at 
least not on my Windows box.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sun, 08 Apr 2007 21:13:24 -0700
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: parsing / formatting historical dates
Message-Id: <5fCdnYhLBvP1IITbnZ2dnUVZ_u6rnZ2d@giganews.com>

friendly wrote:

(snipped)

> Galilei, Galileo    1564-1642    b: 15 Feb 1564, Pisa  d: 8 Jan 1642,
> Arcetri, Italy
> Lalanne, Leon    1811-1892    b: Paris 3 Jul 1811 d:13 Mar 1892

> I need to parse the dates and reformat them, e.g. in ISO 8601 --
> '15 Feb 1564' => '1564-02-15'


Add your own code to clean up and uniformly print your data,
such as removing your trailing comma and a lack of a space
after "d:" in your data.


#!perl


@Months = qw (Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);

while (<DATA>)
  {
   if (index ($_, "b:") > -1)
    {
     foreach $month (@Months)
      {
       $count++;
       $_ =~ s/$month/$count/g;
      }

     if ($_ =~ /([\d]+ [\d]+ [\d]+).* d:[ ]*([\d ]+)/)
      {
       $birth = $1;
       $death = $2;

       ($b_day, $b_month, $b_year) = split (/ /, $birth);
       ($d_day, $d_month, $d_year) = split (/ /, $death);

       $_ =~ s/$birth/$b_year-$b_month-$b_day/;
       $_ =~ s/$death/$d_year-$d_month-$d_day/;
      }

     $count = 0;

    }

   print $_;
  }

__DATA__
Galilei, Galileo    1564-1642    b: 15 Feb 1564, Pisa  d: 8 Jan 1642,
Arcetri, Italy
Lalanne, Leon    1811-1892    b: Paris 3 Jul 1811 d:13 Mar 1892


PRINTED RESULTS:

Galilei, Galileo    1564-1642    b: 1564-2-15, Pisa  d: 1642-1-8,
Arcetri, Italy
Lalanne, Leon    1811-1892    b: Paris 1811-7-3 d:1892-3-13


Purl Gurl


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

Date: 8 Apr 2007 21:23:43 -0700
From: "Ray" <raykyoto@gmail.com>
Subject: Re: Passing hash to a subroutine
Message-Id: <1176092623.288701.316130@b75g2000hsg.googlegroups.com>


Hi Michele,

On Apr 7, 10:35 pm, Michele Dondi <bik.m...@tiscalinet.it> wrote:
> On 7 Apr 2007 04:46:25 -0700, "Ray" <rayky...@gmail.com> wrote:
>
> >I made a small example to demonstrate my problem:
>
> In my first post I addressed your immediate problem. There are more
> issues with your code, though. I will briefly go through them now.

Yes, thank you that!  It was very helpful!  And for cleaning up my
Perl code. I've been  doing a few things in Perl which compile but
aren't very Perl-ish and am changing at a very slow pace. So,  thanks!

> >  ##  Next line is also deprecated
> >  printf (STDOUT "* %s\n", %{$href} -> {"San Francisco"}{"LA"});

And you also caught me. I am originally a C-programmer and changing to
a Perl programming means my Perl code sometimes looks like C.  Thanks
again -- I'll use what you suggested from now on.

Ray




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

Date: 8 Apr 2007 21:31:00 -0700
From: "Ray" <raykyoto@gmail.com>
Subject: Re: Passing hash to a subroutine
Message-Id: <1176093060.224523.114220@w1g2000hsg.googlegroups.com>


Hi Tad,

On Apr 7, 11:13 pm, Tad McClellan <t...@augustmail.com> wrote:
> Ray <rayky...@gmail.com> wrote:
> > I've been trying to figure out how to pass a hash (and a hash of
> > hashes) into a function.
>
> You *have* figured out how to pass a hash into a function.
>
> What you haven't figured out is how to dereference it within
> the function body.

Yes, that's what I was thinking.

> perlreftut describes two different ways of dereferencing.
>
> You are applying *both* ways.

Ah!  Thank you.  I was just looking back at perlreftut to see where I
went wrong.  I guess read @a and @{$aref} were equivalent and
mistakenly kept modifying this until it worked instead of looking at
it more carefully.  My biggest mistake was thinking that references
were somehow different if I passed it in a function, but it doesn't
seem  to be.

Thanks again!

Ray




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

Date: 8 Apr 2007 11:20:39 -0700
From: "Yakov" <iler.ml@gmail.com>
Subject: pp question (PAR::Packer)
Message-Id: <1176056439.075071.121920@y66g2000hsf.googlegroups.com>

When I compile perl code with pp ( PAR::Packer),
does pp  pack all used modules into same executable ?

Thanks
Yakov



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

Date: Mon, 9 Apr 2007 00:33:33 +0200
From: "Lambik" <lambik@kieffer.nl>
Subject: Re: pp question (PAR::Packer)
Message-Id: <46196ccf$0$721$5fc3050@dreader2.news.tiscali.nl>

"Yakov" <iler.ml@gmail.com> wrote in message
news:1176056439.075071.121920@y66g2000hsf.googlegroups.com...
> When I compile perl code with pp ( PAR::Packer),
> does pp  pack all used modules into same executable ?

Have you even read the manpages? It says so right there:

"If you want to make an executable that contains all module, scripts and
data files, please consult the pp utility instead"




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

Date: 8 Apr 2007 20:38:24 -0700
From: "kath" <nitte.sudhir@gmail.com>
Subject: what's wrong calling a Perl/CGI script in Perl/CGI script under Tomcat server?
Message-Id: <1176089904.812054.53560@n76g2000hsh.googlegroups.com>

Hi all,

I have small doubt, the following code works fine in Apache server.
But not completely in Tomcat. Why??
------------------------
#!C:\Perl\bin\perl.exe

# hello.pl

use CGI;
$cgi = new CGI;
print $cgi->header;
printf "Hello world";
system("perl Hi.pl");
------------------------
#!C:\Perl\bin\perl.exe

# hi.pl

print "Hi";
------------------------

When I tried in Tomcat, the script prints only
Hello world

Why?
What's wrong?


kath.



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

Date: Mon, 09 Apr 2007 06:49:04 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: what's wrong calling a Perl/CGI script in Perl/CGI script under Tomcat server?
Message-Id: <57tv26F2e6c20U1@mid.individual.net>

kath wrote:
> I have small doubt, the following code works fine in Apache server.
> But not completely in Tomcat. Why??

<snip>

Why don't you ask Perl

> system("perl Hi.pl");

   system("perl Hi.pl") == 0 or die $!;

and check the server's error log?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

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


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