Hi Raphael, On Saturday 22 Jan 2011 11:03:28 raphael() wrote: > Hello, > > qmv.exe (from renameutils) lets you edit multiple filenames in a text > editor. > I cannot get it to work in cygwin 1.7x (gives fork + jump error ??). So I > tried to write it in Perl. > > qmv's format is simple > > filename-1 <empty space> filename_1_to_be_edited > filename 2 <empty space> filename_2_to_be_edited > filename_3 <empty space> filename_3_to_be_edited > > You edit the names and then it renames the files you have changed. Problem > I am having is how can I split the two file names by space > since file name itself might also have spaces in them. > > I tried something like this > > ( $OldFileName, $NewFileName ) = split /\s{5,}/; >
1. You should use my here so the variables will be declared the closest to their usage. 2. You shouldn't use "$_". 3. Please avoid CamelCase names. > It works but not always. When doesn't it work? Can you give a test case? Regards, Shlomi Fish > I also thought to use and alternate anchor like pipe or comma but it looks > ugly. > Beside qmv.exe uses space to separate file names Any help would be > appreciated. Thanks. -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ "The Human Hacking Field Guide" - http://shlom.in/hhfg Chuck Norris can make the statement "This statement is false" a true one. Please reply to list if it's a mailing list post - http://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/