read the filein...

open(FILE, $file) or die "blah blah $!";
undef $/; ## or local $/ if in a BLOCK
$contents = <FILE>;
close FILE;

$contents =~ s/\\\n//g; # put everything on one line (deletes \ followed by
newline)

foreach (split /\n/, $contents){        
        ## you can figure this part out right?
        }

> -----Original Message-----
> From: Anders Holm [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 11, 2002 9:40 AM
> To: Beginners Perl
> Subject: Putting values into hash
> 
> 
> Hi folks!
> 
> Well, here's one I'm just not getting to grips with.
> 
> I'm parsing a configuration file for an application, and it 
> has a parameter
> as such:
> 
> Parameter=Value1 Value2 Value3 \
>               Value4 Value5 Value6 \
>               Value7 Value8
> 
> There are other parameters before and after this entry in the 
> configuration
> file as well. I want to grab these values and put them in an 
> array, so I can
> later use them for additional usage. I'm just not getting 
> this anywhere. And
> I don't even have a code snippet to show, since I'm not sure 
> how to iterate
> over these lines either. NB. there is a newline after each \, 
> hence why it
> doesn't just read them all in as one line... :(
> 
> How can I go about doing this? My head's just gone into a 
> stand still and I
> just need someone to wake me up I guess!! ;)
> 
> TIA!
> 
> Best Regards
> 
> Anders Holm
> Critical Path Technical Support Engineer
> ----------------------------------------------------------------------
> Tel USA/Canada:       1 800 353 8437
> Tel Worldwide:        +1 801 736 0806
> E-mail:               [EMAIL PROTECTED]
> Internet:     http://support.cp.net
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to