Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 studying the Monastery: (8)
As of 2014-09-23 20:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (241 votes), past polls