in reply to space in filepath and in filename for system function

You probably want to use the multiple argument system :

system ('adrl.exe','d:\anniyan\file mod\chapter 1.doc');
With the single argument your file name will be broken up on white space and passed to the program as multiple arguments.

/J\

Replies are listed 'Best First'.
Re^2: space in filepath and in filename for system function
by anonymized user 468275 (Curate) on Aug 04, 2005 at 10:53 UTC
    re. With the single argument your file name will be broken up on white space and passed to the program as multiple arguments.

    I expected this to be the case, but before posting a similar reply to yours I went and tested it with two tests (because the OP is using DOS -- I speak unix, which would not accept this and I normally only speak DOS under duress, usually in the form of extra money ;)):

    cd I AM AN EXISTING DIR

    type I AM AN EXISTING FILE

    The DOS session (under windows NT) managed to perform these correctly and as single arguments rather than trying to access a list of files.

    One world, one people

Re^2: space in filepath and in filename for system function
by anniyan (Monk) on Aug 04, 2005 at 10:24 UTC

    Thanks for your reply.

    I have stored that path in a variable $file.

    It is passing the variable name itself as a argument.

    system ('adrl.exe', '$file') || die ("not correct path");

    Regards,
    Anniyan
    (CREATED in HELL by DEVIL to s|EVILS|GOODS|g in WORLD)

      Well yes. It would. If you put it in a single-quoted string. Variables aren't expanded in single-quoted strings. You need a double-quoted string. Or, actually, you don't need any quotes at all.

      system ('adrl.exe', $file) || die ("not correct path");
      --
      <http://www.dave.org.uk>

      "The first rule of Perl club is you do not talk about Perl club."
      -- Chip Salzenberg