http://www.perlmonks.org?node_id=1013968


in reply to How to create GUI for a perl script on MAC?/Apple Script and Perl?

If you can persuade the Wx module to install on your system (WxWidgets does work on Mac, so it should theoretically, and according to the CPAN testers service there are successful install reports from Mac OS X), then you could investigate my Ask module. It's as simple as:

use Ask qw( file_selection info ); my $file = file_selection("Please choose a file!"); info("You chose: $file");

Then Ask does the rest. If the user has run your script through the Mac terminal, Ask should detect this, and to input and output via the terminal. If they've launched your script by, say, double clicking it in Finder, it will notice there's no terminal and interact with the user via dialog boxes.

I do keep meaning to write a blogs.perl.org post about Ask.

Update: blog post written... Ask not what your user can do for you...

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'