I'm trying to fill @files with:
#$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'
here's the code:
$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/";
Splitting works fine
@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


In reply to precedence: two functions on one line by kingman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.