Nik has asked for the wisdom of the Perl Monks concerning the following question:
I want the arrray @files = <../data/texts/*.txt>; who gives filanes like this ../data/texts/file1.txt to conever its values to file, file2,file3 and so on. to remove the path and the .ext that is.@files = <../data/texts/*.txt>; print start_form(-action=>"index.pl"); print p( {-align=>'center'}, font( {-size=>5, -color=>'Lime'}, 'Λόγ +ος Ψυχωφελής και Θαυμάσιος ---> ' ), popup_menu( -name=>'choice', -values=> +\@files ), submit('ok')); print end_form(), br(); if ( $file = param("choice") ) { open(FH, "$file") or die $!; @data = <FH>; close(FH); $data = join("", @data); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array values reformation
by LassiLantar (Monk) on Jul 24, 2004 at 19:57 UTC | |
| |
|
Re: Array values reformation
by blue_cowdawg (Monsignor) on Jul 25, 2004 at 01:46 UTC | |
| |
|
Re: Array values reformation
by ccn (Vicar) on Jul 24, 2004 at 19:55 UTC | |
| |
|
Re: Array values reformation
by Joost (Canon) on Jul 26, 2004 at 13:54 UTC | |
|