Gossamer Forum
Home : General : Perl Programming :

problem with colon as delimiter

Quote Reply
problem with colon as delimiter
most of my tables use pipe | as delimiter but one uses colon :

this is the code that creates array from a record:

Code:
sub split_decode {

# --------------------------------------------------------
# Takes one line of the database as input and returns an
# array of all the values. It replaces special mark up that
# join_encode makes such as replacing the '``' symbol with a
# newline and the '~~' symbol with a database delimeter.


my ($input) = shift;
$input =~ s/\Q$db_delim\E$/$db_delim /o; # Add a space if we have delimiter new line.
my (@array) = split (/\Q$db_delim\E/o, $input);
for ($i = 0; $i <= $#array; $i++) {
$array[$i] =~ s/~~/$db_delim/og; # Retrieve Delimiter..
$array[$i] =~ s/``/\n/g; # Change '' back to newlines..
$array[$i] =~ s/&/&amp;/g; # encode ampersand 02/01/2017
}
return @array;
}



it works fine when $db_delim = '|' but can't find an individual record when $db_delim = ':'
Subject Author Views Date
Thread; hot thread problem with colon as delimiter delicia 900 May 7, 2020, 1:33 PM
Post; hot thread Re: [delicia] problem with colon as delimiter
delicia 892 May 7, 2020, 1:36 PM
Thread; hot thread Re: [delicia] problem with colon as delimiter
Andy 887 May 7, 2020, 11:33 PM
Thread; hot thread Re: [Andy] problem with colon as delimiter
delicia 885 May 8, 2020, 5:43 AM
Thread; hot thread Re: [delicia] problem with colon as delimiter
Andy 879 May 8, 2020, 5:52 AM
Thread; hot thread Re: [Andy] problem with colon as delimiter
delicia 874 May 8, 2020, 5:59 AM
Thread; hot thread Re: [delicia] problem with colon as delimiter
delicia 871 May 8, 2020, 6:10 AM
Post; hot thread Re: [delicia] problem with colon as delimiter
Andy 866 May 8, 2020, 6:18 AM
Thread; hot thread Re: [delicia] problem with colon as delimiter
Andy 860 May 8, 2020, 6:45 AM
Post; hot thread Re: [Andy] problem with colon as delimiter
delicia 852 May 8, 2020, 7:05 AM
Thread; hot thread Re: [delicia] problem with colon as delimiter
Andy 858 May 8, 2020, 6:48 AM
Thread; hot thread Re: [Andy] problem with colon as delimiter
delicia 851 May 8, 2020, 7:06 AM
Thread; hot thread Re: [delicia] problem with colon as delimiter
Andy 844 May 8, 2020, 7:27 AM
Thread; hot thread Re: [Andy] problem with colon as delimiter
delicia 842 May 8, 2020, 7:34 AM
Post; hot thread Re: [delicia] problem with colon as delimiter
Andy 817 May 8, 2020, 10:49 PM