freax has asked for the wisdom of the Perl Monks concerning the following question:
Note that all these fields can get big (up to 10 MB per field). So[from][to][typea][typeb][message]
Ehm.. intro is getting to big :) so the Question : What to do with "ItemData" ? (mainly at script3.pl of course. generating it isn difficult) This is my test.pl, maybe you Monks know a better way to deal with my "ItemData" problem ?[script1.pl-> Makes ItemData from some fields and puts it as rawdata in a database ] ---> DBI ---> <--- DBI <--- [script2.pl-> reads ItemData from a database sends this data over a socket which is connected with script2 script1.pl knows nothing about the structure of ItemData and also doesn want to know. ] --> TCP/IP ---> <-- TCP/IP <--- [script3.pl recives ItemData and knows how ItemData is formed script3.pl will get all the fields in ItemData and will use this to talk to hardware with it .. (for example a FAX modem or an SMS machine or whatever .. not importand yet) ]
$Ione = "Item|One"; $Ione =~ s/\|/\&verti\&kaal\&stre\&epke\;/g; $ItemData = "$Ione|Ite\@m tw\%o|It\"em Th\$ree|Item \\our|Item \'five| +Item \/six"; # # Should be split up in : # Item|One # Ite@m tw%o # It"em Th$ree # Item F\our # Item 'five # Item /six # print $ItemData."\n\n\n"; @words = split(/\|/, "$ItemData"); for (@words) { s/\&verti\&kaal\&stre\&epke\;/\|/g; print $_."\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: splitting Any data on a delimiter an putting it back togetter
by CubicSpline (Friar) on Sep 27, 2001 at 21:32 UTC | |
by freax (Initiate) on Sep 29, 2001 at 15:24 UTC |