Robin Norwood writes:
> Samuel Brown <[EMAIL PROTECTED]> writes:
> > Hi ya,
> >
> > I'm teaching myself Perl and I have a log file around 1GB that I need
> > to sort by month | date | time | byte size. So far I have parse the log
> > for "bytes" since this is all that I need but I can't get it to
"Junaid Najamuddin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED].
net...
> Hi,
>
> Thanks in advance, if someone can help me out
> I am trying to read the last 10 lines of a log file. If the script finds a
> word ERROR it should email and log the event. If not then do nothing.
> So
If a Perl program generates ZOMBIE/defunct processes, how does that
affect the system?
Do the following code avoid the ZOMBIE/defunct?
#
do {
$pid = waitpid (-1, &WNOHANG);
} until $pid == -1;
#
Your help will be appreciated so much.
--
Ahmed Moustafa
--
To unsubscribe, e-mail:
Samuel Brown <[EMAIL PROTECTED]> writes:
> Hi ya,
>
> I'm teaching myself Perl and I have a log file around 1GB that I need to sort
> by month | date | time | byte size. So far I have parse the log for "bytes"
> since this is all that I need but I can't get it to sort like I want.
Well...
Fi
Junaid Najamuddin wrote:
>
> Hi,
Hello,
> Thanks in advance, if someone can help me out
> I am trying to read the last 10 lines of a log file. If the script finds a
> word ERROR it should email and log the event. If not then do nothing.
> Some how the other first part is working
> If it finds t
Remove the $cnt++ from the first if loop and put it outside the if and else
loop..
open(INFILE, "$File");
$size = @lines = ();
close (INFILE);
$cnt = 0;
$tail = 10;
foreach (@lines)
{
if (($cnt >($size - $tail)) and (/\berror\b/
Sorry, log file is enclosed please
-Original Message-
From: Kirby_Sarah [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 5:04 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Need help
Mabe you could send a sample of the log file as well?
-Original Message-
From: Najamuddin, J
On Fri, Aug 09, 2002 at 04:22:45PM -0500, Najamuddin, Junaid wrote:
> Thanks in advance, if someone can help me out
> I am trying to read the last 10 lines of a log file. If the script finds a
> word ERROR it should email and log the event. If not then do nothing.
> Some how the other first part
Hi ya,
I'm teaching myself Perl and I have a log file around 1GB that I need to sort
by month | date | time | byte size. So far I have parse the log for "bytes"
since this is all that I need but I can't get it to sort like I want.
Here is the Data I parsed for bytes but now I need to sort by m
Mabe you could send a sample of the log file as well?
-Original Message-
From: Najamuddin, Junaid [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 5:23 PM
To: '[EMAIL PROTECTED]'
Subject: Need help
Hi,
Thanks in advance, if someone can help me out
I am trying to read the la
Hi,
Thanks in advance, if someone can help me out
I am trying to read the last 10 lines of a log file. If the script finds a
word ERROR it should email and log the event. If not then do nothing.
Some how the other first part is working
If it finds the word ERROR it does what needs to be done
On Fri, Aug 09, 2002 at 11:32:38AM -0700, Gregg O'Donnell wrote:
>
> Do I need to define "my $table ="
Um, yes. There's nothing magical about how you're using $table, it's just
like using any other variable, which means you have to define it. You could
also just insert "logger" directly into t
Hey - I'm trying to put this together from studying the perldoc. Do I need to define
"my $table =" and if so, to the csv file? Also, the number of scalars should equal the
number of question marks?
use DBI;
my $dbh = DBI->connect(qq{DBI:CSV:csv_sep_char=\\;});
my $dbh->{'csv_tables'}->{'logge
Oh yes !
The magic Tie ...
Enjoy!
José.
-Original Message-
From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 5:45 PM
To: [EMAIL PROTECTED]
Subject: Re: printing to the top of a file
Stephen Redding wrote at Fri, 09 Aug 2002 10:54:01 +0200:
> I have a t
Rahul Sharma wrote at Fri, 09 Aug 2002 10:37:14 +0200:
> I want to "use" a module whose filename is into some variable.
>
> For e.g.
>
> use $filename; # $filename contains the modulename that is to be imported.
>From perldoc -f use
It is exactly equivalent to
BEGIN { require Module; im
Stephen Redding wrote at Fri, 09 Aug 2002 10:54:01 +0200:
> I have a text file that i want to insert two lines to the top of.
> how do i do this?
A solution where it's not necessary to think is to use the
Tie::File module.
use Tie::File;
tie my @line, 'Tie::File', 'filename.txt' or die "...";
u
Hello everyone,
I've got a quick question about using the logo_resize option in the
GD::Graph package.
My code is:
use GD::Graph::bars;
use CGI qw(:standard);
@data = (
["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"],
[1,2,5,6,3, 1.5,1, 3, 4
> -Original Message-
> From: Nandita Mullapudi [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 08, 2002 3:49 PM
> To: [EMAIL PROTECTED]
> Subject: use of uninitialised value...
>
>
> i'm trying to run a perl script written to parse a file, and
> it runs fine
> the way it is written
module for use must be a bareword.
Try
require $filename;
On Fri, 9 Aug 2002 14:07:14 +0530, [EMAIL PROTECTED] (Rahul
Sharma) wrote:
>Hi All,
>
>I want to "use" a module whose filename is into some variable.
>
>For e.g.
>
>use $filename; # $filename contains the modulename that is to be imp
Thanks to you all for your answers !
jp.
-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 08, 2002 6:36 PM
To: [EMAIL PROTECTED]
Subject: Re: getting STDERR output...
Jean-Pierre Sylvanie wrote:
>
> Hi guys,
Hello,
> Actually I want to get ST
On Friday, August 9, 2002, at 01:37 , RAHUL SHARMA wrote:
> Hi All,
>
> I want to "use" a module whose filename is into some variable.
>
> For e.g.
>
> use $filename; # $filename contains the modulename that is to be
> imported.
think about when 'use' is dealt with by perl -
it is done in th
On Fri, 2002-08-09 at 04:37, RAHUL SHARMA wrote:
> Hi All,
>
> I want to "use" a module whose filename is into some variable.
>
> For e.g.
>
> use $filename; # $filename contains the modulename that is to be imported.
>
> I'm getting an error.
>
> Please help.
Try something like:
#!/usr/
That was my typo. The correct statement is
($var1,$var2,$var3,$var4,$var5) = split(/\\/,$FNAME);
The backslash is uset to escape other characters, so two backslashes must be
used.
Again, though, please post to the list. I am at work, and can't always
answer, and I don't even always have
http://www.stonehenge.com/merlyn/UnixReview/col30.html
Found it. Interesting read once you get into large complex data structures.
> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 09, 2002 9:46 AM
> To: 'NYIMI Jose (BMB)'; Nikola Janceski; Be
perldoc -f require
Example:
$filename="/home/me/lib/Foo.pm";
eval "require $filename";
HTH,
José.
-Original Message-
From: RAHUL SHARMA [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 10:37 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Dymanically "use"
Hi All,
Try:
use File::Basename;
my $direx = 'E:/Perl/bin/extra/nodir/hi.txt';
my ($name, $path, $suffix, @stuff);
while (1) {
($name, $path, $suffix) = fileparse($direx);
last if $name eq '.';
print "Name is $name\n";
push @stuff, $name;
chop($path);
$direx = $path;
}
foreach (@stuff) {
print"\t$
Hi All,
I want to "use" a module whose filename is into some variable.
For e.g.
use $filename; # $filename contains the modulename that is to be imported.
I'm getting an error.
Please help.
Deep copy.
I have a data structure (hashes of hashes)
I want to make a real/deep copy of the values to store elsewhere.
So when I change the values of one, the references don't point to the same
values as the original data structure.
hence deep copy.
> -Original Message-
> From: NYIMI Jo
What you mean by deep copy ?
Be more clear :-)
José.
-Original Message-
From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 3:40 PM
To: Beginners (E-mail)
Subject: Deep copy
Hey anyone have the link handy that explained deep copying and had the simplest litt
You should direct your questions to the list. I will help you if I can.
You might also want to post more code. The line you are referring to has
nothing to do with your original question. What syntax are you using?
-Original Message-
From: Javeed SAR [mailto:[EMAIL PROTECTED]]
Sent: Fr
Hey anyone have the link handy that explained deep copying and had the
simplest little code snip to make deep copies?
Nikola Janceski
We are such stuff as dreams are made on, rounded with a little sleep.
-- William Shakespeare
---
Then something like this:
my($var1,$var2,$var3,$var4,$var5) = split(/\/,$string);
BTW, to avoid confusion, you should probably be referring to "one variable"
as "one scalar", or something more specific.
-Original Message-
From: Javeed SAR [mailto:[EMAIL PROTECTED]]
Sent: Friday, Augus
>
> I think your subject answers your question: split() the string.
>
> E.g. @path = split(/\/,$string);
>
> should give you the right result.
yep and to take a step further:
($var1, $var2, $var3...) = split(/\/,$string);
>
> -Original Message-
> From: Javeed SAR [mailto:[EMAIL PRO
I think your subject answers your question: split() the string.
E.g. @path = split(/\/,$string);
should give you the right result.
-Original Message-
From: Javeed SAR [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 2:07 PM
To: [EMAIL PROTECTED]
Subject: splitting string
hi
hi All,
I have string as given below:
M:\sun1\train\test\Soarian_Context_Sensitive_Coordination_File
>From this string i need to split indivually and get
Soarian_Context_Sensitive_Coordination_File ---> in one variable.
test
--->
on Fri, 09 Aug 2002 12:35:25 GMT, [EMAIL PROTECTED] (Jerry Preston)
wrote:
> Thanks about "^^^". I forget to say that I will not know what the
> date is, anyone can change it.
If you don't have other 6-digit substrings in your input string, you
can use
#! /usr/bin/perl -w
use strict;
Jay,
It is in Korean!
Jerry
-Original Message-
From: Jayashankar Nelamane Srinivasarao
[mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 7:00 AM
To: 'Beginners Perl'
Subject: RE: [EMAIL PROTECTED]
Hi all
This is hapens to me also. The mail comes from this very same email id,
Felix,
Thanks about "^^^". I forget to say that I will not know what the date is,
anyone can change it.
Tanks,
Jerry
-Original Message-
From: Felix Geerinckx [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 6:55 AM
To: [EMAIL PROTECTED]
Subject: Re: regx way
on Fri, 09 Aug 2
on Fri, 09 Aug 2002 11:30:54 GMT, [EMAIL PROTECTED] (Jerry Preston)
wrote:
> I am looking for a simple way to replace a date in a string:
>
>"%makesql(FORD,waf_end,010602 &nowdate,all,0,pdv.CHEVY);\n",
>
> to
>"%makesql(FORD,waf_end,0
On Friday, August 9, 2002, at 01:38 , Mat Harrison wrote:
> hi, i am trying to get an email to feed a perl script.
>
> I have aliased the email address to pipe to the program but nothing. What
> variables should I be looking in to get the data that is piped? for
> example,
> command line argume
Hi all
This is hapens to me also. The mail comes from this very same email id,
but also will totally specially characters.
Regards
Jay
-Original Message-
From: Jerry Preston [mailto:[EMAIL PROTECTED]]
Sent: 09 August 2002 17:07
To: Beginners Perl
Subject: [EMAIL PROTECTED]
Hey!!
Eve
Hey!!
Every time I send an e-mail to Beginners I get an e-mail
[EMAIL PROTECTED], and my e-mail admin says that it contains a
viruses!!
Any ideas what is going on??
Jerry
Hi!
I am looking for a simple way to replace a date in a string:
"%makesql(FORD,waf_end,010602 &nowdate,all,0,pdv.CHEVY);\n",
to
"%makesql(FORD,waf_end,080902 &nowdate,all,0,pdv.CHEVY);\n",
On Fri, 9 Aug 2002, Mat Harrison wrote:
> hi, i am trying to get an email to feed a perl script.
>
> I have aliased the email address to pipe to the program but nothing. What
> variables should I be looking in to get the data that is piped? for example,
> command line arguments are in @ARGV. I
hi, i am trying to get an email to feed a perl script.
I have aliased the email address to pipe to the program but nothing. What
variables should I be looking in to get the data that is piped? for example,
command line arguments are in @ARGV. Is it something to do with $&?
I need to be able to
on Fri, 09 Aug 2002 09:11:24 GMT, [EMAIL PROTECTED] (John W. Krahn)
wrote:
> sub mysub {
> my $a = shift;
> my $b = shift || 5;
> }
This only works when 0 or '' are not allowed for the second
parameter.
my $a = $_[0];
my $b = defined($_[1]) ? $_[1] : 5;
takes care of this.
An e
Stephen Redding wrote:
>
> Hi
Hello,
> I have a text file that i want to insert two lines to the top of.
> how do i do this?
#!/usr/bin/perl -w
use strict;
use Fcntl ':seek';
my $file = 'text_file.txt';
open FILE, "+< $file" or die "Cannot open $file: $!";
my @lines = ;
seek FILE, 0, SEEK_
Michael Rauh wrote:
>
> how can one define default parameters for subroutines?
>
> something like:
> sub mysub($a, $b=5)
> {}
No.
> or do i have to do a check like this after entering the sub:
> sub mysub
> {
> ($a, $b) = @_;
> if (!$b) {$b=5;}
> }
Yes, or:
sub mysub {
my $a = shift;
Stephen Redding wrote:
>
> Hi
Hello,
> I have a text file that i want to insert two lines to the top of.
> how do i do this?
perl -i~ -pe'$.==1 and s/^/new line one\nnew line two\n/' text_file
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additiona
On Fri, 9 Aug 2002 [EMAIL PROTECTED] wrote:
> Hi
>
> I have a text file that i want to insert two lines to the top of.
> how do i do this?
>From the command line you can do this, this will retain you original
file as filename~
perl -i~ -pe 'print "line1\nline2\n" if ($. == 1)'
If you want to
on Fri, 09 Aug 2002 08:54:01 GMT, [EMAIL PROTECTED] (Stephen
Redding) wrote:
> I have a text file that i want to insert two lines to the top of.
> how do i do this?
This is frequently asked question (FAQ).
You can look up the answer by typing the following at your command
prompt:
perldoc
how can one define default parameters for subroutines?
something like:
sub mysub($a, $b=5)
{}
or do i have to do a check like this after entering the sub:
sub mysub
{
($a, $b) = @_;
if (!$b) {$b=5;}
}
thx for help!
michael
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additi
Nandita Mullapudi wrote:
>
> i'm trying to run a perl script written to parse a file, and it runs fine
> the way it is written, however, after making little changes to accomodate
> my file, i get inundated with the following message
>
> "Use of uninitialized value in hash element at modif2.pl li
Hi
I have a text file that i want to insert two lines to the top of.
how do i do this?
Stephen Redding
BT Ignite Solutions
Telephone - 0113 237 3277
Fax - 0113 244 1413
Email - [EMAIL PROTECTED]
http://www.technet.bt.com/sit/public/
British Telecommunications plc
Registered office: 81 Newgate
On Fri, 9 Aug 2002 [EMAIL PROTECTED] wrote:
> Dear all,
>
> I am running two perl programs simultaneously. I want to stop
> second whenever the first one stops. How could I do this, your kind
> help is highly appreciated.
If you have the pid of the other process
perldoc -f kill
>
> regards,
On Thu, 8 Aug 2002, Nandita Mullapudi wrote:
> i'm trying to run a perl script written to parse a file, and it runs fine
> the way it is written, however, after making little changes to accomodate
> my file, i get inundated with the following message
>
> "Use of uninitialized value in hash eleme
Dear all,
I am running two perl programs simultaneously. I want to stop
second whenever the first one stops. How could I do this, your kind
help is highly appreciated.
regards,
Rohana.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
i'm trying to run a perl script written to parse a file, and it runs fine
the way it is written, however, after making little changes to accomodate
my file, i get inundated with the following message
"Use of uninitialized value in hash element at modif2.pl line 90"
can any1 tell me what this mea
perldoc GetOpt::Long
Example:
#!/usr/local/bin/perl -w
use strict;
use Getopt::Long;
my $var='';
&GetOptions('unreserved' => \$var);
print "coucou\n" if($var);
__END__
HTH,
José.
-Original Message-
From: Javeed SAR [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 8:56 AM
Hi,
I am giving a command in command prompt:
c>ct checkout -unreserved.
i want to do this:
see if -unreserved exists in command prompt , if it exist just exit.
How to grep the word -unreservedin perl from the above command
line?
Regards
Javeed
60 matches
Mail list logo