Hi, iam learning MySql. Iam trieing to create a table in the database "guestbook"
at the command line in mysql heres what i type but i get a error
mysql>create table guestbook
->(
-> name varchar(40) null.
-> url varchar(40) null.
-> comments ... (3 Replies)
How do I write a perl script to get the cron jobs? I could do a
perl -e ' system "crontab -l > jobs.txt " ';
Is there a better way?
Then I can use perl to make changes to jobs.txt. How can I submit the changes.
I suppose I could use system "crontab jobs.txt", is there a better way?
... (0 Replies)
hi there, I am trying to create a stored procedure that i can pass the table name to and it will create a table with that name. but for some reason it creates with what i have defined as the variable name . In the case of the example below it creates a table called 'tname'
for example
... (6 Replies)
Hi pls help me out to short out this problem
rm PAB113_011.out
rm: PAB113_011.out: override protection 644 (yes/no)? n
If i give y it remove the file.
But i added the rm command as a part of ksh file and i tried to remove the file. Its not removing and the the file prompting as... (7 Replies)
how can i automatically create a file on Linux? like a process that searches for the file and if the file does not exist, it automatically makes the file (3 Replies)
I need to extract the data from oracle table and written the below code.
But it is not working.There is some problem with the query and output is shown is No rows selected" . If I run the same query from sql developer there is my required output.
And if I run the shell script with simple sql... (7 Replies)
I feel stupid for asking this because it seems that MYSQL code isn't working the way that I think it should work.
Basically I wrote code like this:
select * from `Test_DC_Trailer` HAVING max(DR_RefKey);
Where the DR_RefKey is a unique numeric field that is auto iterated (like a primary key)... (7 Replies)
Hi ,
I need to filter input file according to following
All rows with the following conditions should be removed
1) If in a row, the number of 'N's starting col 2 exceeds 2 (3 or more)
OR
2) If a row is duplicated with the same value, starting col 2,
A value 'N' is considered missing... (1 Reply)
Dear All,
I am trying to write a Unix Script which fires a sql query. The output of the sql query gives multiple rows. Each row should be saved in a separate Unix File.
The number of rows of sql output can be variable. I am able save all the rows in one file but in separate files.
Any... (14 Replies)
Hello
I've four fields . They are First Name, Last Name, Age, Country. So when I run a Unix command, I get below output with these fields comes every time in different order as you can see. Some times first name is the first row and other time last name is first row in the output and etc etc..... (9 Replies)
Discussion started by: rprpr
9 Replies
LEARN ABOUT DEBIAN
poe::component::irc::cookbook::basicbot
POE::Component::IRC::Cookbook::BasicBot(3pm) User Contributed Perl Documentation POE::Component::IRC::Cookbook::BasicBot(3pm)NAME
POE::Component::IRC::Cookbook::BasicBot - A basic IRC bot
SYNOPSIS
This a very basic bot that connects to IRC, joins a few channels, and announces its arrival.
DESCRIPTION
We start off quite simply:
#!/usr/bin/env perl
use strict;
use warnings;
Then we "use" the stuff we're going to...well, use. "::State" is a subclass which keeps track of state information related to channels and
nicknames. It is needed by the "AutoJoin" plugin which takes care of keeping us on our channels.
use POE;
use POE::Component::IRC::State;
use POE::Component::IRC::Plugin::AutoJoin;
Next up is our POE session. We create it and list our event handlers. We then start the POE kernel.
POE::Session->create(
package_states => [
main => [ qw(_start irc_join) ]
]
);
$poe_kernel->run();
Now all we have to do is write the handlers for "_start" and "irc_join". In "_start", we create our IRC component, add an "AutoJoin"
plugin, register for the "irc_join" event, and connect to the IRC server.
sub _start {
my $irc = POE::Component::IRC::State->spawn(
Nick => 'basic_bot',
Server => 'irc.freenode.net',
);
$irc->plugin_add('AutoJoin', POE::Component::IRC::Plugin::AutoJoin->new(
Channels => [ '#test_channel1', '#test_channel2' ]
));
$irc->yield(register => 'join');
$irc->yield('connect');
}
Now comes our "irc_join" event handler. We send a message to the channel once we've joined it.
sub irc_join {
my $nick = (split /!/, $_[ARG0])[0];
my $channel = $_[ARG1];
my $irc = $_[SENDER]->get_heap();
# only send the message if we were the one joining
if ($nick eq $irc->nick_name()) {
$irc->yield(privmsg => $channel, 'Hi everybody!');
}
}
That's it!
AUTHOR
Hinrik Oern Sigur`sson, hinrik.sig@gmail.com
perl v5.14.2 2011-12-07 POE::Component::IRC::Cookbook::BasicBot(3pm)