Nik has asked for the wisdom of the Perl Monks concerning the following question:
I just need a way to put the names of every single file as a button.@files = <../data/texts/*.txt>; $file = $files[int(rand(@files))]; open(IN, "<$file") or die $!; @data = <IN>; close(IN); $data = join("", @data); $data =~ s/\n/\\n/g; print table( {-width=>"90%", -align=>"center", -style=>"border: ridge +lightgreen; color: yellow; font-size: 18", -background=>"../data/imag +es/blue.jpg"}, foreach(@files) { Tr( td( {-align=>'center'}, font( {-size=>5, -color=>'white'}, b +( $file ))))); Tr( {-align=>'center'}, td( submit( $file ))))); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: foreach inside print
by Abigail-II (Bishop) on May 18, 2004 at 11:54 UTC | |
|
Re: foreach inside print
by ysth (Canon) on May 18, 2004 at 11:58 UTC | |
by Abigail-II (Bishop) on May 18, 2004 at 13:27 UTC | |
by ysth (Canon) on May 18, 2004 at 15:55 UTC | |
by Abigail-II (Bishop) on May 18, 2004 at 16:03 UTC | |
|
Re: foreach inside print
by inman (Curate) on May 18, 2004 at 11:45 UTC | |
|
Re: foreach inside print
by pbeckingham (Parson) on May 18, 2004 at 11:59 UTC | |
by Nik (Initiate) on May 18, 2004 at 12:22 UTC | |
by pbeckingham (Parson) on May 18, 2004 at 13:41 UTC | |
| |
|
Re: foreach inside print
by eserte (Deacon) on May 18, 2004 at 11:58 UTC |