Probably I am not seeing it or I am not using the "delete" correctly I had the following codes but it does not work for me
#!/bin/perl -w
...
@sysFile1 = (a_b, a_c, a_d);
@sysFile2 = (a_c, a_e, b_f);
foreach $line1 (@sysFile1){
trim(\$line1);
(my $tmp1, my $tmp2) = split/_/,... (6 Replies)
Hi,
I have learned some of the Unix commands a way back and not sure of how to code them when needed in certain way, especially sed command. Here is my situation. I have an xml file with several tags. most of the tags start on the same line and end on the same line. However, data for some tags... (8 Replies)
i want to delete the line which is not started with numeric in vim.
vim temp.txt
Volume in drive D is DATA
Volume Serial Number is 8C52-2055
Directory of D:\data\notes
02/16/2010 03:09 PM <DIR> .
02/16/2010 03:09 PM <DIR> ..
09/11/1999 03:03 AM ... (5 Replies)
How to delete last row in the file in PERL.
file1 has
a.output
b.output
c.output
d.output
e.output
expected output is
a.output
b.output
c.output
d.output (1 Reply)
Hi,
How to delete a file (if exists) using perl script.
I have used following script..
if ( -e $newfile) {
open (FILE, ">$newfile") || die "Cannot Open File\n";
print FILE;
close(FILE);
}
But it gives me error "Use of uninitialized value in print".
please help.
Thanks in... (1 Reply)
Hello All
I am implementing my task in Perl and i found an issue.
What i want to do is to remove files from the directory which were made 20 days back using Perl script (9 Replies)
im having an array @check which contains text ..i want to open the array and i have to delete lines starting from a word called "check1" till "check2"
for eg:-
check1 Use descriptive titles when posting. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt".... (0 Replies)
Hi all,
I need a Perl one liner which prints a newline into a .txt file, only where the line starts with "/mediawiki-1.19.0/". It should add the newline to the line before.
My problem is, when I try to realize this (with my little knowledge :rolleyes: ) i come to the point where the // are... (4 Replies)
Dear All,
could you please help me to remove \n characters after all other replacements have been done as in the code below:
{
#remove punctuation and starting whitespaces
gsub("]"," ");
$1=$1;
}
{
#print lines containing 'whatever'
if ($1=="whatever")
{print}
#print... (3 Replies)
I have a directory like below. Need help with Perl to delete all files under test1 except the one passed as parameters.The parameters will
always be the directories under test1 in the format below.
EX:
dir1/abc.txt,dir2/test.xml,dir3/dfb.txt,dir4/text.xml
test1
... (5 Replies)
Discussion started by: gaurav99
5 Replies
LEARN ABOUT DEBIAN
poe::component::irc::plugin::botaddressed
POE::Component::IRC::Plugin::BotAddressed(3pm) User Contributed Perl Documentation POE::Component::IRC::Plugin::BotAddressed(3pm)NAME
POE::Component::IRC::Plugin::BotAddressed - A PoCo-IRC plugin that generates events when you are addressed
SYNOPSIS
use POE::Component::IRC::Plugin::BotAddressed;
$irc->plugin_add( 'BotAddressed', POE::Component::IRC::Plugin::BotAddressed->new() );
sub irc_bot_addressed {
my ($kernel, $heap) = @_[KERNEL, HEAP];
my $nick = ( split /!/, $_[ARG0] )[0];
my $channel = $_[ARG1]->[0];
my $what = $_[ARG2];
print "$nick addressed me in channel $channel with the message '$what'
";
}
sub irc_bot_mentioned {
my ($nick) = ( split /!/, $_[ARG0] )[0];
my ($channel) = $_[ARG1]->[0];
my ($what) = $_[ARG2];
print "$nick mentioned my name in channel $channel with the message '$what'
";
}
DESCRIPTION
POE::Component::IRC::Plugin::BotAddressed is a POE::Component::IRC plugin. It watches for public channel traffic (i.e. "irc_public" and
"irc_ctcp_action") and will generate an "irc_bot_addressed", "irc_bot_mentioned" or "irc_bot_mentioned_action" event if its name comes up
in channel discussion.
METHODS
"new"
One optional argument:
'eat', set to true to make the plugin eat the "irc_public" / "irc_ctcp_action" event and only generate an appropriate event, default is
false.
Returns a plugin object suitable for feeding to POE::Component::IRC's "plugin_add" method.
OUTPUT EVENTS
"irc_bot_addressed"
Has the same parameters passed as "irc_ctcp_public". "ARG2" contains the message with the addressed nickname removed, ie. Assuming that
your bot is called LameBOT, and someone says 'LameBOT: dance for me', you will actually get 'dance for me'.
"irc_bot_mentioned"
Has the same parameters passed as "irc_public".
"irc_bot_mentioned_action"
Has the same parameters passed as "irc_ctcp_action".
AUTHOR
Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
perl v5.14.2 2011-12-07 POE::Component::IRC::Plugin::BotAddressed(3pm)