Re: Fileselection question



How do I do, so that I can get the name of the selected file OUTSIDE the 
open_file function, for instance in the MAIN function?

Create a variable outside the scope of the function, and set its value
inside the function

EG:

#!/usr/bin/perl

# snip

my $filename = '';

sub open_file {

        # stuff

        $filename = $fileselection->get_filename;
}

then other parts of the program can get the value of $filename as they
need it.

Seems pretty simple to me.

G.

-- 
Gavin Brown
e: gavin brown uk com
w: http://jodrell.net/
PGP/GPG key ID: 891D8FCA

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]