kingman has asked for the wisdom of the Perl Monks concerning the following question:
here's the code:#$files[0] = '/usr/local/bin/foobar/a.html' #$files[1] = '/usr/local/bin/foobar/b.html' #$files[2] = '/usr/local/bin/foobar/c.html' #$files[3] = '/usr/local/bin/foobar/d.html' #$files[4] = '/usr/local/bin/foobar/e.html' #$files[5] = '/usr/local/bin/foobar/f.html'
Splitting works fine$tracker = <<EOQ; a.html<br> b.html<br> c.html<br> d.html<br> e.html<br> f.html<br> EOQ $path = "/usr/local/bin/foobar/";
@ttt = split /<br>\n/, $tracker; for (@ttt) { print "$_\n"; }
My Question:
Should I be trying to do this by splitting and joining at once or is it better to do it in two separate calls? I guess I need to parenthesize things?
p220 of the Camel book 2nd ed. has this line:
print join ':', split / */, 'hi there';
Can I do something similar?
This part doesn't work yet:@files = join split /<br>\n/, $tracker, $path; foreach (@files) { print "$_\n" }
Thanks!
Edit ar0n 2001-07-27 -- fixed formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: precedence: two functions on one line
by bwana147 (Pilgrim) on Jul 27, 2001 at 18:38 UTC | |
by kingman (Scribe) on Jul 27, 2001 at 18:59 UTC | |
by andye (Curate) on Jul 27, 2001 at 19:14 UTC | |
|
Re: precedence: two functions on one line
by earthboundmisfit (Chaplain) on Jul 27, 2001 at 18:38 UTC | |
|
Re: precedence: two functions on one line
by iakobski (Pilgrim) on Jul 27, 2001 at 18:38 UTC | |
by kingman (Scribe) on Jul 27, 2001 at 18:45 UTC | |
|
Re: precedence: two functions on one line
by runrig (Abbot) on Jul 27, 2001 at 18:55 UTC |