author | Simon Howkins <simonh@symbian.org> |
Mon, 05 Oct 2009 11:22:09 +0100 | |
changeset 579 | 78b42fd9e2c4 |
parent 89 | a8aa5d600806 |
permissions | -rw-r--r-- |
89
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
1 |
# NOTE: Derived from blib\lib\Text\CSV.pm. |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
2 |
# Changes made here will be lost when autosplit again. |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
3 |
# See AutoSplit.pm. |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
4 |
package Text::CSV; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
5 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
6 |
#line 231 "blib\lib\Text\CSV.pm (autosplit into blib\lib\auto/Text\CSV/_bite.al)" |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
7 |
################################################################################ |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
8 |
# _bite |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
9 |
# |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
10 |
# *private* class/object method returning success or failure. the arguments |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
11 |
# are: |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
12 |
# - a reference to a comma-separated value string |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
13 |
# - a reference to a return string |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
14 |
# - a reference to a return boolean |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
15 |
# upon success the first comma-separated value of the csv string is |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
16 |
# transferred to the return string and the boolean is set to true if a comma |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
17 |
# followed that value. in other words, "bite" one value off of csv |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
18 |
# returning the remaining string, the "piece" bitten, and if there's any |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
19 |
# more. failure can be the result of the csv string containing an invalid |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
20 |
# sequence of characters. |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
21 |
# |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
22 |
# from the csv string and |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
23 |
# to be a valid comma-separated value. failure can be the result of |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
24 |
# no arguments or an argument containing an invalid sequence of characters. |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
25 |
# side-effects include: |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
26 |
# setting status() |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
27 |
# setting fields() |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
28 |
# setting string() |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
29 |
# setting error_input() |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
30 |
################################################################################ |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
31 |
sub _bite { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
32 |
my ($self, $line_ref, $piece_ref, $bite_again_ref) = @_; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
33 |
my $in_quotes = 0; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
34 |
my $ok = 0; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
35 |
$$piece_ref = ''; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
36 |
$$bite_again_ref = 0; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
37 |
while (1) { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
38 |
if (length($$line_ref) < 1) { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
39 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
40 |
# end of string... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
41 |
if ($in_quotes) { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
42 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
43 |
# end of string, missing closing double-quote... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
44 |
last; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
45 |
} else { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
46 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
47 |
# proper end of string... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
48 |
$ok = 1; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
49 |
last; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
50 |
} |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
51 |
} elsif ($$line_ref =~ /^\042/) { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
52 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
53 |
# double-quote... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
54 |
if ($in_quotes) { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
55 |
if (length($$line_ref) == 1) { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
56 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
57 |
# closing double-quote at end of string... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
58 |
substr($$line_ref, 0, 1) = ''; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
59 |
$ok = 1; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
60 |
last; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
61 |
} elsif ($$line_ref =~ /^\042\042/) { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
62 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
63 |
# an embedded double-quote... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
64 |
$$piece_ref .= "\042"; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
65 |
substr($$line_ref, 0, 2) = ''; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
66 |
} elsif ($$line_ref =~ /^\042,/) { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
67 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
68 |
# closing double-quote followed by a comma... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
69 |
substr($$line_ref, 0, 2) = ''; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
70 |
$$bite_again_ref = 1; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
71 |
$ok = 1; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
72 |
last; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
73 |
} else { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
74 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
75 |
# double-quote, followed by undesirable character (bad character sequence)... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
76 |
last; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
77 |
} |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
78 |
} else { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
79 |
if (length($$piece_ref) < 1) { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
80 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
81 |
# starting double-quote at beginning of string |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
82 |
$in_quotes = 1; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
83 |
substr($$line_ref, 0, 1) = ''; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
84 |
} else { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
85 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
86 |
# double-quote, outside of double-quotes (bad character sequence)... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
87 |
last; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
88 |
} |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
89 |
} |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
90 |
} elsif ($$line_ref =~ /^,/) { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
91 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
92 |
# comma... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
93 |
if ($in_quotes) { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
94 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
95 |
# a comma, inside double-quotes... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
96 |
$$piece_ref .= substr($$line_ref, 0 ,1); |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
97 |
substr($$line_ref, 0, 1) = ''; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
98 |
} else { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
99 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
100 |
# a comma, which separates values... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
101 |
substr($$line_ref, 0, 1) = ''; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
102 |
$$bite_again_ref = 1; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
103 |
$ok = 1; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
104 |
last; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
105 |
} |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
106 |
} elsif ($$line_ref =~ /^[\t\040-\176]/) { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
107 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
108 |
# a tab, space, or printable... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
109 |
$$piece_ref .= substr($$line_ref, 0 ,1); |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
110 |
substr($$line_ref, 0, 1) = ''; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
111 |
} else { |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
112 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
113 |
# an undesirable character... |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
114 |
last; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
115 |
} |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
116 |
} |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
117 |
return $ok; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
118 |
} |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
119 |
|
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
120 |
1; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
121 |
# end of Text::CSV::_bite |