Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!ll-xn!ames!elroy!mahendo!wlbr!scgvaxd!hacgate!luna!mkp From: mkp@luna.UUCP (Michael Peterson) Newsgroups: comp.sources.bugs Subject: Re: Making perl 2.0 core dump Message-ID: <127@luna.UUCP> Date: 14 Aug 88 20:36:20 GMT References: <6670@bloom-beacon.MIT.EDU> Reply-To: mkp@hac2arpa.hac.com (Michael Peterson) Organization: Hughes Aircraft Co., El Segundo, CA Lines: 51 In article <6670@bloom-beacon.MIT.EDU> tytso@athena.mit.edu (Theodore Y. Ts'o) writes: >I'm running perl 2.0 at patchlevel 13, and the following perl script >causes it to core dump on a Vax.... [Original script... ] Here's a script that works. -------------------8<-------------------8<---------------------------------- #! /usr/bin/perl # test case. @foo = (4, 6, 3, 17); do Bargraph("foo", 0, $#foo, 1, 0, 20, 1, @foo); # # This subroutine does bar graphs.... # Usage is as follows: # # do Bargraph($title, $x_min, $x_max, $x_step, # $y_min, $y_max, $y_step, @data) sub Bargraph { local($x, $y); local($title = shift(@_)); local($x_min = shift(@_)); local($x_max = shift(@_)); local($x_step = shift(@_)); local($y_min = shift(@_)); local($y_max = shift(@_)); local($y_step = shift(@_)); local(@data = @_); for ($y = $y_max; $y >= $y_min; $y -= $y_step) { for ($x = $x_min; $x <= $x_max; $x += $x_step) { $c = ($data[$x] <= ($y - 1)) ? " " : "#"; print "$c"; } printf(" %2d\n", $y); } } -- Michael K. Peterson Internet: mkp@hac2arpa.hac.com Space & Communications Group UUCP: ....!{scgvaxd,hacgate.hac.com}!mkp Hughes Aircraft Company 213 416-0323