On Thu, Jun 18, 2009 at 03:14, Irfan Sayed<irfan_sayed2...@yahoo.com> wrote:
> Hi All,
>
> I am stuck on parsing file name if it has space.
> I have file name as : file system.proj
> now this file contains space between worf file and system
>
> now i want to do ceratin operation on this file
> but whenever i give this file name in any command then it fails saying that 
> file does not exist. it is only considering file word and not the whle file 
> name.
>
> i dont know how to handle this sitiuation . i tried applying double quotes to 
> file name but no luck.
>
> here is my actual code:
>
> $vd="file system.proj";
>  $svn = "svn delete $vd";
>     if (system($svn)) {
>   print "Deletion of vdproj file failed\n";
>   exit 1;
>    }
>
> plz advide
>
> Regards
> Irf
>
>
>

This is one of the reasons to not use the single argument version of
system, exec, etc.  What you need to say is

if (system "svn", "delete", $vd) {

You could also say

if (system "svn delete '$vd'") {

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to