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


in reply to Open txt file using default program on Windows

Why didn't you show the command that fails? You're leaving us guessing.

You might have stumbled into a problem resulting from start's weird syntax which can be addressed as follows:

my $doc = ...; system(qq{start "" "$doc"});

Replies are listed 'Best First'.
Re^2: Open txt file using default program on Windows
by tanyeun (Sexton) on Jun 03, 2013 at 18:36 UTC
    Thanks guys for the reply

    When I am debugging programs at work, I need to do the following very often:
    1. cat the kernel log
    2. save it to a file
    3. open file and search for possible failures

    So I wrote this small program to do the above 3 steps with one button click via TK
    I put this program in a network drive in the lab where IT set it up that can be accessed by everybody on their own machines.

    I can't really show the error message here because I can't reproduce it on my machines or any of the machines in my lab.
    As I remembered that I couldn't open the text file on others' machine and windows popped out warning message.