Re: Sorting a list by...

2002-08-09 Thread Kevin Pfeiffer
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

Re: Need help

2002-08-09 Thread Todd Wade
"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

How does ZOMBIE/defunct affect the system?

2002-08-09 Thread Ahmed Moustafa
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:

Re: Sorting a list by...

2002-08-09 Thread Robin Norwood
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

Re: Need help

2002-08-09 Thread John W. Krahn
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

RE: Need help

2002-08-09 Thread Shah, Urmil
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/

RE: Need help

2002-08-09 Thread Najamuddin, Junaid
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

Re: Need help

2002-08-09 Thread Paul Johnson
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

Sorting a list by...

2002-08-09 Thread Samuel Brown
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

RE: Need help

2002-08-09 Thread Kirby_Sarah
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

Need help

2002-08-09 Thread Najamuddin, Junaid
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

Re: DBD::CSV question

2002-08-09 Thread Michael Fowler
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

DBD::CSV question

2002-08-09 Thread Gregg O'Donnell
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

RE: printing to the top of a file

2002-08-09 Thread NYIMI Jose (BMB)
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

Re: Dymanically "use"

2002-08-09 Thread Janek Schleicher
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

Re: printing to the top of a file

2002-08-09 Thread Janek Schleicher
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

GD::Graph logo_resize question

2002-08-09 Thread Kevin Old
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

RE: use of uninitialised value...

2002-08-09 Thread Bob Showalter
> -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

Re: Dymanically "use"

2002-08-09 Thread chris
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

RE: getting STDERR output...

2002-08-09 Thread Sylvanie, Jean-Pierre
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

Re: Dymanically "use"

2002-08-09 Thread drieux
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

Re: Dymanically "use"

2002-08-09 Thread Chas Owens
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/

RE: splitting string

2002-08-09 Thread Timothy Johnson
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

RE: Deep copy

2002-08-09 Thread Nikola Janceski
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

RE: Dymanically "use"

2002-08-09 Thread NYIMI Jose (BMB)
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,

Re: splitting string

2002-08-09 Thread Dave K
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$

Dymanically "use"

2002-08-09 Thread RAHUL SHARMA
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.

RE: Deep copy

2002-08-09 Thread Nikola Janceski
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

RE: Deep copy

2002-08-09 Thread NYIMI Jose (BMB)
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

RE: splitting string

2002-08-09 Thread Timothy Johnson
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

Deep copy

2002-08-09 Thread Nikola Janceski
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 ---

RE: splitting string

2002-08-09 Thread Timothy Johnson
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

RE: splitting string

2002-08-09 Thread Kipp, James
> > 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

RE: splitting string

2002-08-09 Thread Timothy Johnson
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

splitting string

2002-08-09 Thread Javeed SAR
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 --->

RE: regx way

2002-08-09 Thread Felix Geerinckx
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;

RE: NAVER-MAILER@naver.com

2002-08-09 Thread Jerry Preston
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,

RE: regx way

2002-08-09 Thread Jerry Preston
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

Re: regx way

2002-08-09 Thread Felix Geerinckx
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

Re: piping to a perl script

2002-08-09 Thread drieux
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

RE: NAVER-MAILER@naver.com

2002-08-09 Thread Jayashankar Nelamane Srinivasarao
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

NAVER-MAILER@naver.com

2002-08-09 Thread Jerry Preston
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

regx way

2002-08-09 Thread Jerry Preston
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",

Re: piping to a perl script

2002-08-09 Thread Sudarshan Raghavan
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

piping to a perl script

2002-08-09 Thread Mat Harrison
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

Re: how to define default params for subroutines?

2002-08-09 Thread Felix Geerinckx
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

Re: printing to the top of a file

2002-08-09 Thread John W. Krahn
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_

Re: how to define default params for subroutines?

2002-08-09 Thread John W. Krahn
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;

Re: printing to the top of a file

2002-08-09 Thread John W. Krahn
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

Re: printing to the top of a file

2002-08-09 Thread Sudarshan Raghavan
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

Re: printing to the top of a file

2002-08-09 Thread Felix Geerinckx
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 to define default params for subroutines?

2002-08-09 Thread Michael Rauh
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

Re: use of uninitialised value...

2002-08-09 Thread John W. Krahn
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

printing to the top of a file

2002-08-09 Thread stephen . redding
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

Re: to terminate a perl program

2002-08-09 Thread Sudarshan Raghavan
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,

Re: use of uninitialised value...

2002-08-09 Thread Sudarshan Raghavan
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

to terminate a perl program

2002-08-09 Thread rohana
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]

use of uninitialised value...

2002-08-09 Thread Nandita Mullapudi
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

RE: beginner

2002-08-09 Thread NYIMI Jose (BMB)
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

beginner

2002-08-09 Thread Javeed SAR
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