Windows Perl Scripting Forums » Perl

Can anyone help me in debugging this Perl Code.

(1 post)
  • Started 6 years ago by

  1. Anonymous

    Hi all,

    I'm a beginner in perl and this is my code.

    #!C:/Perl
    $var="C:\Program Files\test\test2";
    @var1=split (/\\/ , $var);
    print "$var1[0] \n";

    The output should be:
    C:
    But i receive C:Program Filestesttest2 as output. So anyone can help me to spilt and show only C: as output.

    Posted 6 years ago #

RSS feed for this topic

Reply

You must log in to post.