lol - sorry Bill.

I have written a script which builds a large complex
array ref and eventually it dumps it into a text file.

Another script then takes several of these output text
files  and reads them all into a 'merged' data
structure and then does other things with this merged
structure. I can't merge them on the fly because of
really really crappy memory constraints.

Rather than write the dumped files in any sort of XML
csv format, and then have to parse them back in again,
I opted to write them as a large perl hashref
definition, which I could just run in an eval to
rebuild the structure quickly.

My only issue was that until I used Data::Dumper to
create the dump files, (which escapes any variables
that would make my dumped perl hashref definition
syntactically incorrect 

e.g. 

$hashref= {
             ''{ddd](@' => 'dfdfdfdd'${ggg@';
          }


As you can see I have too many chars which would break
the perl syntax. This is because both the key and the
value I'm writing could contain characters like '"[EMAIL PROTECTED]
etc...

e.g. for the above example

      key = '{ddd](@
      value = dfdfdfdd'${ggg@


I simply needed a mechanism which would escape these
characters for me. Turns out I was reinventing the
wheel somewhat, and Data Dumper does everything I
wanted. I've just never thought about using it to dump
temporary data files and then parse them back in
again. - currently there aren't any show stopping
taint issues.

Hope this helps,

Marty




 --- $Bill Luebkert <[EMAIL PROTECTED]> wrote: 
> Martin Moss wrote:
> 
> > Hey Bill, thanks for your input, but no, I was
> simply
> > meaning that the string of perl I was trying to
> create
> > would have some values that were themselves
> dynamic.
> > These dynamic values quite often contained
> {[()[EMAIL PROTECTED])
> > chars, which if I didn't escape them properley
> would
> > break the syntax for the perl hash ref.
> 
> Your example didn't manage to get your point across.
> Neither does that explanation.
> 
> > Now I just have to read them back in and pattern
> match
> > against them in other files, think the \Q \E
> syntax
> > should do that, will look it up.
> 
> I fail to understand what you are getting at.  Would
> you have an
> example to show that explains what you have so far
> managed not
> to have explained ?  ;)
> 
> -- 
>   ,-/-  __      _  _         $Bill Luebkert   
> Mailto:[EMAIL PROTECTED]
>  (_/   /  )    // //       DBE Collectibles   
> Mailto:[EMAIL PROTECTED]
>   / ) /--<  o // //      Castle of Medieval Myth &
> Magic http://www.todbe.com/
> -/-' /___/_<_</_</_    http://dbecoll.tripod.com/
> (My Perl/Lakers stuff)
> 
> 
> _______________________________________________
> Perl-Unix-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe:
> http://listserv.ActiveState.com/mailman/mysubs
>  


        
        
                
___________________________________________________________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

Reply via email to