Wampa has asked for the wisdom of the Perl Monks concerning the following question:
I have this code Input is /something/something/index.html
[- $script = $ENV{SCRIPT_NAME} -] [- @fields = split("/",$script) -] [+ $fields[3] +]<br /> [- $script = $fields[3] -] [+ $script +]<br />
Result is index.html And now I need split index.html on index and html but code below dont give me this result.
[- @field = split(".",$script) -] [+ @field +] [+ $field[0] +]<br /> [+ $field[1] +]<br /> [+ $field[2] +]<br />
where is problem ???
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with Split function
by davorg (Chancellor) on Jul 28, 2004 at 08:56 UTC | |
by Wampa (Hermit) on Jul 28, 2004 at 09:14 UTC |