On May 31, 2004, at 4:13 PM, Ian Ferguson wrote:
I program AppleScript as well. In fact, this is what introduced me to Perl
and Ruby. Since Perl can handle many of the things I need faster and more
efficiently, I started digging into Perl to do things like sort arrays, etc.
In AppleScript, If I have a script and I need to call on a shell script to
run with specific parameters, I have to issue a "quoted form of ..." to make
sure that the argumetn is quoted to prevent the shell from seeing various
arguments as you noted. This is what led me to ask the question regarding
quoting.
The key difference here is that AppleScript is calling the shell to perform its actions, whereas Perl is calling native system routines. So no protection from the shell is necessary.
I asked a question about quoting an argument prior to removing a directory
to learn something about how the language handles things. I don't know if
the rmdir method is recursive and/or forced in Perl.. Telling me to try and
see is a BS answer to give. Of course I could create a directory and try,
but what is the need for a community of "experts" if I can't ask a "simple"
question?
Well, in Perl there's more of a culture that tries things - just because it's so much easier to write one-off simple Perl programs than one-off Java or C or AppleScript or whatever. So I suspect Ricardo, in his terse way, had that in mind.
However, using the "try it and see" approach can get you in trouble too, since people should really rely on the documentation (and a real understanding thereof) to achieve true enlightenment.
Also... Read perldoc this and that... Most people new to a language will
have no clue what you are talking about. Keep this in mind for the future.
Do you tell a person who can't drive standard ... "Hey it's a car. Just
drive it!"? Of course not.
Right, but I don't think you're going to run over any little old ladies with a test perl script. ;-)
-Ken
