[32583] in Perl-Users-Digest
Perl-Users Digest, Issue: 3855 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 8 05:17:19 2013
Date: Tue, 8 Jan 2013 02:17:05 -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 Tue, 8 Jan 2013 Volume: 11 Number: 3855
Today's topics:
Re: Date in CSV/TSV question <rweikusat@mssgmbh.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 07 Jan 2013 19:54:37 +0000
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Date in CSV/TSV question
Message-Id: <87ip78rcoy.fsf@sapphire.mobileactivedefense.com>
"C.DeRykus" <derykus@gmail.com> writes:
Leading remark: I'm going to cut this somewhat short. I don't agree
with your opinion on this, however, essentially repeating myself
doesn't seem very useful to me, so I'm just going to address a few
isolated points.
>> On Sunday, January 6, 2013 9:12:35 AM UTC-8, Rainer Weikusat wrote:
>> "C.DeRykus" <derykus@gmail.com> writes:
[...]
>> If you weren't using -i, it wasn't necessary to worry about creating a
>> backup file since the modified content would end up in a new file.
>
> -i is useful in case you're one of those whose
> code never works the first time time though...
> And you can always remove -i later.
What I was trying to get at was that it wouldn't be necessary to use
the 'automatic backup' feature of -i if 'overwriting' (aka
'destroying') the input file hadn't been requested to begin with: In this
case, the processed data would go to stdout, immediately available for
interactive inspection, and could be redirected to some other file if
so desired at the user's discretion.
[...]
>> -------------
>>
>> %months = map { $_, sprintf('%02d', ++$n); } qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
>>
>>
>>
>> s/^"(\d+)\s+(\S+)\s+(\d+)"/$3-$months{$2}-$1/, print while (<>);
>> ...
>
> Sure, if you don't deal with this kind of
> transform often, yet another incantation is
> no big deal.
'Incantation' is IMO a very unfortunate choice for describing this. It
is a sequence of instructions with exactly defined meaning which
causes a machine to perform a specific function. That's a completely
mundane thing with absolutely no 'magic' of any kind involved (except
insofar 'any sufficiently advanced technology is indistinguishable
fomr magic' [as seen by someone who doesn't understand any of it],).
[...]
>> It is probably possible to use a combine harvester instead of a
>> lawnmower but nobody in his right mind would ever do that or
>> suggest that others do it.
>
> Then why do we use a simple module function to
> escape HTML for instance.. rather than rolling
> our own?
Hmm ... why would I?
$text =~ s/([<>"'&])/'&#'.ord($1).';'/ge;
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 3855
***************************************