, Support --
- Free Perl Training --- http://perlhunter.com/college.html -
- Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
perl -le 'print for glob{Y,N}x5'
--
Rick Klement
is the $|--.
--
Rick Klement
, I am looking forward to see what the outcome is.
Brian
There is no need for a regex
$Yr = ($FieldA 20 ? 1900 : 2000) + $FieldA;
Or just get $FieldB directly if you don't need a separate $Yr
$FieldB = ($FieldA 21) + 19 . $FieldA;
--
Rick Klement
Rick Klement wrote:
Brian Morgan wrote:
($Yr = $FieldA) =~ s/^(\d{2}).*/$1/;
if($Yr 20){
$Yr = 19$Yr;
}else{
$Yr = 20$Yr;
}
#Concat year to FieldB
There is no need for a regex
$Yr = ($FieldA 20 ? 1900 : 2000) + $FieldA;
Or just get $FieldB directly
/ eval == 21 print for
($n$op$n)$op($n$op$n),
(($n$op$n)$op$n)$op$n,
($n$op($n$op$n))$op$n,
$n$op(($n$op$n)$op$n),
$n$op($n$op($n$op$n)),
--
Rick Klement
Michael G Schwern wrote:
On Wed, Apr 17, 2002 at 12:28:37PM -0700, Rick Klement wrote:
There's already a %dispatch set up for you by perl...
I'd have used it but it just fell into the gaping security hole.
A recent Phrack article pointed out that one of the SOAP/RPC/XML
modules
pulling, and heads banging into keyboards and brick walls...
--
Rick Klement
enough.
(I hope these tips don't help anyone - there are enough sharks out there :)
--
Rick Klement
($`%10+$)%15,eg,s,,,;eg
cool...
--
Rick Klement
$_=pop;s;.;print,s,,$*1.11%10if/\G../,eg;eg
And here's a 46:
-l $_=pop;s;.;print,s,,$*1.11%10if/../g,eg;eg
And a 46 with a better tiebreaker value:
-l $_=pop;s;.;print,s,,/../g$*1.11%10,eg;eg
since the precedence problem that needed the 'if' construct
is no longer there.
--
Rick Klement
looks at the end of the string when it sees the $, but
thankfully it's not smart enough only to look near word boundaries even when
there's a \b in there.
Check out Eugene's: /..(?{CODE})^/
--
Rick Klement
have a different version of perl to try it on?
[EMAIL PROTECTED] wrote:
Maybe Perl golf is useful, after all -- as a QA tool to find
Perl bugs. :)
--
Rick Klement
-line via `perl secret.pl', but not via `./secret.pl' :-)
Don't know whether the judges would have accepted it.
Not allowed, by the rule:
When tested, you can assume your script to have file permissions of 0644.
--
Rick Klement
/.?/___$`%100___/g
--
Rick Klement
%48)while$_;print$x+0
and tweaking slightly, one gets:
$\=ord(lc)%87%48+36*$\.$/for pop=~/./g;print
which is a 44 :)
--
Rick Klement
[EMAIL PROTECTED] wrote:
Correct me if I'm wrong, but there is only one golfer who
has appeared on all five leaderboards: Rick Klement.
(Ton also, if you count BoB in irc game).
/-\ndrew
Now if I could only learn how to play... :(
--
Rick Klement
Philippe 'BooK' Bruhat wrote:
Maybe people with the same score and tie-breaker should have the same rank
And someone with the same score but not the same tie-breaker will jump a few
steps backs
So that everyone can see the real ranking
I second this motion :)
--
Rick Klement
first entry, too, although it was entered correctly on
the leaderboard I know that Opera is quirky about its forms sometimes,
could that be related?
Patrick
It happened to me too - they just said they'll fix it
--
Rick Klement
for that :)
I'll just let one's choice of indenting style be it's own punishment :)
--
Rick Klement
Keith C. Ivey wrote:
Rick Klement [EMAIL PROTECTED] wrote:
Vicki Brown wrote:
if (...) {
my @item_parts = split(/\n/, $item);
printf ORDER (\n%4d %-50s %3.2f %3.2f\n,
$quantity, $item_parts[0
/mprintChristmas found on a Sunday in $_\nfor 1900..2100
--
Rick Klement
implementation of an
algorithm - there may be a better way to implement it.
3) Read through _all_ the functions, _all_ the operators,
_all_ the syntax, and _all_ the special variables, etc.
If it takes playing Perl Golf to learn
these programming rules, so be it...
--
Rick Klement
Pradeep Sethi wrote:
Hi All,
I want to change date 9/9/1987 to 09/09/1973
was wondering, what is the most efficient way ?
s/\b\d\b/0$/g
(it's the effects of playing a lot of golf lately... :)
--
Rick Klement
Yanick wrote:
On Fri, Jan 25, 2002 at 12:17:05PM +1100, [EMAIL PROTECTED] wrote:
Current Leaderboard
---
1. 69 Rick Klement
AAAUGH!!!
(and I think I speak for the vast majority of us here...)
Thank you, that was the nicest
...)
--
Rick Klement
...
To your computer, where you test and experiment with stuff,
and read the Perl documentation, and then try some more... :)
--
Rick Klement
for $op =~ /\d/g;
print ans: $f\n if 24 == eval $f;
}
}
}
It prints 20 results.
--
Rick Klement
Eugene van der Pijll wrote:
One of my more interesting tries on this hole was
int.5+($.-=2)/2||print for
Eugene
The one I did that I liked was
sub{shift,pop while@_2;print@_}-()
--
Rick Klement
Jeff 'japhy' Pinyan wrote:
On Dec 7, Rick Klement said:
sub{shift,pop while@_2;print@_}-()
@_=;shift,pop while@_2;print@_
shift() and pop() only default to @_ in a sub{} ...
(that's what I liked about it)
--
Rick Klement
to a long tough wait to see some of these
interesting efforts.
(Of course, I'd also like to see the best score per hole, but I
guess that got voted down.)
--
Rick Klement
30 matches
Mail list logo