in reply to Creating filenames
What you're doing wrong is assuming that all titles are going to have 12 words. Instead, try this:
@words = split / /, $titleclean; $filename = "$year-$mon-" . join("-",@words) . ".html";
The join bit in the middle tells perl to string @words together with a dash between each one.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating filenames
by JavaFan (Canon) on Apr 02, 2012 at 20:51 UTC | |
by roboticus (Chancellor) on Apr 02, 2012 at 23:15 UTC | |
|
Re^2: Creating filenames
by ww (Archbishop) on Apr 02, 2012 at 20:04 UTC | |
|
Re^2: Creating filenames
by htmanning (Friar) on Apr 02, 2012 at 20:19 UTC | |
by ww (Archbishop) on Apr 02, 2012 at 20:23 UTC | |
by htmanning (Friar) on Apr 02, 2012 at 20:51 UTC |