Re: Sorting in-place

2001-08-08 Thread Michael G Schwern
(). If we made sort() in scalar context sort @stuff in-place, it would change the behavior of that code. @stuff would inadvertently get sorted. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl6 Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One

Re: Japhs in FORTRAN

2001-08-09 Thread Michael G Schwern
that is entirely beyond me. It's obviously more efficient! Since A-Z are the most common characters, if you put one on each side of the ball it has to at most go through a quarter turn from any position to print a letter! ;) -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern

Re: isNumber( ) ??

2001-10-18 Thread Michael G Schwern
. sub is_num { my($cand) = shift; my $not_num; local $^W = 1; local $SIG{__WARN__} = sub { $not_num = $_[0] =~ /^Argument .*? isn't numeric/; }; () = $cand + 0; return !$not_num; } -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern

Re: [Not Fun] WWW-Authenticate: NTLM ???

2001-10-20 Thread Michael G Schwern
On Fri, Oct 19, 2001 at 11:57:41PM -0400, [EMAIL PROTECTED] wrote: Anyone know of a resource for researching WWW-Authenticate: NTLM ? This might prove useful. At least you've got the protocol. http://www.innovation.ch/java/ntlm.html -- Michael G. Schwern [EMAIL PROTECTED]http

Practical Perl Golf

2001-11-14 Thread Michael G Schwern
necessary to run perl and the C pre-processor under VMS eats up about 120 characters, plus the filename which could eat anywhere from 1 to 100 characters. This doesn't leave much room to maneuver. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl6 Quality Assurance

Re: Practical Perl Golf

2001-11-14 Thread Michael G Schwern
On Wed, Nov 14, 2001 at 09:03:21PM -0500, Jeff 'japhy' Pinyan wrote: On Nov 14, Michael G Schwern said: 1) Strips all comment-only lines from a Perl program (ie. /^\s*#/) except those which are C pre-processor commands. (It's not necessary to worry about if you're inside

Re: Practical Perl Golf

2001-11-14 Thread Michael G Schwern
On Wed, Nov 14, 2001 at 09:03:21PM -0500, Jeff 'japhy' Pinyan wrote: On Nov 14, Michael G Schwern said: 1) Strips all comment-only lines from a Perl program (ie. /^\s*#/) except those which are C pre-processor commands. (It's not necessary to worry about if you're inside

Re: Practical Perl Golf

2001-11-14 Thread Michael G Schwern
Schuyler's got it down to: perl -ne '(/^\\s*[^#]|^\\s*#\\s*(include|define|(ifn?|un)def|else|elif|endif)/)print' and perl -ne '$s||=/^#!.*perl/i;$s(/^\\s*[^#]|^\\s*#\\s*(include|define|(ifn?|un)def|else|elif|endif)/)print' -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com

Re: Practical Perl Golf

2001-11-14 Thread Michael G Schwern
is covered by: perl -ne'/^\\s*#(?!\\s*(include|define|if(n?def)?|el(se|if)|undef|endif))/||print' Is that bitwise or wise? -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl6 Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One AY! The ground beef, she

Re: Practical Perl Golf

2001-11-14 Thread Michael G Schwern
G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl6 Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One the chair. it wants to die. oh no! she sees me! she attacks! #!./perl -l # There's a bug in -P where the #! line is ignored. If this test # suddenly starts

Re: Practical Perl Golf

2001-11-14 Thread Michael G Schwern
a shit about -P anymore. I'm sort of doing this as a large-scale exercise in anal-retentiveness. Don't think of it as gaining VMS, think of it as losing sed. ;) -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl6 Quality Assurance [EMAIL PROTECTED] Kwalitee

Re: Practical Perl Golf

2001-11-14 Thread Michael G Schwern
)/||print' perl -ne '(1../^#!.*perl/i)|/^\s*#(?!\s*((ifn?|un)def|(el|end)?if|define|include|else)\b)/||print' -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl6 Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Here's hoping you don't harbor a death wish!

Re: Practical Perl Golf

2001-11-15 Thread Michael G Schwern
On Thu, Nov 15, 2001 at 01:35:56PM +0100, [EMAIL PROTECTED] wrote: This leaves #if-- in. perl -ne '/^\s*#(?!\s*((ifn?|un)def|(el|end)?if|define|include|else)\s)/||print' takes it out. Thanks, Ab. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl6

Re: Practical Perl Golf

2001-11-15 Thread Michael G Schwern
On Thu, Nov 15, 2001 at 08:57:12PM +0100, Bart Lateur wrote: On Thu, 15 Nov 2001 12:14:23 -0500, Michael G Schwern wrote: $1$dkb300:[schwern.src.perl-current.][00]perl.exe The absolute path to the perl executable. disk:[path.to.the.]program.exe I have no idea what the [00

Re: Practical Perl Golf

2001-11-16 Thread Michael G Schwern
be getting the native symbols, but they're all in $Config{cppccsymbols} + $Config{cppsymbols} so you're good to go. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Right Wing Enema: Flush Immorality

Re: isprint Golf Challenge

2001-11-16 Thread Michael G Schwern
isprint(), as for as POSIX is concered, is just anything between x20 and x7F, the s/[^ -~//ge regex should work fine. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One shitting is a chore wet glue

Re: isprint Golf Challenge

2001-11-16 Thread Michael G Schwern
, but you gain correctness across locales. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One We're talkin' to you, weaselnuts. http://www.goats.com/archive/000831.html

Re: isprint Golf Challenge

2001-11-17 Thread Michael G Schwern
. \x7F is a control character (DEL, \c?). It should really be: $U2P{$chr} = isprint($chr) ? $chr : '\\'.sprintf(%03o,$num); -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Death? Its like

Re: isprint Golf Challenge

2001-11-17 Thread Michael G Schwern
; return $str; } The whole thing hinges on having a known set of locale independent printable characters to avoid having to run each and every one through isprint() every time. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL

Re: First CPAN Joke Module

2001-11-17 Thread Michael G Schwern
. Of course, I'm a lazy git and haven't moved my stuff there yet. Besides, Acme::Sex gives me bad imagery of exploding condoms. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Don't ask me lady, I

Re: Who is this Perl hacker?

2001-11-19 Thread Michael G Schwern
-- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One And God created Cat to be a companion to Adam. And Cat would not obey Adam. And when Adam gazed into Cat's eyes, he was reminded that he

Feel good benchmarks

2001-11-20 Thread Michael G Schwern
0m0.030s sys 0m0.000s -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One OH GOD!! It's LINUX! All you Linux fanboys go wild! It never crashes! It'll wash your underpants! It'll eat your

Re: Feel good benchmarks

2001-11-20 Thread Michael G Schwern
Perl code vs readable Ruby Python code. They get named argument parameters cheaply, Perl doesn't. It hurts, but ya gotta accept it. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Beer still

Re: Feel good benchmarks

2001-11-20 Thread Michael G Schwern
)); } 139423224561697698330489613862193018947914545343780323868775030943672596190605867771863846635039486902272 real0m0.051s user0m0.000s sys 0m0.020s Of course, that mess probably proves my point pretty well. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance

Re: Feel good benchmarks

2001-11-21 Thread Michael G Schwern
. hal2 92 [9:50] ~/Tests /usr/bin/time ./fib-fast 500 139423224561697873388268830107091057642465893024716039229340111610069135233925734164006795046787674537984 Algorithms count! So does correctness, yours gives the wrong answer. No wonder it's the Enterprise edition. ;) -- Michael G. Schwern

Re: Relationship between Perl and various animals and sitcoms

2001-11-26 Thread Michael G Schwern
other TV sitcom) There is nothing else worth watching on TV according to London.pm. And what does it mean: Buffy riding a Pony? Remember how they say Catherine the Great died... -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL

Re: Relationship between Perl and various animals and sitcoms

2001-11-26 Thread Michael G Schwern
packages installed? You decide. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Commence simultaneous panic on my mark.

Re: Gift Giving... in Perl?

2001-11-27 Thread Michael G Schwern
On Tue, Nov 27, 2001 at 06:40:47PM -0500, Michael G Schwern wrote: shuffle \@emails; for (1..@emails) { $santa{$emails[0]} = $emails[1]; push @emails, unshift @emails; ^^^ Make that shift } -- Michael G. Schwern

Re: middle line (was Re: Daily Perl FAQ...)

2001-11-29 Thread Michael G Schwern
; -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Monkey tennis

Re: middle line (was Re: Daily Perl FAQ...)

2001-11-29 Thread Michael G Schwern
own buffering but maybe it could. does Tie::Filehandle have a TELL/SEEK method?) Tied handles have TELL and SEEK, yep. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Plus I remember being

Re: middle line (was Re: Daily Perl FAQ...)

2001-11-29 Thread Michael G Schwern
On Thu, Nov 29, 2001 at 11:34:24AM -0800, Chris Thorpe wrote: On Thu, 29 Nov 2001, Yanick wrote: On Thu, Nov 29, 2001 at 01:34:02PM -0500, Michael G Schwern wrote: Yesterday, I saw an interesting related exercise. Write a program that reads the lines from a file and outputs

Re: middle line (was Re: Daily Perl FAQ...)

2001-12-03 Thread Michael G Schwern
(g(n)) if and only if there are N 0 and c 0, such that for all n N, |f(n)| |c * g(n)|. Crash Course usually means you try to avoid those sort of precise yet incomprehensible definitions. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality

Re: tri-state flags

2001-12-05 Thread Michael G Schwern
, so repetition as in the next, is not good: defined $flag !$flag -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One But I wore the juice!

Re: The Santa Claus Golf Apocalypse

2001-12-06 Thread Michael G Schwern
On Fri, Dec 07, 2001 at 10:01:05AM +1100, [EMAIL PROTECTED] wrote: --- mid.pl - #!/usr/bin/perl -p0 $_=$1while/.^(.+)^/ms Someone want to explain why this works? -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl

Re: Santa Hole 5 (wc.pl) Post Mortem

2001-12-06 Thread Michael G Schwern
On Fri, Dec 07, 2001 at 10:36:50AM +1100, [EMAIL PROTECTED] wrote: --- Piers Cawley - 21 #!/usr/bin/perl -lp $#='%010g'}{$_=$. Shouldn't that be 20? -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED

Re: Cocoa for Perl ?

2001-12-14 Thread Michael G Schwern
On Fri, Dec 14, 2001 at 05:39:17PM -0500, Bill Jones wrote: Hey! :) Anyone know anything about the Cocoa Perl debate/project/anything? http://dev.perl.org/macosx/ -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED

Re: A Quick Quiz

2001-12-15 Thread Michael G Schwern
On Sat, Dec 15, 2001 at 10:10:48AM -0800, David Wheeler wrote: On Fri, 2001-12-14 at 23:28, Michael G Schwern wrote: On Fri, Dec 14, 2001 at 10:58:06PM -0800, David Wheeler wrote: Given this script, what would you expect the output to be? Depends on whether you're running bleadperl

Re: A Quick Quiz

2001-12-15 Thread Michael G Schwern
On Sat, Dec 15, 2001 at 04:47:35PM -0800, David Wheeler wrote: On Sat, 2001-12-15 at 10:22, Michael G Schwern wrote: Ah, interesting. I could see an argument where this would *not* be considered a bug ? http://archive.develooper.com/perl5-porters%40perl.org/msg60352.html

Re: Perl and majordomo

2001-12-26 Thread Michael G Schwern
? mailman? Look at the full mail headers on this and all perl.org list messages. List-Post: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] -- Michael G. Schwern [EMAIL PROTECTED]http

Re: Practical Perl Problem

2002-01-14 Thread Michael G Schwern
inout 7 #!/usr/bin/perl # run this file with perl -x seek(DATA,0,0);for(DATA){/^#!/last;/(\w+):/print(--== $1 ==--\n) next;/(\w+)[ ]+ (\w+)(?:[ ]+(\d+))?/($sl = length $3 ? _vector($3 . downto 0);:';')printf(%-8s: %s std_logic%s\n,$1,$2,$sl)next} __DATA__ -- Michael G. Schwern [EMAIL

Re: Better ?

2002-01-24 Thread Michael G Schwern
to enter/leave that block on each element which isn't cheap and its not smart enough to optimize it out. print Found $c things\n; print Mac OS X =~ tr/osxOSX//; -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED

Re: substitution question

2002-01-31 Thread Michael G Schwern
will be reminded which side of the road you drive on. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Don't step on my funk

Re: substitution question

2002-01-31 Thread Michael G Schwern
On Fri, Feb 01, 2002 at 12:52:58PM +1100, [EMAIL PROTECTED] wrote: my $z = sprintf(%.2d/%.2d/%d, $d, $m, $y); print $z\n; printf. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Don't step

Re: substitution question

2002-01-31 Thread Michael G Schwern
\d/)(\d)(?=/)%0$1%; Folks, I'm clawing my eyes out here. Stop hitting the regex crack pipe! $date = sprintf %02d/%02d/%d, split '/', $date; -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One

Re: substitution question

2002-01-31 Thread Michael G Schwern
On Fri, Feb 01, 2002 at 11:01:35AM +0800, Anthony J. Breeds-Taurima wrote: On Thu, 31 Jan 2002, Michael G Schwern wrote: Folks, I'm clawing my eyes out here. Stop hitting the regex crack pipe! the poster asked for a regex solution. $date =~ s{(.*)}{sprintf '%02d/%02d/%d', split '/', $1

Re: substitution question

2002-01-31 Thread Michael G Schwern
On Thu, Jan 31, 2002 at 08:10:00PM -0800, Yitzchak Scott-Thoennes wrote: In article 20020201025307.GC9474@blackrider, Michael G Schwern [EMAIL PROTECTED] wrote: $date = sprintf %02d/%02d/%d, split '/', $date; Perhaps slightly more efficient: $date = sprintf %02d/%02d/%s, split

Re: substitution question

2002-02-01 Thread Michael G Schwern
. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One kiloconway: unit of extreme mind expansion. Equal to 1024 conways, one kiloconway gives the sensation that all of the quantuum particles

Re: substitution question

2002-02-01 Thread Michael G Schwern
go over better. Utilice el sprintf para formatar números Employez le sprintf pour formater des nombres Benutzen Sie sprintf, um Zahlen zu formatieren Usare lo sprintf per formattare i numeri Use o sprintf formatar números ;) -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com

Re: Finding Holidays

2002-02-06 Thread Michael G Schwern
; 1 until christmasday($year++) eq 'Sunday'; print Christmas will fall on a Sunday in $year\n; The man page has the algorithm. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One I SEE A RED

Re: Symbols in CORE?

2002-02-28 Thread Michael G Schwern
On Thu, Feb 28, 2002 at 09:01:05PM +0100, F. Xavier Noria wrote: Is there a way to list the symbols in the CORE package? Not that I know of. CORE isn't a real package, which is why you can't do things like: goto CORE::open; -- Michael G. Schwern [EMAIL PROTECTED]http

Re: Sort is lazy?!? (as in Haskell)

2002-03-03 Thread Michael G Schwern
of sort in void context at -e line 1. sort doesn't bother to run if its results aren't being used. If, for some odd reason, you do want it to work: () = sort ... will trick it currently. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance

Re: Sort is lazy?!? (as in Haskell)

2002-03-03 Thread Michael G Schwern
PS With a truly lazy sort you'd be able to do... ($first) = sort { $a wibble $b } @big_list; # in O(n) time. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Some like elmers glue

Re: is perl a reporting tool ?

2002-03-06 Thread Michael G Schwern
thought it would be nice to be able to do OLAP (multi-dimensional and hierarchical reporting) in Perl. Do you know of any development in this direction? -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job

Self extracting Perl ARchive?

2002-03-31 Thread Michael G Schwern
as long as it compresses decently and decompresses without a lot of effort. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One There is nothing wrong. We have taken control of this sig file. We

Re: Self extracting Perl ARchive?

2002-04-01 Thread Michael G Schwern
that. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One If you'll mount me, I'll let you bomb Canada until they swoon.

Re: A better way ?

2002-04-17 Thread Michael G Schwern
$vFlag !$End ) { DISPATCH: foreach my $flag (keys %dispatch) { if( substr($vFlag, 0, length $flag) eq $flag ) { $dispatch{$flag}-(); last DISPATCH; } } } something like that. -- Michael G. Schwern [EMAIL PROTECTED

Re: A better way ?

2002-04-17 Thread Michael G Schwern
On Wed, Apr 17, 2002 at 02:34:20PM -0400, Bill -Sx- Jones wrote: On 4/17/02 2:22 PM, Michael G Schwern [EMAIL PROTECTED] wrote: The above implies the format is something like: SNEEXADMINEND in which case, suicide is an honorable option. :) Actually, the input data looks

Re: A better way ?

2002-04-17 Thread Michael G Schwern
. or simply: croak $$: Bogus sub call: $blah if $blah =~ /\w+::\w+/; $blah = '_your_private_method_im_not_supposed_to_call'; The jump table is safest and least clever. [1] [1] That's the Chinese clever, like interesting. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com

Re: A better way ?

2002-04-17 Thread Michael G Schwern
it'll blow off. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One There's a Balrog in the woodpile.

Re: A better way ?

2002-04-17 Thread Michael G Schwern
%20system%28%27rm%20%2Drf%20%2F%27%29 If sub_foo() exists, you now have a lot of free hard drive space. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One O you fat bastard

Re: A better way ?

2002-04-18 Thread Michael G Schwern
On Thu, Apr 18, 2002 at 06:21:52AM +0200, Paul Johnson wrote: On Wed, Apr 17, 2002 at 07:59:22PM -0400, Michael G Schwern wrote: Just because the safety is on doesn't mean you should juggle handguns. Never know whose foot it'll blow off. Awww. You're no fun. *bang* -- Michael G

Re: Reading Huge Files into Memory (was RE: reading lines backwards )

2002-06-11 Thread Michael G Schwern
On Tue, Jun 11, 2002 at 06:11:37PM +0100, [EMAIL PROTECTED] wrote: NT OS how much perl had requested but this number doesn't go down when you execute %unique=(). Perl doesn't free the memory used by %unique on the assumption it would just have to reallocate it when you use %unique again,

Re: Reading Huge Files into Memory (was RE: reading lines backw ards)

2002-06-11 Thread Michael G Schwern
On Tue, Jun 11, 2002 at 10:53:44PM +0100, [EMAIL PROTECTED] wrote: Thanks for your reply. I was wondering, if you can't get any details about the overall volume of data perl has in memory, can you find out information about an individual variable's usage? Not really. Individual variables

Re: Reading Huge Files into Memory (was RE: reading lines backw ards)

2002-06-13 Thread Michael G Schwern
On Fri, Jun 14, 2002 at 02:05:02AM +0100, [EMAIL PROTECTED] wrote: timethese(-5, { 'control' = sub {my $k=next_key()}, 'plusplus' = sub {my $k=next_key(); $x{$k}++ }, 'assign1' = sub {my $k=next_key(); unless ($y{$k}) {$y{$k}=1}} }); plusplus and assign1 don't do the

Re: perl5.6.1 oddity?

2002-06-14 Thread Michael G Schwern
On Fri, Jun 14, 2002 at 11:48:33AM +0200, Bart Lateur wrote: Perhaps... (I feel like disagreeing, though.) Anyway: my($foo, $bar); $foo = $bar . 42; *should* warn. It does in 5.8.0. -- This sig file temporarily out of order.

Re: perl5.6.1 oddity?

2002-06-14 Thread Michael G Schwern
On Fri, Jun 14, 2002 at 08:34:03PM +0200, Bart Lateur wrote: What's so special about concatenation, anyway? Welp, here's the change that fixed the 5.6 concat/warning bugs: http://public.activestate.com/cgi-bin/perlbrowse?patch=10223action=patch and here's the thread on p5p about it.

Re: Perl Challenges, Anywhere?

2002-08-31 Thread Michael G Schwern
. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Let me check my notes. http://www.sluggy.com

Re: Mysql performace 30000 record

2002-10-05 Thread Michael G Schwern
statement object $sth can affect MySql performance ? Are there altenative ways to optimize this routine ? Are 3 records to much for this kind of query ? -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee

Re: limit the list

2002-11-19 Thread Michael G Schwern
)90) { ($str = substr($str,0,90)) =~ s/,[^,]*$/, etc./; } $str = substr(join(', ', @names), 0, 90); $str =~ s/,[^,]*$/, etc.../ if length $str = 90; which is basicaly what you've got, just restructured a bit. -- Michael G. Schwern [EMAIL PROTECTED]http

Re: More fun with with lists and ++

2002-11-26 Thread Michael G Schwern
G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One and that, children, is how to clean and load a .38 revolver. Questions?

Re: Out of memory perl script

2002-11-26 Thread Michael G Schwern
]; return($revision, $headers, $log); } -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One You're smoother than a tunnel of shining sorrow.

Re: Out of memory perl script

2002-11-26 Thread Michael G Schwern
an enormous CVS history or there's some infinite loop in his program which is growing some data structure. WWOD? -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Playstation? Of course Perl runs

Re: Out of memory perl script

2002-11-26 Thread Michael G Schwern
with 310 MB RAM, 620 MB VRAM and a 40gig EIDE drive, so roughly what you have. Extrapolated out that would take about 100 megs to store the whole parsed log using your rlog. You should be ok on your machine as long as you have some virtual memory to pick up the slack. -- Michael G. Schwern

Re: Metaprogramming

2002-12-12 Thread Michael G Schwern
any subroutine. So that covers altering code inside subroutines at run time. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One The key, my friend, is hash browns. http://www.goats.com

Re: [OT] t/badfile....FAILED test 3

2003-07-14 Thread Michael G Schwern
On Mon, Jul 14, 2003 at 01:10:59PM -0700, Tim Dolezal wrote: #!/usr/bin/perl -w my $line; open(BAR, no-existing-file.$$) || die; eval { $line = BAR or die; }; print STDERR $@\n; close(BAR); unlink(no-existing-file.$$); On my machine (perl 5.8.0, Red Hat 9.0 on x86), this results in

Re: I know this is not fun.

2003-07-16 Thread Michael G Schwern
On Tue, Jul 15, 2003 at 10:43:18PM -0500, Harley D. Eades III wrote: I have been following this mailing list for some time. I notice there are a lot of people here that are vary knowledgable in perl so I have a little question to ask. when running `ld -lperl` I end up with an error

Re: Need to hack my own machine ! Help !

2003-08-14 Thread Michael G Schwern
home and I don't have the access to the console... I think you have the wrong group. This is Fun With Perl. [EMAIL PROTECTED] M1 b0x is better asked about somewhere else. Perhaps you could call a friend and ask them to go to your house and sit at the console? -- Michael G Schwern

Re: TRUE

2004-01-22 Thread Michael G Schwern
. -- Michael G Schwern[EMAIL PROTECTED] http://www.pobox.com/~schwern/

Re: TRUE

2004-02-07 Thread Michael G Schwern
, is it? if (returns_a_true_value () xor FALSE) { print It returned true.\n; } I myself prefer: print It returned true\n if !!returns_a_true_value() == TRUE !! is the convert to boolean operator. :) -- Michael G Schwern[EMAIL PROTECTED] http://www.pobox.com/~schwern/ Monkey tennis

Table of Perl 5 Operators

2005-05-17 Thread Michael G Schwern
operators we get 153 for Perl 6 and 123 for Perl 5 and things start to look more sane. -- Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern ROCKS FALL! EVERYONE DIES! http://www.somethingpositive.net/sp05032002.shtml

Re: Table of Perl 5 Operators

2005-05-18 Thread Michael G Schwern
Excellent, thank you. I've got a little web app nearly finished which will catalog all this and allow it to be modified and corrected. -- Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern You are wicked and wrong to have broken inside and peeked at the implementation

Re: Error puzzler

2006-09-15 Thread Michael G Schwern
John Douglas Porter wrote: Peter Scott [EMAIL PROTECTED] wrote: The documentation is clear that doesn't localize $_. Why not? Just so that if someone wanted to get at the last value after the loop they could do it without an extra variable? With all this talk of local $_, I feel

Re: bad code to good golf

2007-12-09 Thread Michael G Schwern
A. Pagaltzis wrote: * Uri Guttman [EMAIL PROTECTED] [2007-12-09 19:25]: i don't like using shift for args if i can help it. Personally I *always* use `shift` for the invocant, but assignment from [EMAIL PROTECTED] for all other parameters in all but a few rare circumstances. So methods in

Re: bad code to good golf

2007-12-09 Thread Michael G Schwern
Uri Guttman wrote: is there any guarantee of evaluation order in arg lists? will the bless/splice always be executed before the pop? I believe it is undefined, so it's not recommended that you do anything order dependent in the argument list. But it is stable. As implemented, complex

Re: regex of the month (decade?)

2008-01-13 Thread Michael G Schwern
Yanick Champoux wrote: 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 occasion too. Is that because it's

Re: Name the secret operator

2008-03-20 Thread Michael G Schwern
Philippe Bruhat (BooK) wrote: Hi, while doing some research for a talk on Perl secret operators, I tried to find who first coined the term secret operator. I found a post from Greg Allen on February 2004 on this very list (http://groups.google.com/group/perl.fwp/msg/e62668a760de1652), and then

Re: Interpolated code blocks may not create lexicals

2008-09-26 Thread Michael G Schwern
David Nicol wrote: the fun with perl mailing list doesn't still exist, does it? Yes, yes it does. It's just pining for the fjords. -- Clutter and overload are not an attribute of information, they are failures of design -- Edward Tufte