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

[MacPerl] obscure bug in MacPerl application



I just found a, IMHO, rather obscure bug in the MacPerl application
(5.2.0r4 PPC).

Run the following simplistic apple script from the scripteditor. Data
organization may seem weird (for reasons of the genesis of the original
script), and it does nothing more than make macPerl print @ARGV. You may
change "path to system folder as text" to any pathname of an *existing*
folder.

-------start apple script--------
property script1 : "print \"@ARGV\\n\""

property subfolders : {"main:", "rest:"}
property containerFolder : {path to system folder as text}

on perlDownload(perlScript, opts)
	tell application "MacPerl"
		activate
		with timeout of 20 * 60 seconds
			--display dialog (Any2Str {perlScript as Text} & opts)
			log {perlScript as Text} & opts
			Do Script ({perlScript as Text} & opts)
		end timeout
	end tell
	return
end perlDownload

perlDownload(script1, containerFolder & subfolders)
-------start apple script--------

If you take a look at the Skripteditor's event log, you'll see that
arguments get passed quite properly, in my case:

(*print "@ARGV\n", Macintosh HD:Systemordner:, main:, rest:*)

Output from Capture AE is:

Process("MacPerl").SendAE "misc,dosc,'----':[Òprint "@ARGV\n"Ó, ÒMacintosh
HD:Systemordner:Ó, Òmain:Ó, Òrest:Ó], &subj:'null'()"

Everything is OK.

Now look at what MacPerl prints:

Extra HD:Download main: rest:

Note that the colon behind Extra HD:Download is missing.

In the script above change the line

property containerFolder : {path to system folder as text}

to a pathname of a non-existant disk or folder, like

property containerFolder : {"grumbl HD:"}

The ouput is, lo' and behold:
grumbl HD: main: rest:
Note the colon behind grumbl HD.

Certainly, this is not expected behavior.
Matthias?

Peter




Peter Hartmann
Visiting Scholar
Ritsumeikan University, Kyoto, Japan
e-mail:
hartmann@mbox.kyoto-inet.or.jp (preferred)
phv00542@askic.kic.ritsumei.ac.jp




***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch