in reply to Re^3: Problem with creating Files (maybe)
in thread Problem with creating Files

I cannot use JSON as we do not have web server. Everything has to be done locally. JSON-P unfourtanetly didnt work also, so I went for the HASH filling option.

if nothing else, I got too confused in everything. How sould the part if exist look like?

I understand why it needs a second run as in the first run, the first HTML's will always say that file does not exist, but later on, it will.

Sorry for my stupidness, but if you tell me what should I write, it'll save me.

 if(-e $filename){ print ....} else { ..?}

That's how I would do it. Can you please corect me?

Replies are listed 'Best First'.
Re^5: Problem with creating Files (maybe)
by Anonymous Monk on Jul 25, 2014 at 10:49 UTC

    Sorry for my stupidness, but if you tell me what should I write, it'll save me.

    Write more subs , debug small subs, write more subs ... easier to trace ... like this

    Once you get more of these you're realize you probably want to have createButtons return a string or array of strings so fillFile instead of using  createButtons( $outfile, $filename ); would use  print $outfile createButtons( $filename );