Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-09-19 03:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls