[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Perl questions



Two things:

(1) I have tried using the BBEdit extension "run perl" with BBEdit Lite
3.5. It seems to work quite happily, but I have experienced a couple of
problems with it. I wonder if anyone can tell me how to work round the
following:

(a) using "run perl" buffers all the output sent to STDOUT by a script, so
that it all appears in a new BBEdit window at the end. This is a nuisance
if you're printing progress information as the script executes. Running the
script from MacPerl itself doesn't do this.

(b) if my script uses a dialog routine such as MacPerl'Answer, the dialog
window anchors itself at the back of all other windows on the screen.  In
particular, if it happens to park itself wholly behind another window the
script is as good as hung, as I can't get the machine to let me access the
dialog window! My only option seems to be option-cmd-esc at this point. Yes
I could run the thing on a clear desktop, but running the script from
MacPerl itself sensibly puts dialog windows to the front.

(2) I have experienced problems when single stepping in the Perl debugger.
Lines like:

foreach $member_id (sort { $a <=> $b} keys %member_data)

will not execute in this mode. Run through without the debugger they work
fine. In the debugger I get the message:

"sort subroutine did not return single value"

plus a line number. The script then aborts.  Please could someone enlighten
me as to what this means? My sort subroutine here is the standard integer
ascending sort recipe, which I reckon should return -1, 0 or 1. I can't see
how it can return more!? My data is pretty mundane - the hash array
contains about 300 values; the keys themselves are perfectly valid integers
in the range 1-350 as far as I can see.

I am using MacPerl 5.0.7r1m on a Mac LCIII, for what it's worth.

Thanks for any help you can give,

David Herbert.




----- End Included Message -----