I just thought I'd let you know there is an error in this example code.
@simpsons=split(/\s+/ $line); #now splits $line on 1 or more whitespac
#@simpsons now containts ("Bart","Lisa","Maggie","Marge","Homer");
You are missing a comma (/\s+/,$line). On a seperate note does anyone know how I would join an array with a comman except for the last value.
ie I have an array of postcodes, that I am going to print out as a string.
print "any area. postcode1, postcode2, postcode3\n";
What I would like to print out is this.
print "any area. postcode1, postcode2 & postcode3\n";
Any help would be great...
Edit: g0n - code tags & formatting
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||