Re: Reading X lines at a time

2004-05-03 Thread Georg Moritz
From the keyboard of Jose Alves de Castro [03.05.04,10:56]: This has been bugging me for some time... What would be the easiest way to read X lines of input at a time? I don't really think you can use $/ for this, as it's not a regex, but a string... However, the thought of having to use

Re: Reading X lines at a time

2004-05-03 Thread Georg Moritz
From the keyboard of Georg Moritz [03.05.04,13:37]: From the keyboard of Georg Moritz [03.05.04,13:34]: [..] $_=x$n silly me, it was not about n-ification.. :-/ @_=map{scalar()}(1..$X) -- _($_= x(15).?\n.q·/)Oo. G°\/ /\_¯/(q

Re: Reading X lines at a time

2004-05-03 Thread Georg Moritz
Hello Jose, @_=map{scalar()}(1..$X) inside a loop testing for eof is necessary: while(!eof()(@_=map{scalar()}(1..$X)){ foo; # gets @_ } greets, georg -- _($_= x(15).?\n.q·/)Oo. G°\/ /\_¯/(q/ \__(m.·.(_(always

Re: Reading X lines at a time

2004-05-03 Thread Georg Moritz
From the keyboard of Rick Delaney [03.05.04,09:23]: On Mon, May 03, 2004 at 02:07:42PM +0200, Georg Moritz wrote: Hello Jose, @_=map{scalar()}(1..$X) inside a loop testing for eof is necessary: while(!eof()(@_=map{scalar()}(1..$X)){ foo; # gets @_ } The eof() must

Re: Reading X lines at a time

2004-05-03 Thread Georg Moritz
From the keyboard of Rick Delaney [03.05.04,09:42]: On Mon, May 03, 2004 at 03:27:01PM +0200, Georg Moritz wrote: From the keyboard of Rick Delaney [03.05.04,09:23]: while (my @a = map { eof() ? () : scalar } 1 .. $n) { print @a; print SEPARATOR\n

Re: s/// w/o intermediate variables?

2004-05-04 Thread Georg Moritz
From the keyboard of [EMAIL PROTECTED] [04.05.04,11:13]: Here's an example of a recurrent annoyance: my $package = 'Foo::Bar::Baz'; (my $package_filename = $package) =~ s,::,/,g; require $package_filename; $package-foobar(); One of my many neurotic little peeves is that,

Re: [golf] Tangled Tale Results (2)

2004-07-02 Thread Georg Moritz
From the keyboard of Ton Hospel [02.07.04,10:57]: map{15[EMAIL PROTECTED],$x+1or print1 @x while!$x{$x=vec·Çðèʂê´í…Ãñvµ©,$x*2|$_@x1,4}++*$x;undef*x}0..2**15 hmm, the vector doesn't seem to be right - it doesn't work. It should be map{15[EMAIL PROTECTED],$x+1or print1 @x

Re: Secret operators

2005-02-01 Thread Georg Moritz
From the keyboard of [EMAIL PROTECTED] [01.02.05,11:15]: Can I get that just a little slower? $b = () = /u/g; is the same as: @a = /u/g; $b = @a; it's not the same. perl -le '$_=foo; print $b =()= /o/g' 2 perl -le '$_=foo; print @b =()= /o/g' perl -le '$_=foo; print /o/g' oo

Re: Naming the @{[]} operator

2006-07-08 Thread Georg Moritz
From the keyboard of Stefan `Sec` Zehl [08.07.06,12:29]: On Sat, Jul 08, 2006 at 08:02 +1000, Andrew Savige wrote: Here's an attempt at a definitive reference list for Perl's secret operators. I blame cog and BooK. [...] Wow, thanks for that list. -- On a related note: I distinctly

Re: Error puzzler

2006-09-14 Thread Georg Moritz
From the keyboard of Peter Scott [13.09.06,09:20]: Here's a distillation of something that just bit me, behaves the same on 5.6.1 and 5.8.5. Observe the following program: Try this :-) $_ = bar; print before the loop: \$_ = $_\n; for (1..1) { print before print_file(): \$_ = $_\n;

Re: Error puzzler

2006-09-14 Thread Georg Moritz
From the keyboard of Georg Moritz [15.09.06,01:03]: From the keyboard of Peter Scott [13.09.06,09:20]: Here's a distillation of something that just bit me, behaves the same on 5.6.1 and 5.8.5. Observe the following program: Try this :-) $_ = bar; print before the loop: \$_ = $_\n

Re: The flaming X-wing secret operator (moon 2)

2007-11-29 Thread Georg Moritz
From the keyboard of [EMAIL PROTECTED] [29.11.07,11:11]: On Thu, Nov 29, 2007 at 10:00:19AM +0100, Philippe Bruhat (BooK) wrote: On Wed, Nov 28, 2007 at 07:22:54PM -0500, Yanick Champoux wrote: Somehow, I think Philippe knew that. ;-) Even better, I knew I didn't need them.

Re: new !-based secret operators

2007-11-30 Thread Georg Moritz
From the keyboard of Uri Guttman [30.11.07,13:02]: DK == Dmitry Karasik [EMAIL PROTECTED] writes: DK Hi Uri! Uri you, sir, have altogether too much free time!! would you like to stop Uri wasting your life and help improve some cpan modules of mine? :) DK will I get

Re: regex of the month (decade?)

2008-01-12 Thread Georg Moritz
From the keyboard of Chris Dolan [12.01.08,16:51]: On Jan 11, 2008, at 8:01 AM, David Landgren wrote: The benchmark may be flawed, since my appreciation of Unicode is little more than things went downhill after 7-bit ASCII. Haven't I read that you live in Paris? I figured that anyone

Umlaut (was: Re: regex of the month (decade?))

2008-01-12 Thread Georg Moritz
From the keyboard of Yanick Champoux [12.01.08,18:50]: Chris Dolan wrote: On a major tangent, have others noticed the resurgence of the umlaut in printed English? I keep seeing things like coöperation or coördinates -- particularly in Technology Review, but in other publications on

Re: Umlaut

2008-01-14 Thread Georg Moritz
From the keyboard of sebb [14.01.08,12:21]: On 14/01/2008, John Douglas Porter [EMAIL PROTECTED] wrote: From the keyboard of Yanick Champoux [12.01.08,18:50]: *dieresis* or *diæresis *A diacritical mark (* ¨ *) optionally used in English, oftentimes replaced by a hyphen. In

Re: decimal - Binary

2011-11-16 Thread Georg Moritz
Greetings Sandro all, From the keyboard of Sandro CAZZANIGA [16.11.11,14:26]: hi! Just a little JAPH for convert decimal to binary Feel free to comment it ;) golfed down a bit, just for fun... #!/usr/bin/perl -l @ARGV or die No args; print$_: ,($_=unpackB*,packN,$_)=~s/0+//?$_:$_

Re: decimal - Binary

2011-11-16 Thread Georg Moritz
From the keyboard of Ronald J Kimball [16.11.11,14:14]: On Wed, Nov 16, 2011 at 07:49:14PM +0100, Olof Johansson wrote: On 2011-11-16 11:57 -0500, Ronald J Kimball wrote: No, you are wrong. s/0*// is sufficient, because /0*/ will always match at the start of the string anyway. rye