http://www.perlmonks.org?node_id=866092

renegadex has asked for the wisdom of the Perl Monks concerning the following question:

i have this code inside a perl script.
system('gvfs-mount smb://192.168.1.108/public');
if i open a gnome-terminal and run my script there, the network share is mounted on my computer. but if i change the permission of the script into 'allow executing file as a program' and double clicked on the script and select run. i doesnt mount the network share. the same happens when i create a desktop launcher(application). but if i create a desktop launcher(application in terminal) it mounts properly. what is happening? i need to run the script as an application and not an application in terminal.
Mabuhay Civil Engineers! :D

Replies are listed 'Best First'.
Re: perl system() interactive/noninteractive question
by ikegami (Patriarch) on Oct 19, 2010 at 03:00 UTC
    Sounds like gvfs-mount wants a terminal. I don't see what this has to do with Perl.
Re: perl system() interactive/noninteractive question
by Anonymous Monk on Oct 19, 2010 at 02:47 UTC
    When it fails to mount, what is the error message you get?
      hey thats funny, i was trying to figure out how to extract the error message, and was having no success. and i thought i might need to put the header line
      #!/usr/bin/perl -w
      to enable warnings and my script can now mount! wow i think problem is solved! tnx for the reply!
      Mabuhay Civil Engineers! :D
        Aha, the old shebang quandry
Re: perl system() interactive/noninteractive question
by ahmad (Hermit) on Oct 19, 2010 at 22:51 UTC

    Try specifying the full path of the command gvfs-mount command, and make sure you have all the required environment variables set in your perl script.