jriggs420 has asked for the wisdom of the Perl Monks concerning the following question:
___INPUT____ 1. This string can be modified using only regexes -These strings -Need to be -put into an -array 2.Here's another string needs only regexes -But here are more -strings which -I want arrayedso on and so forth...my code thus far,
Also, I need the array to be 'refreshed' after each iteration(?)/string which doesn't need to arrayed. Sorry if this is too confusing, but I myself am confused now. Also, I know that each input string will be only one line, that is, contain only one '/n'.open(TXTIN,"input") || die "Cannot open the data file"; open(TXTOUT,">output") || die "Cannot open the formatted file"; while(<TXTIN>){ if (/^[1-9]/){ s/^[1-9].//; print TXTOUT; } else{ @array=$_;#???this is where I am lost print TXTOUT @array;} } close (TXTIN); close (TXTOUT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Input to String OR Array
by fishbot_v2 (Chaplain) on Oct 18, 2005 at 20:58 UTC | |
|
Re: Input to String OR Array
by Roy Johnson (Monsignor) on Oct 18, 2005 at 21:00 UTC | |
|
Re: Input to String OR Array
by GrandFather (Saint) on Oct 18, 2005 at 21:08 UTC | |
by jriggs420 (Sexton) on Oct 18, 2005 at 21:59 UTC | |
by GrandFather (Saint) on Oct 18, 2005 at 22:38 UTC | |
by jriggs420 (Sexton) on Oct 19, 2005 at 00:47 UTC | |
|
Re: Input to String OR Array
by eyepopslikeamosquito (Archbishop) on Oct 18, 2005 at 21:05 UTC |