submitted by /u/davorg
[link] [comments]
[link] [comments]
On the [b]leading edge - Perl Hacks
We need programmers who like to play on the bleading edge. By trying out new features, they are able to report on problems that they find - and, in doing so, improve the experience for the many people who follow them.Dave Cross (Perl Hacks)
submitted by /u/oalders [link] [comments] |
I'm Still Lazy
I wrote an auto-installer for Perl modules, but I was too lazy to fix it.Olaf Alders (www.olafalders.com)
submitted by /u/briandfoy [link] [comments] |
- YouTube
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.www.youtube.com
Hi all! I have a bug in my script I can't locate and I'm sure it must be some silly thing.
I am using a SQLite database with a contacts table that includes a field for the date in which the contact was added or edited. This is a DATE type field defined as "editado" date NOT NULL
.
I search for a group of contacts by doing this (nomap
is a string field with name and lastname):
sub cntSearch( $srch ) { my @result = (); my $tosrch = $srch; $tosrch =~ s/([\\%_'"\[\]])/\\$1/g; # LIKE no admite $dbh->quote() $sth = doSQL( "SELECT * FROM contactos WHERE nomap LIKE '%$tosrch%' ORDER BY nomap" ); while ( $hr = $sth -> fetchrow_hashref() ) { utf8::decode( $hr->{nomap} ); push @result, $hr; } return @result; }
At this point, if I read
$hr->{editado}
, I get the string I want (a date in the YYYY-MM-DD format). But when I do this:my @cntlist = cntSearch( $srch ); for ( @cntlist ) { my ( $codigo, $nomap, $ref, $editado ) = ( $_->{codigo}, $_->{nomap}, $_->{referencia}, $_-->{editado} ); }
the variable
editado
gets the value 1.The actual code is more complex but this is the gist of it and I think the other stuff is not related.
Any advice on this would be appreciated!
submitted by /u/elbitjusticiero
[link] [comments]