Dear Anonymous Monk

Thanks a mil for your help.

I used your code to check and found out that umlauts were the culprits

I created a test folder with test file and ran the code. To my surprise I got new error messages (cf. list below), which have not yet appeared... As you can imagine, the source files remained untouched and no back-up files were created

Use of uninitialized value $dst in rename at C:/strawberry/perl/site/l +ib/Path/Tiny.pm line 1004. Path::Tiny::move(Path::Tiny=ARRAY(0x267ea6c), undef) called at hor +nbach_entities_20140902.pl line 68 main::Replace(Path::Tiny=ARRAY(0x267ea6c), "T:/2014/F.../C.../a.xm +l-2014-09-03.bak") called at script.pl line 59 main::RetrieveAndBackupXML("t:/F.../C.../\") called at script.pl l +ine 29 main::Main() called at script.pl line 18 Use of uninitialized value $dst in concatenation (.) or string at C:/s +trawberry/perl/site/lib/Path/Tiny.pm line 1004. Path::Tiny::move(Path::Tiny=ARRAY(0x267ea6c), undef) called at scr +ipt.pl line 68 main::Replace(Path::Tiny=ARRAY(0x267ea6c), "T://F.../C.../a.xml-20 +14-09-03.bak") called at hornbach_entities_20140902.pl line 59 main::RetrieveAndBackupXML("t:\\2014\\F...\\C...\\") called at hor +nbach_entities_20140902.pl line 29 main::Main() called at hornbach_entities_20140902.pl line 18 Error rename on 'T:/2014/F.../C...//a.xml' -> ''': at C:/strawberry/p +erl/site/lib/Path/Tiny.pm line 1490. Path::Tiny::Error::throw("Path::Tiny::Error", "rename", "T::/2014/ +F.../C.../a.xml' -> ''", "") called at C:/strawberry/perl/site/lib/Pa +th/Tiny.pm line 126 Path::Tiny::_throw(Path::Tiny=ARRAY(0x267ea6c), "rename", "T:/2014 +/F.../C.../a.xml' -> ''") called at C:/strawberry/perl/site/lib/Path/ +Tiny.pm line 1004 Path::Tiny::move(Path::Tiny=ARRAY(0x267ea6c), undef) called at scr +ipt.pl line 68 main::Replace(Path::Tiny=ARRAY(0x267ea6c)...[...]

I seem unable to figure what the exact meaning of the error is, I reckon it must be something in the xml-files,

I am really sorry for all these questions, however it is a good way to learn things.

Thanks a mil for your support

Kind regards

C.


In reply to Re^18: search and replace strings in different files in a directory by PitifulProgrammer
in thread search and replace strings in different files in a directory by PitifulProgrammer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.