Help for this page
$line="Bart Lisa Maggie Marge Homer"; @simpsons=split(/\s/, $line); #splits $line and uses a piece of whites +pace as a delimiter. ... @simpsons=split(/\s+/ $line); #now splits $line on 1 or more whitespac +e characters #@simpsons now containts ("Bart","Lisa","Maggie","Marge","Homer");
open FILE, "data.txt"; while(<FILE>) ... print "Address: $address\n\n"; } close FILE;
$string=join(" ",@simpsons); #string now equals "Bart Lisa Maggie Marge Homer"; ... $address="42 Tulip Lane, Holland MI, 49423"; $string=join("|",$name,$phone,$address); #$string is now equal to "Bob|555-5555|42 Tulip Lane, Holland MI, 4942 +3"
www.com | www.net | www.org
No recent polls found