Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucsd!usc!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!alberta!oha!tony From: tony@oha.UUCP (Tony Olekshy) Newsgroups: comp.lang.perl Subject: Re: Looking for balanced critique of Perl Message-ID: <437@oha.UUCP> Date: 28 Jun 90 10:55:47 GMT References: <4811@muffin.cme.nist.gov> Organization: Olekshy Hoover & Associates Ltd., Edmonton, Alberta, Canada. Lines: 36 In-Reply-To: Message dated 26 Jun 90 05:37:18 GMT In , stef@zweig.sun (Stephane Payrard) writes: - - Perl is becoming one of my favorite tools. - Today, I will discuss some of its limitations. - - ... more precisely, Perl so far - 1/ has no clean way of: allocating, deallocating, - accessing data in memory (ie: no pointer) Optimizations left as an exercise to the reader: $Memory{&UniqueKey($datum)} = $datum; push(@Pointers, &UniqueKey($datum)); Stop thinking so low level; that's not what perl is for (IMHO)... $C = "-?\\d+\\.?\\d*"; # Coordinate. $P = "p:($C):($C):"; # Point. $L = "l:($P)($P)b:($C):"; # Line. $S = "s:(($L)+)"; # Line String. sub GetLines # Return list of spatial lines in $Polygon. { local($Polygon) = $_[0]; local(@Out); die "Bad Polygon" unless $Polygon =~ s/^$S$/\1/; while ($Polygon =~ s/^($L)//) { push(@Out, $1); } return (@Out); } Now that's a data structure (and don't laugh, it works, with a GKS child, and makes a great prototyping workbench -- so there ;-). -- Yours etc., Tony Olekshy. Internet: tony%oha@CS.UAlberta.CA BITNET: tony%oha@UALTAMTS.BITNET uucp: alberta!oha!tony