Cheers James, Couldn't see the wood for the trees! It works great.
Marty --- "vega, james" <[EMAIL PROTECTED]> wrote: > > -----Original Message----- > > From: > [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] > On > > Behalf Of MARTIN MOSS > > Sent: Thursday, August 26, 2004 12:11 PM > > To: [EMAIL PROTECTED] > > Subject: [Perl-unix-users] taking strings and > printing them > > to a file which is itself a perl file > > > > All, > > > > Hope everyone's having a pleasant day! > > > > I have a really urgent problem which I just can't > seem > > to resolve. > > > > I have a data structure, which I want to write out > to > > a file. The file I'd like to write would actually > be a > > perl file which I can 'require' at a later date, > after > > it's been manually edited. > > > > The format of the output hash I wish to write is:- > > > > $hash= { > > 'key' => { > > 'original_value' > > =>$original_value', > > 'new_value' => > '$original_value', > > > > 'files' => [ > > > '$file1','$file2' > > ] > > }, > > }; > > Data::Dumper is a useful module for dumping data > structures to a file in a > human-friendly format. > > > > > Where $original_value & the $file1,$file2 values > can > > contain ANY character. > > I could write my own regex replacements for things > > like Brackets and anything else which would > prevent > > the compilation of the 'requirable' file. But I > > suspect that I've probably missed something out > and > > there's a nice CPAN module (which I haven't found) > or > > something else I should be using instead. > > > > > > Marty > ___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs