Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Problem with creating Files

by poj (Priest)
on Jul 25, 2014 at 10:18 UTC ( #1095025=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Problem with creating Files
in thread Problem with creating Files

I'm not sure I fully understand your problem but try this

#!perl use strict; # test for ('file1LAY.html','file1DFT.html','file2DFT.html'){ open OUT,'>',$_; createButtons(undef,$_); } sub createButtons{ my ($outfile,$filename) = @_; my %file=(); if ($filename =~ m/(.+)(?:LAY|DFT)\.html/){ for my $s ('LAY','DFT'){ $file{$s} = './'.$1.$s.'.html'; $file{$s} = '#' unless (-e $file{$s}); } } print qq! <a href="$file{'LAY'}" class="button_lay">Layout</a> <a href="$file{'DFT'}" class="button_dft">DfT</a>\n </div>\n!; }
poj


Comment on Re^3: Problem with creating Files
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1095025]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2015-07-29 02:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls