Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

borisz's scratchpad

by borisz (Canon)
on Jun 01, 2004 at 15:53 UTC ( #358156=scratchpad: print w/replies, xml ) Need Help??

# does not work; propably group is not supported? use DBI; use Fatal ':void'; open my $fh, '>', '/tmp/xyz.csv'; binmode $fh; print $fh <<__CSV__; aa,bb,cc a,2,3 a,3,7 b,12,111 c,12,12 __CSV__ close $fh; my $dbh = DBI->connect(qq{DBI:CSV:}); $dbh->{'csv_tables'}->{'t_test'} = { file => '/tmp/xyz.csv', col_names => [qw/aa bb cc/]}; my $ar = $dbh->selectall_arrayref( q{ SELECT aa, COUNT(*) AS cnt, AVG( +cc) FROM t_test GROUP BY aa ORDER BY aa });
# produce wrong code! sub t{ shift->{x} = {@_} } my $x = bless ({}); $x->t(a => 12, b=> 13); print Dumper($x);

.vimrc for perl programmers
Let shortcut types have useful behavior in the parameterless case
String to Hex
Perl Module
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2023-03-24 12:16 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (61 votes). Check out past polls.