On Jan 3, 2006, at 7:16 AM, James Harvard wrote:

I'm building a script that uses a sub-routine for user-interaction:

if ( &ask('Do you want to do this?') ) {
        # do stuff
}

In addition to the points other folks have made, I should point out that using & to call subroutines is a bad idea, unless you know exactly what it does and you really want to do that. The normal "best practice" way to write the above would be:

        if ( ask('Do you want to do this?') ) {
                # do stuff
        }

For details, have a look at "perldoc perlsub", especially the "Prototypes" section.

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

Reply via email to