Item1079: Create foswiki2twiki
Priority: Normal
Current State: Closed
Released In:
Target Release:
Some of us are still cursed with having to support TWiki for clients. Because I find development easier in Foswiki, I prefer to have my extensions in that namespace; but I also need to be able to convert back to TWiki.
I have a script derived from twiki2foswiki that does the job - ish. It makes a copy of the relevant Foswiki files, converts them but does not add them to subversion. The intent is that the script should be useable as a build step e.g.
perl build.pl twiki
.
--
CrawfordCurrie - 14 Feb 2009
Done as a
BuildContrib feature.
--
CrawfordCurrie - 15 Feb 2009
The fix in
distro:7f6d173df819 bothered me, thus I looked into it. In fact the problem is that:
my $text = $this->$sub(<$fh>);
will evaluate the angle operator in list context, whereas
my $text = <$fh>;
will evaluate in scalar context.
The huge difference here is that in list context, undef is undef, whereas it's "" in scalar context.
Therefore, if you want to avoid using a temporary variable, use
scalar()
:
my $text = $this->$sub(scalar(<$fh>));
So if the file in $fh is empty, it will return undef (as it's eof()), and it will break.
Maybe the root cause of the issue is that the file shouldn't be empty?
The empty files are:
TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/inlinepopups/readme.txt
core/data/_empty/WebPreferences.txt
--
OlivierRaginel - 23 Feb 2009