Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Transforming a scalar to an arrayby vxp (Pilgrim) |
on Jul 15, 2009 at 14:49 UTC ( [id://780342]=perlquestion: print w/replies, xml ) | Need Help?? |
vxp has asked for the wisdom of the Perl Monks concerning the following question: Suppose you have this input:
And the following code:
Is there a way to transform that $input scalar into an array? I realize that local( $/, *INPUT ); gets rid of the new lines. I also don't have any special separators in my actual input (my "real" input is a lot like this "fake" input, except that its MIME encoded, and I decode it using MIME::QuotedPrint::Perl. Which by the way, is why I'm doing local( $/, *INPUT ); in the first place.. I have to read the whole MIME-encoded file into a scalar to decode it. Can't read it in line by line because of that. :/ ) I just want to iterate through $input line by line and do something with each..so, somehow, I need to turn it into an array :) Any thoughts/suggestions/solutions welcome!
Back to
Seekers of Perl Wisdom
|
|