Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'small improvements on improvements-BUG' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
small improvements on improvements-BUG
Authored by: Krioni on Oct 22, '02 04:12:41PM

Um, neat trick!

But, a few things are broken:

First, $0 holds the whole path - you'll need to get just the filename part.

<pre>
my %commands = {
# map the name of the script ($0) to the name of the application to run
"pb" => "/Developer/Applications/Project Builder.app",
"te" => "/Applications/TextEdit.app",
# as many as you want
};

if (!defined($comamnds{$0})) {

# typo there - should be commands
</pre>



[ Reply to This | # ]