[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Re: Newlines (fwd)



At 4:07 PM -0500 10/16/97, Mark Manning/Muniz Eng. wrote:
>(Since I am unsure if this was e-mailed or posted - I'm
>posting a reply.  Sorry if it was e-mail!)
>
>Ok, the question was basically, "Why would you ever use
>Control Characters in a script?" and I replied:
>
>	s/\012/\012\015/g;
>
>But it was pointed out that the usage of CGI.pm would
>circumvent this need.
>
>So I say - ok, how about this:
>
>Let's say that you want to set up a database.  And this
>database is to have various fields on each record.  Each
>field also can have sub-fields.  These records can contain
>any standard character (ie: A-Z, a-z, 0-9, and even special
>characters such as :'s, /'s, and the like).  Only control
>characters are not allowed.  (Automatically converted to
>spaces.)  What do you use for separators?

I've done exactly that for years, using ASCII control characters RS GS US
and FS as the characters that join different levels of strings that are
actually arrays.  It's not so necessary now that perl has support for
references and real multi-level arrays, but it is still useful for saving
things in a file and later reading it back in.

John Macdonald             jmacd@interlog.com



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch