Comments (3)
I needed that often too, and worked around that by just assigning it to an unused scalar
my $void = (in => [[1,2]], on_in => sub { ...});
It is relatively easy to support undef
too, but that would prevent me to cast errors on invalid out
, like
my $out;
csv (in => [[1,2]],
out => $out, # Needs to be a reference
on_in => sub { $cache{$_[1][1]++ },
);
Using a reference like \undef
would break
out => \my $buffer,
so, that is not an option.
How about using the same as in after_parse:
csv (in => [[1,2]],
out => \"skip",
on_in => sub { $cache{$_[1][1]++ },
);
As the current implementation does not warn on out => 0
(or out
being anything false
), it would be backward compatible to promote this to a feature as you requested, which only inhibits the warning as proposed in my first example, which is not present now.
That is now pushed. Feedback welcome.
from text-csv_xs.
Yes, thanks a lot, \'skip'
is nice, especially as it's something already present elsewhere. I assigned it to a variable, too, but it wasted the memory when the file was large, while the structure being collected was much smaller.
from text-csv_xs.
Consider it "patch applied" then. It will be in the next release. Feel free to fetch and test from github.
As always, thanks for the feedback. Will close this issue now.
from text-csv_xs.
Related Issues (20)
- getter quote_char() and escape_char() returning 0 instead of undef HOT 5
- Can't parse fields with nested quotes and commas HOT 2
- Offer option to not put empty columns into hashes created HOT 1
- Procedure (or method) returning the error text HOT 2
- csv in => $aoa, out => … produces a CSV file with two empty records when $aoa is empty HOT 2
- Turn off column naming munging HOT 2
- Multiple spaces as a separator? HOT 3
- Typo in sub csv() causes sep chars set to not work HOT 2
- getline_all does not understand scientific ("e") notation HOT 2
- BOM without a header line. HOT 6
- FR: Reading multiple CSVs from a single file HOT 6
- csvdiff HOT 3
- Double headers when both detect_bom and headers are provided HOT 3
- segmentation faults with serialised/deserialised objects from previous script runs HOT 8
- minor compilation warning: inconsistent format type spec HOT 1
- when reading line by line, skip_empty_rows('skip') does not skip a trailing empty row right before EOF
- improper reinitialization of $v_ref HOT 3
- strict behavior for bind_columns changed in 1.54 HOT 4
- need method to access the complete (unparsed) line HOT 1
- Quotes in the middle of an unquoted field produce misleading error HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from text-csv_xs.