Perl for Win32

Discussion in 'Perl Misc' started by Armando Torres, Jul 4, 2003.

  1. I am learning Perl, and I have never programed before.
    I wrote a script that uses a Network path, but in the network path
    thee is a space, and it's not working; this is a sample:

    $PVCSDatabase = "\\\\PC\\Vault\\temp\\my folder";
    $SVRWEB = "C:/temp/eMitchell";
    print " --- Getting Source Code...\n";
    system("$PVCSClient get -pr$PVCSDatabase -a$SVRWEB -o -z -w
    /archives")

    It gives me an error becuse my folder.
    If someone can give some ideas, or the place to get some info.

    Thanks
     
    Armando Torres, Jul 4, 2003
    #1
    1. Advertising

  2. [ f'up set to comp.lang.perl.misc ]

    Also sprach Armando Torres:

    > I am learning Perl, and I have never programed before.
    > I wrote a script that uses a Network path, but in the network path
    > thee is a space, and it's not working; this is a sample:
    >
    > $PVCSDatabase = "\\\\PC\\Vault\\temp\\my folder";
    > $SVRWEB = "C:/temp/eMitchell";
    > print " --- Getting Source Code...\n";
    > system("$PVCSClient get -pr$PVCSDatabase -a$SVRWEB -o -z -w
    > /archives")
    >
    > It gives me an error becuse my folder.


    This is because you pass one large string to system() in which case the
    shell gets to see the command with the space in the path. You can use
    system either with a list:

    $PVCSDatabase = "\\\\PC\\Vault\\temp\\my folder";
    $SVRWEB = "C:/temp/eMitchell";

    my @args = "get", "-pr", $PVCSDatabase, "-a", $SVRWEB,
    "-o", "-z", "-w", "/archives";
    system($PVCSClient, @args);

    or turn the path into something the shell will understand manually:

    $PVCSDatabase = '\\\\PC\Vault\temp\"my folder"';

    Better use single quotes here because it saves you some escaping. The
    only thing that needs escaping then are the two backslashes of an UNC-path.

    Tassilo
    --
    $_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
    pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
    $_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
     
    Tassilo v. Parseval, Jul 4, 2003
    #2
    1. Advertising

  3. Armando Torres

    Mark Grimes Guest

    In article <>,
    says...
    > $PVCSDatabase = "\\\\PC\\Vault\\temp\\my folder";
    > system("$PVCSClient get -pr$PVCSDatabase -a$SVRWEB -o -z -w
    > /archives")


    You want the system command to see something like this once it is all
    evaluated:

    pvcsclient get -pr"\\PC\Vault\temp\my folder" -ac:/temp/eMitchell -o -z
    -w /archives

    So, try something like:

    system("$PVCSClient get -pr\"$PVCSDatabase\" -a$SVRWEB -o -z -w
    /archives")
     
    Mark Grimes, Jul 8, 2003
    #3
  4. Armando Torres

    Dan Ayers Guest

    There is a space in $PVCSDatabase - the shell won't like that.
    Try including quotes (\") in the string passed into the system() function

    Dan

    "Armando Torres" <> wrote in message
    news:...
    > I am learning Perl, and I have never programed before.
    > I wrote a script that uses a Network path, but in the network path
    > thee is a space, and it's not working; this is a sample:
    >
    > $PVCSDatabase = "\\\\PC\\Vault\\temp\\my folder";
    > $SVRWEB = "C:/temp/eMitchell";
    > print " --- Getting Source Code...\n";
    > system("$PVCSClient get -pr$PVCSDatabase -a$SVRWEB -o -z -w
    > /archives")
    >
    > It gives me an error becuse my folder.
    > If someone can give some ideas, or the place to get some info.
    >
    > Thanks
     
    Dan Ayers, Jul 14, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Lyman
    Replies:
    0
    Views:
    710
    Alex Lyman
    Mar 7, 2004
  2. Java and Swing
    Replies:
    1
    Views:
    708
    Chris Lambacher
    Oct 24, 2005
  3. Tim Golden
    Replies:
    0
    Views:
    463
    Tim Golden
    Oct 21, 2005
  4. rcmn
    Replies:
    1
    Views:
    377
    =?ISO-8859-1?Q?Michael_Str=F6der?=
    Nov 6, 2006
  5. Michael Edmonson

    Win32::SAPI4 question (Win32 events and Perl)

    Michael Edmonson, Feb 28, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    211
    Michael Edmonson
    Feb 28, 2004
Loading...

Share This Page