in reply to Tk getOpenFile, can't get -initialdir to work

Works just fine for me, but the path name appears to require backslashes. And remember that backslashes are special, and thus require escaping, in double-quoted strings.

perl -MTk -e "MainWindow->new->getOpenFile( -initialdir => qq(c:\\prog +ram files) )"
A word spoken in Mind will reach its own level, in the objective world, by its own weight

Replies are listed 'Best First'.
Re^2: Tk getOpenFile, can't get -initialdir to work
by mifflin (Curate) on Apr 04, 2008 at 17:46 UTC
    I was taking my input from the chooseDirectory widget.
    chooseDirectory always uses forward slashes on xp.
    Passing its response through File::Spec->canonpath seems to do the trick.
    thanks.