Programming :: Perl And Mysql - Warnings?
Dec 2, 2010I've decided to learn perl and have an application that is going to require the use of mysql.
Are these warnings bad?
Here's the code:
Code:
And the warnings:
Code:
I've decided to learn perl and have an application that is going to require the use of mysql.
Are these warnings bad?
Here's the code:
Code:
And the warnings:
Code:
I'd like to use a perl script to update a fields in mysql database when pianobar (command line pandora radio player) starts a new song. Pianobar has the ability to run a script based on events, I'd like to take advantage of and use perl toparse the artist,song,album and update the corresponding fields. Then later retrieve them and display them with php/html. I am by no means proficient with perl. I started to use bash, but it looks like perl will be much more efficient and and less time consuming.
Code:
#! /usr/bin/perl -wT
use strict;
[code]...
I have this program:
#! /usr/bin/perl
use DBI ;
use strict ;
[code]....
and I get this error simply running the program from the command line: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at ./submit.cgi line 24.
is this the right syntax to use, both, for this line:
my (@param) = $cgi->param("firstname","lastname","type") ;
as well as this one:
$sth=$dbh->prepare ("SELECT firstname,lastname,type FROM dts WHERE firstname LIKE $param[0] AND lastname LIKE $param[1] and type LIKE $param[2]" );
or should there be quotes around the $param[0] or something? (also is it $param[0] or $param(0)?)
am running Centos 5.4 and would like to write a small perl script to collect some info from mysql.
so I went
yum install perl-DBI
yum install perl-DBD-mysql
then
nano perl.pl
---
#!/bin/perl
use Mysql;
[Code].....
Why can't perl find Mysql.pm? I guess because it doesn't exist as I ran find / -name Mysql.pm, and also could not find it.
shouldn't that file have been created and thus exist after I install perl-DBD-mysql?
From "man gcc"
-Wno-int-to-pointer-cast (C and Objective-C only)
Suppress warnings from casts to pointer type of an integer of a different size.
[code]...
I want to connect to MySQL Database installed on RHEL 5 using perl v 5.8.8.The available DBD perl drivers installed on my machine are:DBM, ExampleP, File, Pg, Proxy, Sponge..I downloaded DBD-mysql-2.1012 and tried installing DBD again but got the following error:Can't exec "mysql_config": No such file or directory at Makefile.PL line 167.readline() on closed filehandle PIPE at Makefile.PL line 169.On searching I found that I need to install libz-devel prior to installing driver for MySQL for Perl.
View 1 Replies View RelatedI have spent over half of the day, literally, trying to get my server to parse perl and be able to use perl scripts to interact with my SQL server. Has anyone been able to get it to work? Only looking for answers to Slackware. There are a lot of resources for FC and Ubuntu, but that does me no good. I checked the Slackbuilds for their builds, and built the libdbi and libdbi-drivers package, but still cannot get it to communicate.
View 1 Replies View RelatedI have a permission to use several CentOS5 computers that are connected to a server where all shared programs sit. Accordingly, all Perl users for example have an identical path to Perl (e.g. /export/user/bin). The administrator suggested I'll install all the programs I need (specifically Perl and Mysql) in my personal space, and then add them to the path before the already installed ones. Accordingly, I could add/change modules without "sudo" privileges, and without changing the global setting.
View 1 Replies View RelatedAs I mentioned on another thread, I have 2 Ubuntus - Jaunty and Meerkat - as separate drives on my secondary IDE channel. I am removing Jaunty. Meerkat blows it away. And is certainly my preferred OS. However I am looking for a replacement for Jaunty that is more flexible in certain key areas than Ubuntu appears to be.I dont want to be restricted to Debian versions of things like Perl, MySQL, PHP and others. I can run LAMPP, but I would prefer to compile and have the versions of my choice as part of a main test system (apart from Meerkat that is).
I have had enough nightmares in Jaunty with things getting broken and spiralling out of control. I want a distro that doesnt rely on the GUI and its attendant utilities, but can run them when called. Meerkat is stable and has resisted me breaking it so far, but I do not want to push my luck. I have too much time invested in it. I intend to use Meerkat as my primary system on the machine, but want an alternative to *PLAY* with.
I have been tearing my hair out with this. As part of a backend perl script i am holding the Epoch time as session data using apache session and mysql so i can delete sessions after an expiry period. When I retrieve the time it is about three months old even when i only just set it. The code example below best describes the problem:
View 5 Replies View RelatedI am having some issues getting Bugzilla setup, I have the software on the server and am trying to get the pre-rec's setup.
I am using RedHat 4.1.2-42.
I have all of the required perl modules save one:DBD::mysql
When I try:
I get the following response(this is only an excerpt):
Can't test without successful make Running make install make had returned bad status, install seems impossible.
Where is the perl module for programming with sockets?
View 4 Replies View RelatedI wrote a code in C to connect to MySQL by using mysql_real_connect function but I recieved error "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" (by using mysql_error function).
I also did the following things: in mysql I typed 'SHOW VARIABLES LIKE '%SOCKET%'', it returned /var/lib/mysql/mysql.sock I typed 'mysql_config --socket' in shell, it returned /var/lib/mysql/mysql.sock I modified /etc/my.cnf file
I just downloaded Tk-804.028 and try to install it (according to the README.linux) but I get:
> perl Makefile.PL
/opt/ActivePerl-5.10/bin/perl-static is installed in /opt/ActivePerl-5.10/lib okay
PPM for perl5.010001
Test Compiling config/perlrx.c
Test Compiling config/pmop.c
Test Compiling config/pregcomp2.c
[code]...
Any recommendations on what Perl tutorial to use?
View 1 Replies View RelatedI am taking an input from the user for free and Used capacity in a disk. I wish to convert Input entered in MBTB to GB and this is how i am doing it.
Code:
<some code>
print "Enter Total disk space";
$tot = <STDIN>;
convert($tot);
[code]...
how do i pass the value of conv[0] after conversion back to $tot or $use such that they contain only value which is in GB?
I really would like Perl Qt4 bindings. The best I could find is this:[URL]The problem is that the sources would not compile, and the RPMs are for 32-bit machines.Is there really no such thing as good Perl Qt4 bindings?
View 8 Replies View RelatedI am a newbie on linux and just searching everything about perl scripting and modules nearly 3-4 days. I need a perl script but one of not easy to find on searching google. Okay now I need a perl script which create or recreate (edit) id3 tags (artist, comment, album, year, cover) of mp3 files stored on my linux centos server. I installed MP3::Tag version 1.13 pearl module to my server. I Searched tutorials about how to use it, finally I get through reading id3 tag of mp3 file but not achieve to modify it or create a new id3tag.
These are the details:
I have a mp3 file called 1.mp3 this script will process that '1.mp3' file read its id3tag if there is one, than modify or create id3tag for it by my fix artist name for example:
'1.mp3' files id3 tag details are like this
Artist: Dj xx
Year:2010
Title:yyyyy
Comment:eerwer
Cover: x.jpg
Now via this perl script which uses MP3::TAG I will change it's
artist as YYY
Title:ttt
Comment:cool
Cover:t.jpg
these are gonna be my fixed values. I mean all '1.mp3' file will have same artist based on script value.
The reason of this script is I will share Dj podcasts on my server and Dj's would have upload their mp3's which has got different id3 tags and cover pics. etc. I want to create more organized podcasts of them by the way I would trigger this perl script via Cronjob.
How can I generate a md5 or sha-1 code with perl?
View 2 Replies View RelatedAs some of you know that I am new to this forum. I have another problem that I got stuck on. I have this file called "Fib.rbb" and my instructor told us to write an interpreter program by using Fib.rbb.
"You are to write an interpreter in Perl for Rongs Basic Basic (RBB) as explained in class. The BNF description for RBB and a test file called Fib.rbb are part of the RBB.zip file which is available in the Course Documents folder on blackboard. If you call your interpreter myIntp.pl, you would execute the program via perl myIntp.pl Fib.rbb
Code: Print "A few Fibonacci numbers:"
Just installed Fedora 14. I wanted to try "Hello World" with perl. But where is it?
Code: [user]@user bin]$ ls
Im somewhat new at perl and was wondering if there was a way to run a perl script or tool made from perl, from a USB pen that would work both on Linux and on Windows?
View 1 Replies View RelatedI writed my home.html page in /var/www with following form:
Quote:
<form action="/cgi-bin/login.cgi" method="get" class="form-font">
<label>Already you registered?</label><br/><hr/><br/>
<fieldset><br/>
<legend>Insert your account</legend>
Email: <input type="text" name="email"/><br/><br/>
[Code].....
I'm the server guy which is why I don't know this, but were staging a new webserver and we use some custom perl scripts and as were moving the site over for testing, apache is blowing a perl error;Can't locate web.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /home/mcp/htdocs/cgi-bin/newgraph.gif line 11.,Now I can copy that file local, but there are a bunch of things, so the question is how do you globally add a folder to the perl search path
View 1 Replies View RelatedI have a debian lenny machine that I am trying to add mod_perl to and use apache asp on. I have had a range of failures on it. Is ther a way I can build apache2 with mod_perl in it? Instead of separate. Apache2 is built with some modules built in by default, how can I make mod_perl one of them?
View 1 Replies View RelatedI would like to ask opinion from perl experts.
I want to compare 2 files and show the differences in a text file.
For example, if i open File A an B in notepad
File A:
File B:
Quote:
line3 is missing in File B
So if I did a File compare (line by line), the differences will be in line3, line4, line5, line 6.
But I dont want it to be like that.
I want it to be like this
Quote:
Can Text:: Diff able to perform the work.
Using given program , i am able to print current date but is is possible to print last n no. of date. For example i want to print last three date staring from today. so o/p should be like
2010-06-02
2010-06-01
2010-05-31
Code:
my $myTimeStamp = "";
sub _timestamp
{
[Code]...
How do I download a file to a specified location on disk in Perl?I tried doing a few web searches but suprisingly couldn't find anything.
View 4 Replies View RelatedI writed Quote:
#!/usr/bin/perl -w
use Error qw(:try);
try {
[code]....
What is the difference in perl between:
'function();'
and
'&function();'
with and without ampersand.