Pragmatic Perfomance
I'm interested in knowing the effects of certain Pragmas on run-time performance (not compile-time). Does use strict help or hurt performance or does it have no effect? Does use warnings slow things down? Does use bytes or use integer give us a boost? Thanks for any information you can give. James
Re: Pragmatic Perfomance
On Saturday, December 1, 2001, at 10:47 AM, James Edward Gray II wrote: I'm interested in knowing the effects of certain Pragmas on run-time performance (not compile-time). My experience has been with use diagnostics and I can only state with certainty that use diagnostics will require a significant amount of memory usage. So while it is great for figuring out what is wrong with your programs (it is a more verbose use warnings), it is best to turn it off once you start a production run of your program.
Re: DropScript
Fred - Thanks for the help. Now I can see the errors that the script is generating, but I'm still not sure how to access argv from my perl script. For example, if I want to assign the contents of argv to @some_array how do I do that? Tantalizingly, if i just write: code #!/usr/bin/perl -w use strict; open LOG, log.txt or die can't open the logfile $!; foreach my $file (@ARGV) { print LOG $file\n; } /code then I get (just) one of the files, but this leads me to believe that I don't need to create my own array. Any help is appreciated. Thanks! --Josh File names are passed via argv[]. I would suggest that you monitor the console log (run Console.app) while creating the droplet and see if there are any errors, and if none do the same while dropping files on the new droplet. Error reporting via the UI is nonexistant. Perhaps it's failing to set the executable bit on the script placed in the droplet or something. -Fred On Friday, November 30, 2001, at 11:43 AM, Joshua Kaufman wrote: How are the names of the dropped files passed to the script? For example, when I make the following script into a 'droplet' it silently fails to even create the log file. Are the file names not passed to @ARGV? are there permissions issues? --
Re: DropScript
At 4:25 PM -0600 12/1/01, Joshua Kaufman wrote: Thanks for the help. Now I can see the errors that the script is generating, but I'm still not sure how to access argv from my perl script. For example, if I want to assign the contents of argv to @some_array how do I do that? Tantalizingly, if i just write: code #!/usr/bin/perl -w use strict; open LOG, log.txt or die can't open the logfile $!; foreach my $file (@ARGV) { print LOG $file\n; } /code then I get (just) one of the files, but this leads me to believe that I don't need to create my own array. Any help is appreciated. @ARGV _is_ an array, and it can be copied to another array: @some_array = @ARGV; Just to check: are you dropping multiple files on the droplet in one 'drop', or are you dropping each file one at a time? If the latter, study the open() command; as written, each time your script is called, it writes over what was already there. Otherwise, what are the errors you see? Maybe there's a hint there. HTH 1; -- - Bruce __bruce_van_allen__santa_cruz_ca__
Re: DropScript
bruce- thanks for the response. i am dropping multiple files, but only one is being written to the log file. the problem is that i don't know how to access the list of arguments that is passed to the shell by the droplet (or how to pass that directly to perl). $* would work in a shell script, but i don't know how to get at that from perl. no errors are generated by the script below when i run it from the droplet. --josh At 4:25 PM -0600 12/1/01, Joshua Kaufman wrote: Thanks for the help. Now I can see the errors that the script is generating, but I'm still not sure how to access argv from my perl script. For example, if I want to assign the contents of argv to @some_array how do I do that? Tantalizingly, if i just write: code #!/usr/bin/perl -w use strict; open LOG, log.txt or die can't open the logfile $!; foreach my $file (@ARGV) { print LOG $file\n; } /code then I get (just) one of the files, but this leads me to believe that I don't need to create my own array. Any help is appreciated. @ARGV _is_ an array, and it can be copied to another array: @some_array = @ARGV; Just to check: are you dropping multiple files on the droplet in one 'drop', or are you dropping each file one at a time? If the latter, study the open() command; as written, each time your script is called, it writes over what was already there. Otherwise, what are the errors you see? Maybe there's a hint there. HTH 1; -- - Bruce __bruce_van_allen__santa_cruz_ca__ --