cajun has asked for the wisdom of the Perl Monks concerning the following question:
This node solve my quest for how to read just a few lines from each file. However it left me with a different question. While I'm very accustomed to opening a file and processing it line by line, I've never done this with a scalar variable (ref: $header in Jumping out of a partially read file.
I'm fairly sure the answer is simple, however in many searches on Perlmonks.org as well as Google, and of course "Learning Perl", the solution has not yet become clear.
My $header scalar contains data that looks like this:
Thanks for any suggestions,X-Account-Key: account3 Return-Path: <> Delivered-To: somename@somedomain.com Received: (qmail 77369 invoked for bounce); 3 Jun 2005 06:35:09 -0000 Date: 3 Jun 2005 06:35:09 -0000 From: MAILER-DAEMON@smtp.somedomain.com To: somename@somedomain.com Subject: failure notice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to parse a scalar variable
by Zaxo (Archbishop) on Jun 05, 2005 at 06:08 UTC | |
|
Re: How to parse a scalar variable
by jZed (Prior) on Jun 05, 2005 at 05:57 UTC | |
|
Re: How to parse a scalar variable
by sh1tn (Priest) on Jun 05, 2005 at 10:57 UTC | |
|
Re: How to parse a scalar variable
by NateTut (Deacon) on Jun 05, 2005 at 15:14 UTC | |
|
Re: How to parse a scalar variable
by cajun (Chaplain) on Jun 06, 2005 at 01:46 UTC |