in reply to dumb split question
#!/usr/bin/perl -w use strict; my $text="blah blah\nblah\nblah\nblah\nblah\nyadda yadda yadda\n"; my @lines=split /\n/, $text; #replace with split(/\n/,$text); at will print "This: $_\n" for @lines;
UPDATE: Minor cosmetic change at tach's suggestion-----BEGIN GEEK CODE BLOCK----- Version: 3.1 GPA/P/S d+ s++:+ a--- C++ UL++ P++>++++ L++ E W++ N o? K? w-- !O M- V? + PS++ PE- Y PGP- t 5- X+ R* tv-- b++ !DI D---(+) G e- h-- r++ y? ------END GEEK CODE BLOCK-----
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: dumb split question
by tachyon (Chancellor) on Mar 24, 2003 at 00:59 UTC |