hypergrid has asked for the wisdom of the Perl Monks concerning the following question:
sample/fresh/fresh/0/pineapple
my $element = sample/fresh/fresh/0/pineapple; my $word = $element; while (<>) { foreach $word (m/(\w+)/g) { # parse the line and retrieve the last element. $element = $word; #I'd like to display the $element in a message box here t +o see the result here. } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parse a line
by mpeters (Chaplain) on Dec 10, 2004 at 15:07 UTC | |
by hypergrid (Initiate) on Dec 10, 2004 at 15:16 UTC | |
|
Re: Parse a line
by phenom (Chaplain) on Dec 10, 2004 at 15:02 UTC | |
|
Re: Parse a line
by holli (Abbot) on Dec 10, 2004 at 17:00 UTC | |
|
Re: Parse a line
by Fletch (Bishop) on Dec 10, 2004 at 15:09 UTC | |
by gaal (Parson) on Dec 10, 2004 at 15:14 UTC | |
|
Re: Parse a line
by Your Mother (Archbishop) on Dec 11, 2004 at 00:42 UTC |