SPUG: Stupid Ascii question
Creede Lambard
creede at penguinsinthenight.com
Thu Aug 15 12:35:41 CDT 2002
I'm not sure if there will be any problems with chr(31) as a field
separator -- my inclination would be to try it and see -- but I have to
wonder, why do you want to have the character be non-printing? If you
use a visible but uncommon character like the pipe, you have a good idea
where your records break into fields. Or better yet, use a tab, which is
both whitespace and easily represented in a print string (\t) and still
only takes up one character in your field.
On Thu, 2002-08-15 at 09:54, Peter Darley wrote:
> Friends,
> I am working with database stuff and I want to store deleted database
> records, so there's a history of what was in the database. I have chosen to
> do this by having my front end app, written in Perl, put all the field names
> and values into a single string separated by a non-printing Ascii character
> which I can just do a split() on later to return a hash of the record, which
> is exactly what I would get if I did a fetchrow_hashref() on the original
> record.
> My question is this; what non-printing Ascii character can I use for this?
> I wanted to use chr(0), the ascii null, but postgresql or DBD::Pg or DBI or
> something chokes on it. I went with chr(31) which is described as 'unit
> separator'. I'm worried that there may be some unexpected interaction with
> file systems or something that I'm unaware of, so I thought I'd ask y'all.
> Thanks,
> Peter Darley
>
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
> Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
> Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
> For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
> Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
>
--
* .~. `( ------------------------------------------------------------
` / V \ . Creede Lambard : Live in a world of your own,
/( )\ creede at penguinsinthenight.com : but always welcome visitors.
^^-^^ ------------------------------------------------------------
Perl Programmer and Linux Sysadmin, reasonable rates. Inquire within.
GPG key at http://www.penguinsinthenight.com/creede_public_key.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
Url : http://mail.pm.org/archives/spug-list/attachments/20020815/fb10da90/attachment.bin
More information about the spug-list
mailing list