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

Re: [MacPerl] Unexpected behaviour with hashes




First, is there a legitimate reason to use the now depricated 
"StandardFile.pl" rather than Mac::StandardFile ?  Remember 
"StandardFile.pl" exists for the porpises of backward compatilbility.  
Mac::StandardFile would be more current.  This probably isn't the source 
of your trouble, however.

Look for the usual suspects. You've merged two routines. You know they 
worked seperately. Do they have variable names in common?  Could you 
implement them as seperate packages to avoid such conflicts?  Hope this 
helps.

And now, rather than solve your problem, I'm going to rant about style:

> #slect the input file and create an output file
> $file= &StandardFile::GetFile("what file do you want", "TEXT");
> if ($file) {
> 	open (IN, $file)|| die "hmm, now that's odd......:- $!" ;
>    } else {
> 	print".... and next time think before you start clicking on stuff!\n";
> 	die "user killed script\n";
>     }

ROFL! Don't be so silly! ;-)

"I really think you ought to take a stress pill..." --HAL 9000

Hmm, not good interface design, blaming the user for clicking "Cancel." 
;-)  Quite frankly, there are lots of times when the end user needs to be 
able to kill the current process (like when the computer goes insane and 
starts killing the crew). One shouldn't have to walk straight to the 
central databank with a very large axe either.  Good interface design is 
to have the machine appear polite and comforting even as it's killing the 
crew!  That way your programs can shamelessly wreck havoc and mayhem, 
while your users applaud, even as they get killed by your code.

Also $^E is generally more informative than $!.  <-- my sole useful 
contribution

Cute but useless error messages really get my goat.

Sorry to break of in a rant like that. 

--B

# Fungal Parataxonomy                   Mycology Information (Mycoinfo)
# Webmaster, Staff Writer      **The World's First Mycology E-Journal**   
# <mailto:webmaster@mycoinfo.com>            <http://www.mycoinfo.com/> 
#
# First they ignore you. Then they laugh at you. Then they fight you.
# Then you win.                                     --Mohandas Gandhi


===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org