[30899] in Perl-Users-Digest
Perl-Users Digest, Issue: 2144 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 21 03:09:47 2009
Date: Wed, 21 Jan 2009 00:09:10 -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 Wed, 21 Jan 2009 Volume: 11 Number: 2144
Today's topics:
Re: Concatenating regular exprs in a 'grep' call <larry@example.invalid>
Re: fastest way to allocate memory ? xhoster@gmail.com
Re: fastest way to allocate memory ? <nospam-abuse@ilyaz.org>
Re: fastest way to allocate memory ? sln@netherlands.com
Re: function calls in double quoted strings <whynot@pozharski.name>
Re: inputting the ephemerides <tadmc@seesig.invalid>
Re: inputting the ephemerides <tadmc@seesig.invalid>
Re: inputting the ephemerides <jwkenne@attglobal.net>
Re: inputting the ephemerides sln@netherlands.com
Re: inputting the ephemerides <larry@example.invalid>
Re: inputting the ephemerides <larry@example.invalid>
Re: inputting the ephemerides <someone@example.com>
Re: inputting the ephemerides sln@netherlands.com
new CPAN modules on Wed Jan 21 2009 (Randal Schwartz)
Re: Perl - marker ? <whynot@pozharski.name>
Re: What do you need to have to be considered a Master <cwilbur@chromatico.net>
Re: What do you need to have to be considered a Master sln@netherlands.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 20 Jan 2009 23:17:13 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: Concatenating regular exprs in a 'grep' call
Message-Id: <1oxlc3t8bpw4h.13sfm60u7lfxl.dlg@40tude.net>
On Tue, 20 Jan 2009 15:34:17 -0500, Charlton Wilbur wrote:
>>>>>> "TJM" == Tad J McClellan <tadmc@seesig.invalid> writes:
>
> TJM> Understand the difference between what is "code" and what is
> TJM> "data".
>
> >> I'm tempted to ask you to elaborate on this one.
>
> TJM> This can be hard to answer in a 3-minute post to Usenet...
>
> Indeed, at least while we're all using Von Neumann machines.
>
> Charlton
I think this program blurs this line:
my $filename = 'faulk15.pl';
open(my $fh, '<', $filename) or die "cannot open $filename: $!";
while (<$fh>) {
print $_;
}
close($fh)
# perl faulk15.pl
C:\MinGW\source>perl faulk15.pl
my $filename = 'faulk15.pl';
open(my $fh, '<', $filename) or die "cannot open $filename: $!";
while (<$fh>) {
print $_;
}
close($fh)
# perl faulk15.pl
--
larry gates
The human psyche is a mishmash of rules of thumb, and Einstein's thumb
is only two of them.
-- Larry Wall in <20050217173835.GB26246@wall.org>
------------------------------
Date: 21 Jan 2009 02:18:06 GMT
From: xhoster@gmail.com
Subject: Re: fastest way to allocate memory ?
Message-Id: <20090120212109.240$w9@newsreader.com>
Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
> [A complimentary Cc of this posting was sent to
> Xho Jingleheimerschmidt
> <xhoster@gmail.com>], who wrote in article
> <4973797e$0$25707$ed362ca5@nr5c.newsreader.com>:
>
> > >> my $needle = "B";
> > >> $gras = $gras.$needle;
>
> > > RHS takes another 10000GiB.
>
> > It seems that, at least as of 5.8.8, this construct is optimized
> > to be about the same as $gras.=$needle
>
> No, it is not:
>
> > env PERL_DEBUG_MSTATS=1 perl -e "$s=q(a); $s x= 5e5; 1"
The optimization only seems to happen or lexical variables.
What happens if you "my" $s? (None of the perls I have ready access to
support PERL_DEBUG_MSTATS.)
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Wed, 21 Jan 2009 04:11:33 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: fastest way to allocate memory ?
Message-Id: <gl679l$2sdc$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
<xhoster@gmail.com>], who wrote in article <20090120212109.240$w9@newsreader.com>:
> Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
> > [A complimentary Cc of this posting was sent to
> > Xho Jingleheimerschmidt
> > <xhoster@gmail.com>], who wrote in article
> > <4973797e$0$25707$ed362ca5@nr5c.newsreader.com>:
> >
> > > >> my $needle = "B";
> > > >> $gras = $gras.$needle;
> >
> > > > RHS takes another 10000GiB.
> >
> > > It seems that, at least as of 5.8.8, this construct is optimized
> > > to be about the same as $gras.=$needle
> >
> > No, it is not:
> >
> > > env PERL_DEBUG_MSTATS=1 perl -e "$s=q(a); $s x= 5e5; 1"
>
> The optimization only seems to happen or lexical variables.
True; it looks like a spin-off of my older "lexicals as targets"
optimization... This is visible otherwise:
perl -MO=Concise -e "my $s=q(a); $s x= 5e5; $s .= q(b); 1"
...
a <;> nextstate(main 2 -e:1) v ->b
d <2> concat[t3] vKS/2 ->e
b <0> padsv[$s:1,2] sRM ->c
c <$> const(PV "b") s ->d
e <;> nextstate(main 2 -e:1) v ->f
perl -MO=Concise -e "my $s=q(a); $s x= 5e5; $s = $s.q(b); 1"
a <;> nextstate(main 2 -e:1) v ->b
d <2> concat[$s:1,2] sK/TARGMY,2 ->e
b <0> padsv[$s:1,2] s ->c
c <$> const(PV "b") s ->d
e <;> nextstate(main 2 -e:1) v ->f
The opflags for "b" difer by "RM" (I do not know the meaning), and
opflags for "d" are also subtly different...
Thanks for your research,
Ilya
------------------------------
Date: Wed, 21 Jan 2009 07:01:11 GMT
From: sln@netherlands.com
Subject: Re: fastest way to allocate memory ?
Message-Id: <3shdn4dv1b0e1qbk6aqkkr2vp35unducge@4ax.com>
On Wed, 21 Jan 2009 04:11:33 +0000 (UTC), Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
>[A complimentary Cc of this posting was sent to
>
><xhoster@gmail.com>], who wrote in article <20090120212109.240$w9@newsreader.com>:
>> Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
>> > [A complimentary Cc of this posting was sent to
>> > Xho Jingleheimerschmidt
>> > <xhoster@gmail.com>], who wrote in article
>> > <4973797e$0$25707$ed362ca5@nr5c.newsreader.com>:
>> >
>> > > >> my $needle = "B";
>> > > >> $gras = $gras.$needle;
>> >
>> > > > RHS takes another 10000GiB.
>> >
>> > > It seems that, at least as of 5.8.8, this construct is optimized
>> > > to be about the same as $gras.=$needle
>> >
>> > No, it is not:
>> >
>> > > env PERL_DEBUG_MSTATS=1 perl -e "$s=q(a); $s x= 5e5; 1"
>>
>> The optimization only seems to happen or lexical variables.
>
>True; it looks like a spin-off of my older "lexicals as targets"
>optimization... This is visible otherwise:
>
> perl -MO=Concise -e "my $s=q(a); $s x= 5e5; $s .= q(b); 1"
>...
>a <;> nextstate(main 2 -e:1) v ->b
>d <2> concat[t3] vKS/2 ->e
>b <0> padsv[$s:1,2] sRM ->c
>c <$> const(PV "b") s ->d
>e <;> nextstate(main 2 -e:1) v ->f
>
> perl -MO=Concise -e "my $s=q(a); $s x= 5e5; $s = $s.q(b); 1"
>a <;> nextstate(main 2 -e:1) v ->b
>d <2> concat[$s:1,2] sK/TARGMY,2 ->e
>b <0> padsv[$s:1,2] s ->c
>c <$> const(PV "b") s ->d
>e <;> nextstate(main 2 -e:1) v ->f
>
>
>The opflags for "b" difer by "RM" (I do not know the meaning), and
>opflags for "d" are also subtly different...
>
>Thanks for your research,
>Ilya
All this cryptic in-between code makes me laff.
The QuakeC compiler is exactly the same.
You have a good niche there Ilya, a place where nobody
but you understands. I hope they don't stop playing Quake for
your sake.
sln
------------------------------
Date: Wed, 21 Jan 2009 02:21:23 +0200
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: function calls in double quoted strings
Message-Id: <slrngncqmf.cs7.whynot@orphan.zombinet>
On 2009-01-20, Tad J McClellan <tadmc@seesig.invalid> wrote:
> david <michaelgang@gmail.com> wrote:
*SKIP*
>> For example
>> print "The absolute value of -2 is abs(-2). This value is bigger than
>> 0"
>
> If "abs(-2)" was automagically replaced with "2", then you
> would not be able to print that 7-character string.
>
> ie. If "data" was "code", then:
>
> print "use abs(-2) to find the absolute value of -2\n"
>
> would output
>
> use 2 to find the absolute value of -2
What would be definition of "code" that would prohibit requiring Perl v2
or later in this case?
--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
------------------------------
Date: Tue, 20 Jan 2009 20:01:58 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: inputting the ephemerides
Message-Id: <slrngnd0gm.584.tadmc@tadmc30.sbcglobal.net>
Larry Gates <larry@example.invalid> wrote:
> On Tue, 20 Jan 2009 10:39:23 -0800, Jim Gibson wrote:
>
>> In article <1x83tkcjxizri.7vvnwjo82ona$.dlg@40tude.net>, Larry Gates
>> <larry@example.invalid> wrote:
>>
>>
>>> This is the data set:
>>> Sun 18h 41m 55s -23 5.4' 0.983 10.215 52.155 Up
>>> Mercury 20h 2m 16s -22 12.5' 1.102 22.537 37.668 Up
>>> Venus 21h 55m 33s -14 16.3' 0.795 39.872 11.703 Up
>> my( $name, $hour, $min, $sec, ... ) =
>> unpack('A8 A4 A4 A4 ... ',$line);
> Thanks, Jim. I've been working really hard to get my head around pattern
> matching
Pattern matching is not the Right Tool for fixed-width columnated data.
unpack() (or substr) is.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Tue, 20 Jan 2009 20:10:39 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: inputting the ephemerides
Message-Id: <slrngnd10v.584.tadmc@tadmc30.sbcglobal.net>
Larry Gates <larry@example.invalid> wrote:
> On Tue, 20 Jan 2009 09:09:44 -0800, Tim Greer wrote:
> It turns out I've gone different ways twice with this as I try to get some
> output here.
> /(\w+)\W*(\d2).*(\d2).*(\d2)\W*([-|+]\d+).*(\d+\.\d+).*(\d+\.\d+)
> .*(-*\d+\.\d+).*(-*\d+\.\d+)\W*(\w+)\W*/;
>
> print "$1\n";
> I was under the impression that I created a bunch of variables like $1 $2
> $3,
The dollar-digit variables are only set when the pattern match *succeeds*.
Therefore, you should never use the dollar-digit variables unless
you have first ensured that the match in question succeeded:
if ( /(\w+)\W*(\d2).*(\d2).*(\d2)\W*([-|+]\d+).*(\d+\.\d+).*(\d+\.\d+)
.*(-*\d+\.\d+).*(-*\d+\.\d+)\W*(\w+)\W*/x ) {
print "$1\n";
}
else {
print "match failed!\n";
}
I doubt that \d2 does what you think it does.
It matches 2-digit strings where the 2nd digit is a "2".
You probably want \d{2} instead?
I doubt that [-|+] does what you think it does. It matches any of 3
characters: vertical bar, plus sign, minus sign.
You probably want [+-] instead.
You probably want \W+ rather than \W*
You probably want .*? rather than .*
> but I don't have output yet.:-(
Don't try to do it all at once. Get it working a little at a time:
/(\w+)\W+/
/(\w+)\W+(\d{2})/
/(\w+)\W+(\d{2}).*?(\d{2})/
etc...
Note that all of this is moot, because pattern matching is
not the Right Tool for what you are trying to accomplish...
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Tue, 20 Jan 2009 21:20:01 -0500
From: John W Kennedy <jwkenne@attglobal.net>
Subject: Re: inputting the ephemerides
Message-Id: <49768651$0$20290$607ed4bc@cv.net>
$line =~ /[^0123456789.-+]/ /g;
------------------------------
Date: Wed, 21 Jan 2009 03:01:26 GMT
From: sln@netherlands.com
Subject: Re: inputting the ephemerides
Message-Id: <fr3dn4dv1b0e1qbk6aqkkr2vp35unducqn@4ax.com>
On Tue, 20 Jan 2009 18:15:21 -0700, Larry Gates <larry@example.invalid> wrote:
>On Tue, 20 Jan 2009 10:39:23 -0800, Jim Gibson wrote:
>
>> In article <1x83tkcjxizri.7vvnwjo82ona$.dlg@40tude.net>, Larry Gates
>> <larry@example.invalid> wrote:
>>
>>
>>> This is the data set:
>>>
>>> C:\MinGW\source>type eph3.txt
>>> ! yesterday
>>> # another comment
>>>
>>> Sun 18h 41m 55s -23? 5.4' 0.983 10.215 52.155 Up
>>> Mercury 20h 2m 16s -22? 12.5' 1.102 22.537 37.668 Up
>>> Venus 21h 55m 33s -14? 16.3' 0.795 39.872 11.703 Up
>>> Moon 21h 17m 19s -15? 2.4' 62.4 ER 36.796 22.871 Up
>>> Mars 18h 11m 59s -24? 6.1' 2.431 4.552 56.184 Up
>>> Jupiter 20h 3m 35s -20? 49.4' 6.034 23.867 38.203 Up
>>> Saturn 11h 32m 59s +5? 8.6' 9.018 -47.333 157.471 Set
>>> Uranus 23h 21m 30s -4? 57.9' 20.421 48.328 -18.527 Up
>>> Neptune 21h 39m 30s -14? 22.8' 30.748 38.963 16.599 Up
>>> Pluto 18h 4m 34s -17? 44.5' 32.543 7.443 62.142 Up
>>>
>>> C:\MinGW\source>
>>>
>>> Thanks for your comment.
>>
>> You can use the unpack function to unpack data lines with fixed-length
>> columns like your example. See 'perldoc -f unpack' for details, and
>> 'peldoc -f pack' for template parameters. Note that the A parameter
>> will cause Perl to trim trailing blanks on unpacking.
>>
>> Something like
>>
>> my( $name, $hour, $min, $sec, ... ) =
>> unpack('A8 A4 A4 A4 ... ',$line);
>>
>> should work.
>
>Thanks, Jim. I've been working really hard to get my head around pattern
>matching and tried something similar to what you write but was unable to
>get output.
>
> my $filename = 'eph6.txt';
> open(my $fh, '<', $filename) or die "cannot open $filename: $!";
>
> while (<$fh>) {
>
>
>
>
>/(\w+)\W*(\d2).*(\d2).*(\d2)\W*([-|+]\d+).*(\d+\.\d+).*(\d+\.\d+).*(-*\d+\.\d+).*(-*\d+\.\d+)\W*(\w+)\W*/;
>
>
>
[snip]
Interresting. You can pay me for flawless regex processing of all your data.
Or, you can do bullshit with your right hand.
sln
------------------------------
Date: Tue, 20 Jan 2009 20:16:26 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: inputting the ephemerides
Message-Id: <saztxlrq10p8.g5ms2f5zurtt.dlg@40tude.net>
On Tue, 20 Jan 2009 20:01:58 -0600, Tad J McClellan wrote:
> Larry Gates <larry@example.invalid> wrote:
>>> my( $name, $hour, $min, $sec, ... ) =
>>> unpack('A8 A4 A4 A4 ... ',$line);
>
>
>> Thanks, Jim. I've been working really hard to get my head around pattern
>> matching
>
>
> Pattern matching is not the Right Tool for fixed-width columnated data.
>
> unpack() (or substr) is.
There is a lot of variation in the data though. The moon has ER after the
distance. If we replace the tabs with space, I think I can make this work,
but as it is, I don't know that there exists a sequence of integers that
works for the integer part of the format descriptors.
my $filename = 'eph6.txt';
open(my $fh, '<', $filename) or die "cannot open $filename: $!";
while (<$fh>) {
my( $name, $hour, $min, $sec, ) =
unpack('A8 A4 A4 A4 ', $_);
print $name, $hour, $min, $sec, "\n";
}
close($fh)
# perl faulk13.pl
C:\MinGW\source>perl faulk13.pl
Sun 19h43m51s-21
Mercury20h36m41s
Venus 22h 51m 18s -7
Moon 10h 24m 21s +7
Mars 18h 58m 51s -23
Jupiter20h17m22s
Saturn 11h 32m 29s +
Uranus 23h 23m 12s -
Neptune21h41m17s
Pluto 18h 6m 40s -17
C:\MinGW\source>
Some haven't started to read the declination while others have a sign and
two digits.
The data comes from
http://www.fourmilab.ch/cgi-bin/Yoursky
, where you can make a sky map from any city and any time.
Is it possible for perl to imitate the keystrokes and mouse clicks so as to
get these data directly?
--
larry gates
Odd that we think definitions are definitive. :-)
-- Larry Wall in <199702221943.LAA20388@wall.org>
------------------------------
Date: Tue, 20 Jan 2009 20:42:55 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: inputting the ephemerides
Message-Id: <1a873yidh5mrb.18ectu36mlsyb$.dlg@40tude.net>
On Tue, 20 Jan 2009 20:10:39 -0600, Tad J McClellan wrote:
> The dollar-digit variables are only set when the pattern match *succeeds*.
>
> Therefore, you should never use the dollar-digit variables unless
> you have first ensured that the match in question succeeded:
>
> if ( /(\w+)\W*(\d2).*(\d2).*(\d2)\W*([-|+]\d+).*(\d+\.\d+).*(\d+\.\d+)
> .*(-*\d+\.\d+).*(-*\d+\.\d+)\W*(\w+)\W*/x ) {
> print "$1\n";
> }
> else {
> print "match failed!\n";
> }
>
>
> I doubt that \d2 does what you think it does.
>
> It matches 2-digit strings where the 2nd digit is a "2".
>
> You probably want \d{2} instead?
>
> I doubt that [-|+] does what you think it does. It matches any of 3
> characters: vertical bar, plus sign, minus sign.
>
> You probably want [+-] instead.
>
> You probably want \W+ rather than \W*
>
> You probably want .*? rather than .*
>
>
>> but I don't have output yet.:-(
>
>
> Don't try to do it all at once. Get it working a little at a time:
>
> /(\w+)\W+/
>
> /(\w+)\W+(\d{2})/
>
> /(\w+)\W+(\d{2}).*?(\d{2})/
>
> etc...
>
>
> Note that all of this is moot, because pattern matching is
> not the Right Tool for what you are trying to accomplish...
I'm inclined to think that this is the way. With your changes, I'm getting
real clean input until I get halfway through:
my $filename = 'eph6.txt';
open(my $fh, '<', $filename) or die "cannot open $filename: $!";
while (<$fh>) {
/(\w+)\W+/;
/(\w+)\W+(\d{2})/;
/(\w+)\W+(\d{2}).*?(\d{2})/;
/(\w+)\W+(\d{2}).*?(\d{2}).*?(\d{2})/;
/(\w+)\W+(\d{2}).*?(\d{2}).*?(\d{2}).*?([-+]\d{2})/;
print "string one is $1\n";
print "string two is $2\n";
print "string three is $3\n";
print "string four is $4\n";
print "string five is $5\n";
print $_;
}
close($fh)
# perl faulk14.pl
C:\MinGW\source>perl faulk14.pl
string one is Sun
string two is 19
string three is 43
string four is 51
string five is -21
Sun 19h 43m 51s -21 17.8' 0.984 -35.020 87.148 Set
...
string one is Pluto
string two is 18
string three is 40
string four is 17
string five is -52
Pluto 18h 6m 40s -17 44.9' 32.485 -52.833 108.052 Set
C:\MinGW\source>
The sun is right, but pluto went to the -52. I think I'm missing a
quantifer in *?([-+]\d{2})
--
larry gates
Oh, right--I'd better learn to read Perl 6 one of these days. :-)
-- Larry Wall in <20050316201700.GB31121@wall.org>
------------------------------
Date: Tue, 20 Jan 2009 20:11:41 -0800
From: "John W. Krahn" <someone@example.com>
Subject: Re: inputting the ephemerides
Message-Id: <1gxdl.475$k57.408@newsfe09.iad>
John W Kennedy wrote:
>
> $line =~ /[^0123456789.-+]/ /g;
$ perl -ce'$line =~ /[^0123456789.-+]/ /g;'
Invalid [] range ".-+" in regex; marked by <-- HERE in m/[^0123456789.-+
<-- HERE ]/ at -e line 1.
And if you fix that you are left with the match operator results divided
by the numerical value of the string 'g' in void context.
$ perl -cwe'$line =~ /[^0123456789.+-]/ /g;'
Unquoted string "g" may clash with future reserved word at -e line 1.
Useless use of division (/) in void context at -e line 1.
Name "main::line" used only once: possible typo at -e line 1.
-e syntax OK
John
--
Those people who think they know everything are a great
annoyance to those of us who do. -- Isaac Asimov
------------------------------
Date: Wed, 21 Jan 2009 07:07:02 GMT
From: sln@netherlands.com
Subject: Re: inputting the ephemerides
Message-Id: <5aidn4darv4756t9pnbuc6s3r5ufsn5fa2@4ax.com>
On Tue, 20 Jan 2009 20:42:55 -0700, Larry Gates <larry@example.invalid> wrote:
>On Tue, 20 Jan 2009 20:10:39 -0600, Tad J McClellan wrote:
>
>> The dollar-digit variables are only set when the pattern match *succeeds*.
>>
>> Therefore, you should never use the dollar-digit variables unless
>> you have first ensured that the match in question succeeded:
>>
>> if ( /(\w+)\W*(\d2).*(\d2).*(\d2)\W*([-|+]\d+).*(\d+\.\d+).*(\d+\.\d+)
>> .*(-*\d+\.\d+).*(-*\d+\.\d+)\W*(\w+)\W*/x ) {
>> print "$1\n";
>> }
>> else {
>> print "match failed!\n";
>> }
>>
>>
>> I doubt that \d2 does what you think it does.
>>
>> It matches 2-digit strings where the 2nd digit is a "2".
>>
>> You probably want \d{2} instead?
>>
>> I doubt that [-|+] does what you think it does. It matches any of 3
>> characters: vertical bar, plus sign, minus sign.
>>
>> You probably want [+-] instead.
>>
>> You probably want \W+ rather than \W*
>>
>> You probably want .*? rather than .*
>>
>>
>>> but I don't have output yet.:-(
>>
>>
>> Don't try to do it all at once. Get it working a little at a time:
>>
>> /(\w+)\W+/
>>
>> /(\w+)\W+(\d{2})/
>>
>> /(\w+)\W+(\d{2}).*?(\d{2})/
>>
>> etc...
>>
>>
>> Note that all of this is moot, because pattern matching is
>> not the Right Tool for what you are trying to accomplish...
>
>I'm inclined to think that this is the way. With your changes, I'm getting
>real clean input until I get halfway through:
>
> my $filename = 'eph6.txt';
> open(my $fh, '<', $filename) or die "cannot open $filename: $!";
>
> while (<$fh>) {
>
>
> /(\w+)\W+/;
> /(\w+)\W+(\d{2})/;
>
> /(\w+)\W+(\d{2}).*?(\d{2})/;
>
> /(\w+)\W+(\d{2}).*?(\d{2}).*?(\d{2})/;
> /(\w+)\W+(\d{2}).*?(\d{2}).*?(\d{2}).*?([-+]\d{2})/;
[snip]
I'm falling down laughing. This is better than the Comedy chanel.
sln
------------------------------
Date: Wed, 21 Jan 2009 05:42:27 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Jan 21 2009
Message-Id: <KDt3ur.184z@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.
AI-Genetic-Pro-0.331
http://search.cpan.org/~strzelec/AI-Genetic-Pro-0.331/
Efficient genetic algorithms for professional purpose.
----
AI-Genetic-Pro-0.332
http://search.cpan.org/~strzelec/AI-Genetic-Pro-0.332/
Efficient genetic algorithms for professional purpose.
----
Acme-MUDLike-0.02
http://search.cpan.org/~swalters/Acme-MUDLike-0.02/
Hang out inside of your application
----
Apache2-ASP-2.12
http://search.cpan.org/~johnd/Apache2-ASP-2.12/
ASP for Perl, reloaded.
----
App-PPBuild-0.14
http://search.cpan.org/~exodist/App-PPBuild-0.14/
Perl Project Build System, The low-learning curve simple build system.
----
App-PPBuild-0.15
http://search.cpan.org/~exodist/App-PPBuild-0.15/
Perl Project Build System, The low-learning curve simple build system.
----
App-PPBuild-0.16
http://search.cpan.org/~exodist/App-PPBuild-0.16/
Perl Project Build System, The low-learning curve simple build system.
----
App-PPBuild-0.18
http://search.cpan.org/~exodist/App-PPBuild-0.18/
Perl Project Build System, The low-learning curve simple build system.
----
Audio-Extract-PCM-0.04_52
http://search.cpan.org/~pepe/Audio-Extract-PCM-0.04_52/
Extract PCM data from audio files
----
Audio-Extract-PCM-0.04_53
http://search.cpan.org/~pepe/Audio-Extract-PCM-0.04_53/
Extract PCM data from audio files
----
Audio-Extract-PCM-0.04_54
http://search.cpan.org/~pepe/Audio-Extract-PCM-0.04_54/
Extract PCM data from audio files
----
Audio-Extract-PCM-0.04_55
http://search.cpan.org/~pepe/Audio-Extract-PCM-0.04_55/
Extract PCM data from audio files
----
Bundle-Test-1.08
http://search.cpan.org/~szabgab/Bundle-Test-1.08/
A set of modules for software and hardware testing using Perl
----
CGI-IDS-1.0107
http://search.cpan.org/~hinnerk/CGI-IDS-1.0107/
PerlIDS - Perl Website Intrusion Detection System (XSS, CSRF, SQLI, LFI etc.)
----
CPAN-Reporter-1.1705
http://search.cpan.org/~dagolden/CPAN-Reporter-1.1705/
Adds CPAN Testers reporting to CPAN.pm
----
CPAN-Testers-WWW-Statistics-0.55
http://search.cpan.org/~barbie/CPAN-Testers-WWW-Statistics-0.55/
CPAN Testers Statistics website.
----
Catalyst-Controller-Validation-DFV-0.0.2
http://search.cpan.org/~chisel/Catalyst-Controller-Validation-DFV-0.0.2/
check form data
----
Catalyst-Plugin-Authentication-0.100092
http://search.cpan.org/~bobtfish/Catalyst-Plugin-Authentication-0.100092/
Infrastructure plugin for the Catalyst authentication framework.
----
Clone-0.31
http://search.cpan.org/~rdf/Clone-0.31/
recursively copy Perl datatypes
----
Config-File-1.50
http://search.cpan.org/~gwolf/Config-File-1.50/
Parse a simple configuration file
----
Config-YUM-1.10
http://search.cpan.org/~opitz/Config-YUM-1.10/
Perl extension for parsing yum.conf
----
Curses-1.27
http://search.cpan.org/~giraffed/Curses-1.27/
terminal screen handling and optimization
----
Data-Util-0.50
http://search.cpan.org/~gfuji/Data-Util-0.50/
A selection of utilities for data and data types
----
Deliantra-Client-2.03
http://search.cpan.org/~mlehmann/Deliantra-Client-2.03/
----
Devel-Backtrace-0.11_01
http://search.cpan.org/~pepe/Devel-Backtrace-0.11_01/
Object-oriented backtrace
----
Devel-NYTProf-2.07_93
http://search.cpan.org/~timb/Devel-NYTProf-2.07_93/
Powerful feature-rich perl source code profiler
----
Devel-PerlySense-0.0178
http://search.cpan.org/~johanl/Devel-PerlySense-0.0178/
Perl IDE backend with Emacs frontend
----
Email-MIME-Creator-1.455
http://search.cpan.org/~rjbs/Email-MIME-Creator-1.455/
Email::MIME constructor for starting anew.
----
Finance-NASDAQ-Quote-0.02
http://search.cpan.org/~iank/Finance-NASDAQ-Quote-0.02/
Fetch real time stock quotes from nasdaq.com
----
Geo-GoogleEarth-Document-modules1
http://search.cpan.org/~dahillma/Geo-GoogleEarth-Document-modules1/
----
IO-CaptureOutput-1.1001
http://search.cpan.org/~dagolden/IO-CaptureOutput-1.1001/
capture STDOUT and STDERR from Perl code, subprocesses or XS
----
LaTeX-Driver-0.08
http://search.cpan.org/~andrewf/LaTeX-Driver-0.08/
Latex driver
----
MojoX-Session-0.05
http://search.cpan.org/~vti/MojoX-Session-0.05/
Session management for Mojo
----
MooseX-Contract-0.01
http://search.cpan.org/~bphillips/MooseX-Contract-0.01/
Helps you avoid Moose-stakes!
----
Muldis-D-0.58.0
http://search.cpan.org/~duncand/Muldis-D-0.58.0/
Formal spec of Muldis D relational DBMS lang
----
Net-IMAP-Client-0.8
http://search.cpan.org/~mishoo/Net-IMAP-Client-0.8/
Not so simple IMAP client library
----
Net-OpenSSH-0.18
http://search.cpan.org/~salva/Net-OpenSSH-0.18/
Perl SSH client package implemented on top of OpenSSH
----
Net-OpenSSH-0.19
http://search.cpan.org/~salva/Net-OpenSSH-0.19/
Perl SSH client package implemented on top of OpenSSH
----
Net-SMS-2Way-0.07
http://search.cpan.org/~lengel/Net-SMS-2Way-0.07/
BulkSMS API
----
Net-sFlow-0.11
http://search.cpan.org/~elisa/Net-sFlow-0.11/
decode sFlow datagrams
----
POE-Component-Server-SimpleHTTP-1.53_01
http://search.cpan.org/~bingos/POE-Component-Server-SimpleHTTP-1.53_01/
Perl extension to serve HTTP requests in POE.
----
Parse-ABNF-0.05
http://search.cpan.org/~bjoern/Parse-ABNF-0.05/
Parse IETF Augmented BNF (ABNF) grammars.
----
Pod-Parser-1.36
http://search.cpan.org/~marekr/Pod-Parser-1.36/
base class for creating POD filters and translators
----
RT-Authen-ExternalAuth-0.08_01
http://search.cpan.org/~zordrak/RT-Authen-ExternalAuth-0.08_01/
RT Authentication using External Sources
----
Roguelike-Utils-0.4.173
http://search.cpan.org/~earonesty/Roguelike-Utils-0.4.173/
----
Set-Relation-0.0.0
http://search.cpan.org/~duncand/Set-Relation-0.0.0/
Relation data type for Perl
----
String-BufferStack-1.10
http://search.cpan.org/~alexmv/String-BufferStack-1.10/
Nested buffers for templating systems
----
Sys-Sendfile-0.03
http://search.cpan.org/~leont/Sys-Sendfile-0.03/
Zero-copy data transfer
----
Task-Catalyst-Tutorial-0.05
http://search.cpan.org/~mstrout/Task-Catalyst-Tutorial-0.05/
Installs everything you need to learn Catalyst
----
Template-Declare-0.35
http://search.cpan.org/~alexmv/Template-Declare-0.35/
Perlish declarative templates
----
Test-POE-Client-TCP-0.10
http://search.cpan.org/~bingos/Test-POE-Client-TCP-0.10/
A POE Component providing TCP client services for test cases
----
Test-Reporter-1.5203
http://search.cpan.org/~dagolden/Test-Reporter-1.5203/
sends test results to cpan-testers@perl.org
----
Test-SFTP-0.03
http://search.cpan.org/~xsawyerx/Test-SFTP-0.03/
----
Text-FIGlet-2.04
http://search.cpan.org/~jpierce/Text-FIGlet-2.04/
a perl module to provide FIGlet abilities, akin to banner
----
Tie-Tk-Text-0.92
http://search.cpan.org/~mjcarman/Tie-Tk-Text-0.92/
Access Tk text widgets as arrays.
----
Tk-Clock-0.24
http://search.cpan.org/~hmbrand/Tk-Clock-0.24/
Clock widget with analog and digital display
----
Tkx-FindBar-0.08
http://search.cpan.org/~mjcarman/Tkx-FindBar-0.08/
Perl Tkx extension for an incremental search toolbar
----
Tkx-ROText-0.04
http://search.cpan.org/~mjcarman/Tkx-ROText-0.04/
Tkx text widget that supports a read-only state.
----
UMLS-Interface-0.11
http://search.cpan.org/~btmcinnes/UMLS-Interface-0.11/
Perl interface to the Unified Medical Language System (UMLS)
----
UMLS-Similarity-0.05
http://search.cpan.org/~btmcinnes/UMLS-Similarity-0.05/
This is a suite of Perl modules that implements a number of measures of semantic relatedness. These algorithms use the UMLS-Interface module to access the Unified Medical Language System (UMLS) to gen
----
UltraDNS-0.06
http://search.cpan.org/~timb/UltraDNS-0.06/
Client API for the NeuStar UltraDNS Transaction Protocol
----
Unix-Uptime-0.2
http://search.cpan.org/~pioto/Unix-Uptime-0.2/
Determine the current uptime, in seconds, across different *NIX architectures
----
User-Simple-1.43
http://search.cpan.org/~gwolf/User-Simple-1.43/
Simple user sessions management
----
Video-FourCC-Info-1.1
http://search.cpan.org/~frequency/Video-FourCC-Info-1.1/
Find information about codecs specified as Four Character Code
----
WWW-TinySong-0.05
http://search.cpan.org/~miorel/WWW-TinySong-0.05/
Get free music links from tinysong.com
----
WebService-YouTube-1.0.3
http://search.cpan.org/~yoshida/WebService-YouTube-1.0.3/
Perl interfece to YouTube
----
Win32-0.39
http://search.cpan.org/~jdb/Win32-0.39/
Interfaces to some Win32 API Functions
----
XML-Encoding-2.06
http://search.cpan.org/~shay/XML-Encoding-2.06/
A perl module for parsing XML encoding maps.
----
XML-ExtOn-0.08
http://search.cpan.org/~zag/XML-ExtOn-0.08/
The handler for expansion of Perl SAX by objects.
----
xcruciate-006
http://search.cpan.org/~melonman/xcruciate-006/
----
xcruciate-unitconfig-006
http://search.cpan.org/~melonman/xcruciate-unitconfig-006/
----
xcruciate-utils-006
http://search.cpan.org/~melonman/xcruciate-utils-006/
----
xcruciate-xcruciateconfig-006
http://search.cpan.org/~melonman/xcruciate-xcruciateconfig-006/
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: Wed, 21 Jan 2009 02:26:28 +0200
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: Perl - marker ?
Message-Id: <slrngncr00.cs7.whynot@orphan.zombinet>
On 2009-01-20, Jürgen Exner <jurgenex@hotmail.com> wrote:
> Kevin <kejoseph@hotmail.com> wrote:
>>I want to be able to read a text file every 10 minutes or so.
>
> perldoc -f sleep
> perldoc -q timeout
>
>>Since
>>the file can get pretty large over time, I want to pick up where I
>>left off earlier. Is this possible using Perl ?
>
> perldoc -f seek
>
> You could also take a look at "perldoc -q tail"
What the heck? That was here exactly a month before. What's going on
with you guys?
<pvonk4d6oi9952icivn0eqb6prk29cjd3r@4ax.com>
--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
------------------------------
Date: Wed, 21 Jan 2009 02:13:27 -0500
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: What do you need to have to be considered a Master at Perl?
Message-Id: <864ozt1694.fsf@mithril.chromatico.net>
>>>>> "TJM" == Tad J McClellan <tadmc@seesig.invalid> writes:
>> We use a variant of this -- we ask about the difference between
>> my, our, and local.
TJM> I sure hope you give at least partial credit if the response is
TJM> something like:
TJM> my() and our() are ways to declare variables
TJM> local() does not declare a variable
TJM> (which is why I put local in a followup, as it doesn't really
TJM> belong with the other two. )
Well, we don't grade things objectively -- we've found, for instance,
that it's often better to hire a smart person who doesn't know Perl
details (and then teach him or her Perl) than to hire a dumb person
who's mastered Perl.
In my experience, either people can't articulate the difference at all,
or they know that my declares lexical variables, our declares global
variables, and local is something that they have heard of but haven't
run into except in idioms like { local $/; my $file = <$fh>; }
>> You have a string that comes from a freeform text field where the
>> user is expected to enter a telephone number.
TJM> I sure hope that is restricted to "a US phone number"...
Ah, that's one of the things that most candidates don't even consider --
the ones that tend to bring it up get points for it.
>> This is usually good for a lot of discussion about what should be
>> valid,
TJM> I'll offer my unsolicited opinion below without accepting
TJM> discussion. :-)
Well, the discussion is often the most interesting part, because it
shows how the candidate approaches the problem.
(The correct solution, in the context of our work, is that if you're
using a phone number you use the form object for a telephone number, and
it handles the validation. But that's not interesting or especially
revelatory in an interview.)
>> and about the damnfool things that users do.
TJM> I think my solution will allow plenty damnfoolery and still
TJM> yield a usable US telephone number:
[snip solution]
TJM> Do I get the job?
I think you're most likely more than qualified on Perl details. You
need to meet the members of the team to be sure....
TJM> (only half-kidding, as I am available for hire right now, but
TJM> it would need to be telecommute or near Fort Worth... )
Alas, telecommuting isn't an option, and Cambridge, MA is close to Fort
Worth (TX?) only if you're considering things in astronomical terms.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Wed, 21 Jan 2009 07:39:14 GMT
From: sln@netherlands.com
Subject: Re: What do you need to have to be considered a Master at Perl?
Message-Id: <o4kdn4pap8mcbrldc6549osd6d8pm49eh1@4ax.com>
On Wed, 21 Jan 2009 02:13:27 -0500, Charlton Wilbur <cwilbur@chromatico.net> wrote:
>>>>>> "TJM" == Tad J McClellan <tadmc@seesig.invalid> writes:
>
> >> We use a variant of this -- we ask about the difference between
> >> my, our, and local.
>
> TJM> I sure hope you give at least partial credit if the response is
> TJM> something like:
>
> TJM> my() and our() are ways to declare variables
>
> TJM> local() does not declare a variable
>
> TJM> (which is why I put local in a followup, as it doesn't really
> TJM> belong with the other two. )
>
>Well, we don't grade things objectively -- we've found, for instance,
>that it's often better to hire a smart person who doesn't know Perl
>details (and then teach him or her Perl) than to hire a dumb person
>who's mastered Perl.
>
>In my experience, either people can't articulate the difference at all,
>or they know that my declares lexical variables, our declares global
>variables, and local is something that they have heard of but haven't
>run into except in idioms like { local $/; my $file = <$fh>; }
>
> >> You have a string that comes from a freeform text field where the
> >> user is expected to enter a telephone number.
>
> TJM> I sure hope that is restricted to "a US phone number"...
>
>Ah, that's one of the things that most candidates don't even consider --
>the ones that tend to bring it up get points for it.
>
> >> This is usually good for a lot of discussion about what should be
> >> valid,
>
> TJM> I'll offer my unsolicited opinion below without accepting
> TJM> discussion. :-)
>
>Well, the discussion is often the most interesting part, because it
>shows how the candidate approaches the problem.
>
>(The correct solution, in the context of our work, is that if you're
>using a phone number you use the form object for a telephone number, and
>it handles the validation. But that's not interesting or especially
>revelatory in an interview.)
>
> >> and about the damnfool things that users do.
>
> TJM> I think my solution will allow plenty damnfoolery and still
> TJM> yield a usable US telephone number:
>
>[snip solution]
>
> TJM> Do I get the job?
>
>I think you're most likely more than qualified on Perl details. You
>need to meet the members of the team to be sure....
>
> TJM> (only half-kidding, as I am available for hire right now, but
> TJM> it would need to be telecommute or near Fort Worth... )
>
>Alas, telecommuting isn't an option, and Cambridge, MA is close to Fort
>Worth (TX?) only if you're considering things in astronomical terms.
>
>Charlton
Ahh, its always thos "alas" things that getcha. I asked my brother for a job
and if I can telecomute, he said the same thing.
I haven't said shit to him since.
sln
------------------------------
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 2144
***************************************