file lock unnecessary?

2007-04-25 Thread Varjü Tamás
Hello everyone! I have written a perl script which opens a file for reading and writing. I tested what happens if the script is run in multiple instances by the webserver. I put a sleep command between seeking writing position in the file and actual writing. I filled the web form in two

Re: file lock unnecessary?

2007-04-25 Thread Greg Jetter
On Wednesday April 25 2007 6:14 am, Varjü Tamás wrote: Hello everyone! I have written a perl script which opens a file for reading and writing. I tested what happens if the script is run in multiple instances by the webserver. I put a sleep command between seeking writing position in the

Re: file lock unnecessary?

2007-04-25 Thread Greg Jetter
On Wednesday April 25 2007 8:42 am, Varjü Tamás wrote: Dear Greg! The reason I did the test, and why I detailed the result is that I could not reproduce any of the nasty things which can happen without locking. I know that everyone suggests to use the lock, but following your argument the

Re: Sort + Use of uninitialized value

2007-04-25 Thread Owen Cook
On Wed, Apr 25, 2007 at 01:37:24AM -0400, yitzle wrote: Warning message: Use of uninitialized value in numeric comparison (=) at ... Code: foreach (sort { $dHash{$b}{'VAL} = $dHash{$a}{'VAL'} } keys %dHash) { perhaps foreach (sort { $dHash{$b}{'VAL'} = $dHash{$a}{'VAL'} }

need help in module

2007-04-25 Thread Sayed, Irfan \(Irfan\)
HI All, I need to use CQPerlExt module in my Perl script. I searched CPAN but did not find anything. Can anybody plz help me in getting this.. Regards Irfan.

Re: need help in module

2007-04-25 Thread 万朝伟
Sayed, Irfan (Irfan) 写道: HI All, I need to use CQPerlExt module in my Perl script. I searched CPAN but did not find anything. Can anybody plz help me in getting this.. Regards Irfan. IBM Rational ClearQuest -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: How to sum up values

2007-04-25 Thread Stanislav Nedelchev
Rob Dixon wrote: Andrej Kastrin wrote: Dear all, Question about the sum function; the file structure is as follows: A|100 A|200 A|150 B|20 B|90 C|10 C|30 C|300 The result I want to obtain is to sum values in the second column (columnB) for each particular letter in the first column

Killing a process created using system

2007-04-25 Thread Nath, Alok (STSD)
Hi, Can I send a kill signal to a process which is created using system call ? Basically I wanted to send a CTRL-C signal to the process created by system call (of course in the same program). Something like this : sub test()

Re: Killing a process created using system

2007-04-25 Thread Owen Cook
On Wed, Apr 25, 2007 at 03:12:38PM +0530, Nath, Alok (STSD) wrote: Hi, Can I send a kill signal to a process which is created using system call ? Basically I wanted to send a CTRL-C signal to the process created by system call (of course in the same program).

Re: Reading and matching email ids

2007-04-25 Thread Saravana Kumar
Saravana Kumar wrote: yitzle wrote: You can read one list into an array (@list) and then loop through the other file ($item) and grep the list for the item. for ($item = ) { # or foreach print $item found if ( grep $item, @list ); } On 4/20/07, Saravana Kumar [EMAIL PROTECTED]

Re: How to sum up values

2007-04-25 Thread Rob Dixon
Stanislav Nedelchev wrote: Rob Dixon wrote: Andrej Kastrin wrote: Dear all, Question about the sum function; the file structure is as follows: A|100 A|200 A|150 B|20 B|90 C|10 C|30 C|300 The result I want to obtain is to sum values in the second column (columnB) for each particular letter

Re: Math::BigFloat

2007-04-25 Thread Somu
Actually the following isnt working: use Math::BigFloat; $n = 0; if ($n-is_zero()) {print 'you entered zero'} On 4/25/07, Tom Phoenix [EMAIL PROTECTED] wrote: On 4/24/07, Somu [EMAIL PROTECTED] wrote: I'm unable to compare numbers using the module. Actually i can only use it to create

Verified for Spam -RODIN- I2R: Howto Create An Acti onable Button with CGI.pm

2007-04-25 Thread Wijaya Edward
Hi all, I was resorting to this verbatim html print to do the task: print qq(FORM METHOD=POST ACTION=myscript.cgi\n); print qq(INPUT type=hidden NAME=analysis VALUE=Light\n); print qq(INPUT type=hidden NAME=organism VALUE=$orgname\n); print qq(INPUT type=hidden NAME=sequence VALUE=$fname

RE: Killing a process created using system

2007-04-25 Thread Nath, Alok (STSD)
Hi, But for this you need to know the process id. The system command doesn't returns, I think ? ~AN. -Original Message- From: Owen Cook [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 25, 2007 4:02 PM To: beginners@perl.org Subject: Re: Killing a process created using system On Wed,

Re: Math::BigFloat

2007-04-25 Thread Chas Owens
On 4/25/07, Somu [EMAIL PROTECTED] wrote: Actually the following isnt working: use Math::BigFloat; $n = 0; if ($n-is_zero()) {print 'you entered zero'} snip Umm, that is because $n is not a Math::BigFloat. Math::BigFloat is not a pragma, it is a class that overloads the math operators so

Re: Killing a process created using system

2007-04-25 Thread Chas Owens
On 4/25/07, Nath, Alok (STSD) [EMAIL PROTECTED] wrote: Hi, But for this you need to know the process id. The system command doesn't returns, I think ? ~AN. Take a look at the alarm function. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Verified for Spam -RODIN- I2R: Howto Create An Actionable Button with CGI.pm

2007-04-25 Thread Rob Dixon
Wijaya Edward wrote: Hi all, I was resorting to this verbatim html print to do the task: print qq(FORM METHOD=POST ACTION=myscript.cgi\n); print qq(INPUT type=hidden NAME=analysis VALUE=Light\n); print qq(INPUT type=hidden NAME=organism VALUE=$orgname\n); print qq(INPUT type=hidden

Re: Sort + Use of uninitialized value

2007-04-25 Thread Chas Owens
On 4/25/07, yitzle [EMAIL PROTECTED] wrote: Warning message: Use of uninitialized value in numeric comparison (=) at ... Code: foreach (sort { $dHash{$b}{'VAL} = $dHash{$a}{'VAL'} } keys %dHash) { How do I fix? Should my sort function be checking for variable defined? What do I return on

Regexp

2007-04-25 Thread Somu
why wont the following work? $q = shift; $p = pass; if ( $q =~ m/$p/i ) { print 'match' } But it works on changing the $q and $p places.. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Regexp

2007-04-25 Thread Beginner
On 25 Apr 2007 at 18:58, Somu wrote: why wont the following work? $q = shift; $p = pass; if ( $q =~ m/$p/i ) { print 'match' } But it works on changing the $q and $p places.. Not sure but it works for me. #!/bin/perl use strict; use warnings; my $q = shift; my $p = pass; if (

Re: Regexp

2007-04-25 Thread Chas Owens
On 4/25/07, Somu [EMAIL PROTECTED] wrote: why wont the following work? $q = shift; $p = pass; if ( $q =~ m/$p/i ) { print 'match' } But it works on changing the $q and $p places.. Since we don't know what $q is we can't really help you. Please produce a repeatable test. -- To

Re: Regexp

2007-04-25 Thread Rob Dixon
Somu wrote: why wont the following work? $q = shift; $p = pass; if ( $q =~ m/$p/i ) { print 'match' } But it works on changing the $q and $p places.. This will output 'match' if the string in $q contains the string 'pass' anywhere within it, in either (or mixed) case. What do you think is

Re: need help in module

2007-04-25 Thread Tom Phoenix
On 4/25/07, Sayed, Irfan (Irfan) [EMAIL PROTECTED] wrote: I need to use CQPerlExt module in my Perl script. I searched CPAN but did not find anything. http://www-1.ibm.com/support/docview.wss?uid=swg21129877 Cheers! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail:

Re: Killing a process created using system

2007-04-25 Thread Tom Phoenix
On 4/25/07, Nath, Alok (STSD) [EMAIL PROTECTED] wrote: Can I send a kill signal to a process which is created using system call ? No. system() won't return while the child process is still running. If you have the process running in parallel (such as with fork, or a piped

Re: Sort + Use of uninitialized value

2007-04-25 Thread yitzle
Inside the loop I check if the value is defined, so I don't care where in the order the undefined one shows up in. I don't want to delete undefined ones or anything... On 4/25/07, Chas Owens [EMAIL PROTECTED] wrote: On 4/25/07, yitzle [EMAIL PROTECTED] wrote: Warning message: Use of

Re: Sort + Use of uninitialized value

2007-04-25 Thread Tom Phoenix
On 4/24/07, yitzle [EMAIL PROTECTED] wrote: Warning message: Use of uninitialized value in numeric comparison (=) at ... Code: foreach (sort { $dHash{$b}{'VAL} = $dHash{$a}{'VAL'} } keys %dHash) { How do I fix? Give it an initialized value. Maybe like this? sort { ($dHash{$b}{VAL} || 0) =

Re: Sort + Use of uninitialized value

2007-04-25 Thread Chas Owens
On 4/25/07, yitzle [EMAIL PROTECTED] wrote: Inside the loop I check if the value is defined, so I don't care where in the order the undefined one shows up in. I don't want to delete undefined ones or anything... Then you can either turn off the warnings for that section (not advised), ignore

Re: Sort + Use of uninitialized value

2007-04-25 Thread Rob Dixon
yitzle wrote: On 4/25/07, Chas Owens [EMAIL PROTECTED] wrote: On 4/25/07, yitzle [EMAIL PROTECTED] wrote: Warning message: Use of uninitialized value in numeric comparison (=) at ... Code: foreach (sort { $dHash{$b}{'VAL} = $dHash{$a}{'VAL'} } keys %dHash) { How do I fix? Should my sort

Re: Sort + Use of uninitialized value

2007-04-25 Thread Rob Dixon
yitzle wrote: Inside the loop I check if the value is defined, so I don't care where in the order the undefined one shows up in. I don't want to delete undefined ones or anything... On 4/25/07, Chas Owens [EMAIL PROTECTED] wrote: On 4/25/07, yitzle [EMAIL PROTECTED] wrote: Warning message:

Re: Sort + Use of uninitialized value

2007-04-25 Thread yitzle
In that case just create a list of the keys with a defined VAL value before you do the sort: my @keys = grep defined $dHash{$_}{VAL}, keys %dHash; foreach (sort { $dHash{$b}{VAL} = $dHash{$a}{VAL} } @keys) { print $_, \n; } HTH, Rob This solution appeals to me. I'll use it.

Re: Math::BigFloat

2007-04-25 Thread Rob Dixon
Somu wrote: On 4/25/07, Tom Phoenix [EMAIL PROTECTED] wrote: On 4/24/07, Somu [EMAIL PROTECTED] wrote: I'm unable to compare numbers using the module. Actually i can only use it to create numbers like 0 or inf or 1 or their negatives. But i dont know how to use their methods. Bcoz the

Re: Sort + Use of uninitialized value

2007-04-25 Thread Rob Dixon
yitzle wrote: P.S. What's HTH? Hope This Helps :) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Perl error

2007-04-25 Thread Kevin Viel
John W. Krahn wrote: The warnings pragma was introduced in Perl version 5.6 perldoc perl56delta If you are using Perl version 5.005_03 then you will have to use the -w switch instead like: #!/usr/bin/perl -w John, Thanks. I have been using this program without problem for a while,

What's HTH?

2007-04-25 Thread Tom Phoenix
On 4/25/07, yitzle [EMAIL PROTECTED] wrote: P.S. What's HTH? http://www.google.com/search?q=What+does+hth+stand+for%3F Cheers! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: What's HTH?

2007-04-25 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Believe it is 'Hope this helps!'. If you have any problems or questions, please let me know. Thanks. Wags ;) David R Wagner Senior Programmer Analyst FedEx Freight 1.408.323.4225x2224 TEL 1.408.323.4449 FAX http://fedex.com/us -Original Message-

Re: What's HTH?

2007-04-25 Thread Steve Bertrand
Tom Phoenix wrote: On 4/25/07, yitzle [EMAIL PROTECTED] wrote: P.S. What's HTH? http://www.google.com/search?q=What+does+hth+stand+for%3F In a different context, every once in a while, I've seen it used as 'How The Hell', but most certainly know it as how the link describes it above.

RegEx Substitution + Arrays

2007-04-25 Thread yitzle
What's the best way to apply a RegEx to an array? For loop? @arr = qw/dc2ds reew12dsfa df2fdw/; s/$find/$replace/ for(@arr); Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

cat (.sh) in Perl

2007-04-25 Thread yitzle
`cat m.top.html m.mid.html m.arc.html m.bot.html blah` How can this be done without a system call? Here's my first guess: @doc = (); for (qw/m.top.html m.mid.html m.arc.html m.bot.html/) { open $FILE,,$root/$_; my @tmp = $FILE; @doc = (@doc,@tmp); close $FILE; }

Code Comments/Tips - Can this code be better?

2007-04-25 Thread yitzle
I got an input source that got records of fixed number of lines, eg Name, Address, Age, Phone, Cell I'm not interested in Age or Cell. I'm doing something along the lines of the following. Can I do better? my @lines = qw/name address age phone cell end/; my %process = {name=1, address=1,

Re: RegEx Substitution + Arrays

2007-04-25 Thread Rob Dixon
yitzle wrote: What's the best way to apply a RegEx to an array? For loop? @arr = qw/dc2ds reew12dsfa df2fdw/; s/$find/$replace/ for(@arr); Yes. Exactly that. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: cat (.sh) in Perl

2007-04-25 Thread Rob Dixon
yitzle wrote: `cat m.top.html m.mid.html m.arc.html m.bot.html blah` How can this be done without a system call? Here's my first guess: @doc = (); for (qw/m.top.html m.mid.html m.arc.html m.bot.html/) { open $FILE,,$root/$_; my @tmp = $FILE; @doc = (@doc,@tmp); close $FILE; }

File::Basename issues

2007-04-25 Thread Nishi
Hi: The File::Basename from 5.8.0 doesnot work in Perl 5.8.2 or Perl 5.8.7. Is there any particular reason. I have a script that uses the Basename module was running file with 5.8.0, but it doesnt work fine when i run the script in Perl 5.8.2 or Perl 5.8.7. I tried copying the basename.pm from

Re: cat (.sh) in Perl

2007-04-25 Thread John W. Krahn
yitzle wrote: `cat m.top.html m.mid.html m.arc.html m.bot.html blah` How can this be done without a system call? Here's my first guess: use warnings; use strict; @doc = (); my @doc; for (qw/m.top.html m.mid.html m.arc.html m.bot.html/) { open $FILE,,$root/$_; Where is $root

Re: RegEx Substitution + Arrays

2007-04-25 Thread John W. Krahn
yitzle wrote: What's the best way to apply a RegEx to an array? For loop? @arr = qw/dc2ds reew12dsfa df2fdw/; s/$find/$replace/ for(@arr); Yes, although the parentheses are redundant. John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools

basename equivalent?

2007-04-25 Thread Nishi
Hi: What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my $fileName=$path =~ /.*\/(.+)$/; Thanks!

Re: cat (.sh) in Perl

2007-04-25 Thread Seanie
yitzle wrote: `cat m.top.html m.mid.html m.arc.html m.bot.html blah` How can this be done without a system call? As a general rule, if your script contains 'system()' anywhere in it, you've done it wrong. This is especially true for simple file operations such as the above, and for anything

Re: Code Comments/Tips - Can this code be better?

2007-04-25 Thread John W. Krahn
yitzle wrote: I got an input source that got records of fixed number of lines, eg Name, Address, Age, Phone, Cell So you are saying that 'Name' appears on every fifth line and *always* on every fifth line? I'm not interested in Age or Cell. I'm doing something along the lines of the

Re: Code Comments/Tips - Can this code be better?

2007-04-25 Thread Rob Dixon
yitzle wrote: I got an input source that got records of fixed number of lines, eg Name, Address, Age, Phone, Cell I'm not interested in Age or Cell. I'm doing something along the lines of the following. Can I do better? my @lines = qw/name address age phone cell end/; my %process = {name=1,

Re: basename equivalent?

2007-04-25 Thread John W. Krahn
Nishi wrote: Hi: Hello, What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my $fileName=$path =~ /.*\/(.+)$/; Assuming that your file system uses / as the path separator: ( my

Re: basename equivalent?

2007-04-25 Thread Rob Dixon
Nishi wrote: What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my $fileName=$path =~ /.*\/(.+)$/; Why don't you try it?! It wouldn't work because $fileName would end up with

Re: Code Comments/Tips - Can this code be better?

2007-04-25 Thread Seanie
yitzle wrote: I got an input source that got records of fixed number of lines, eg Name, Address, Age, Phone, Cell I'm not interested in Age or Cell. I'm doing something along the lines of the following. Can I do better? my @lines = qw/name address age phone cell end/; my %process = {name=1,

Re: cat (.sh) in Perl

2007-04-25 Thread John W. Krahn
Seanie wrote: yitzle wrote: `cat m.top.html m.mid.html m.arc.html m.bot.html blah` How can this be done without a system call? As a general rule, if your script contains 'system()' anywhere in it, you've done it wrong. This is especially true for simple file operations such as the above,

Re: basename equivalent?

2007-04-25 Thread Nishi
On 4/25/07, John W. Krahn [EMAIL PROTECTED] wrote: Nishi wrote: Hi: Hello, What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my $fileName=$path =~ /.*\/(.+)$/; Assuming that

Re: basename equivalent?

2007-04-25 Thread Chas Owens
On 4/25/07, Nishi [EMAIL PROTECTED] wrote: Hi: What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my $fileName=$path =~ /.*\/(.+)$/; Thanks! There are many options, but none of

Re: File::Basename issues

2007-04-25 Thread Chas Owens
On 4/25/07, Nishi [EMAIL PROTECTED] wrote: Hi: The File::Basename from 5.8.0 doesnot work in Perl 5.8.2 or Perl 5.8.7. Is there any particular reason. I have a script that uses the Basename module was running file with 5.8.0, but it doesnt work fine when i run the script in Perl 5.8.2 or Perl

Re: RegEx Substitution + Arrays

2007-04-25 Thread Seanie
yitzle wrote: What's the best way to apply a RegEx to an array? For loop? @arr = qw/dc2ds reew12dsfa df2fdw/; s/$find/$replace/ for(@arr); Yep, you can do that. Or use map() map(s/$find/$replace/, @arr); -- [EMAIL PROTECTED] [pgp: 8A8FA6DE] -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: RegEx Substitution + Arrays

2007-04-25 Thread Chas Owens
On 4/25/07, Seanie [EMAIL PROTECTED] wrote: yitzle wrote: What's the best way to apply a RegEx to an array? For loop? @arr = qw/dc2ds reew12dsfa df2fdw/; s/$find/$replace/ for(@arr); Yep, you can do that. Or use map() map(s/$find/$replace/, @arr); You should not use map in a void context,

Re: cat (.sh) in Perl

2007-04-25 Thread Seanie
John W. Krahn wrote: Your syntax for the open() statements is a bit dodgy too :-) Perl defines the syntax so you must mean something else? :-) As in too much unnecessary typing and commas and such, which don't really add clarity, rather than incorrect You should also include the $! or $^E

Re: RegEx Substitution + Arrays

2007-04-25 Thread Seanie
Chas Owens wrote: map(s/$find/$replace/, @arr); You should not use map in a void context, it is bad form. Care to explain? Neither 'strict' nor 'warnings' complains, and it does what it says on the tin, but if I've missed something fundamental here I'd be grateful to know about it. --

Re: RegEx Substitution + Arrays

2007-04-25 Thread Rob Dixon
Seanie wrote: yitzle wrote: What's the best way to apply a RegEx to an array? For loop? @arr = qw/dc2ds reew12dsfa df2fdw/; s/$find/$replace/ for(@arr); Yep, you can do that. Or use map() map(s/$find/$replace/, @arr); Haha yes you can, but if you want to write nasty code go for grep

Re: RegEx Substitution + Arrays

2007-04-25 Thread Rob Dixon
Sean King wrote: Chas Owens wrote: map(s/$find/$replace/, @arr); You should not use map in a void context, it is bad form. Care to explain? Neither 'strict' nor 'warnings' complains, and it does what it says on the tin, but if I've missed something fundamental here I'd be grateful to know

Re: RegEx Substitution + Arrays

2007-04-25 Thread Seanie
Rob Dixon wrote: map(s/$find/$replace/, @arr); Haha yes you can, but if you want to write nasty code go for grep s/$find/$replace/, @arr; which also works. True, but grep implies find stuff, while map implies do stuff, so your nasty code is way, way, nastier than mine - it masks the

Re: cat (.sh) in Perl

2007-04-25 Thread John W. Krahn
Seanie wrote: John W. Krahn wrote: Your syntax for the open() statements is a bit dodgy too :-) Perl defines the syntax so you must mean something else? :-) As in too much unnecessary typing and commas and such, which don't really add clarity, rather than incorrect The OP's open

Re: RegEx Substitution + Arrays

2007-04-25 Thread John W. Krahn
Seanie wrote: Rob Dixon wrote: map(s/$find/$replace/, @arr); Haha yes you can, but if you want to write nasty code go for grep s/$find/$replace/, @arr; which also works. True, but grep implies find stuff, while map implies do stuff, so your nasty code is way, way, nastier than mine -

Re: RegEx Substitution + Arrays

2007-04-25 Thread Chas Owens
On 4/25/07, John W. Krahn [EMAIL PROTECTED] wrote: Seanie wrote: Rob Dixon wrote: map(s/$find/$replace/, @arr); Haha yes you can, but if you want to write nasty code go for grep s/$find/$replace/, @arr; which also works. True, but grep implies find stuff, while map implies do stuff, so

Reading and comparing with a criteria file

2007-04-25 Thread Chad Kemp
Hello all. I have a question regarding reading in a criteria file, storing that criteria in memory and reading in user IDs from another file periodically, comparing attributes associated to that ID to the criteria i have stored, and placing those IDs which match into groups defined by the

Re: Code Comments/Tips - Can this code be better?

2007-04-25 Thread yitzle
Sorry. The input file has one item per line. Line 1,6,11,etc has names #1,2,3,.. Line 2,7,12 has addresses #1,2,3... I want to make a hash of hashed. hash{$name}{'address'} etc I hope that's clear enough... On 4/25/07, Seanie [EMAIL PROTECTED] wrote: yitzle wrote: I got an input source that

Re: basename equivalent?

2007-04-25 Thread Nishi
Rob: On 4/25/07, Rob Dixon [EMAIL PROTECTED] wrote: Nishi wrote: What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my $fileName=$path =~ /.*\/(.+)$/; Why don't you try it?!

Logging module in RHEL distro

2007-04-25 Thread Nath, Alok (STSD)
Hi, I am using perl which comes with RHEL distribution. I think the perl version is 5.8.5. I am not seeing any modules specific for message logging. Does it have any ? I am prohibited from installing any modules on top of my RHEL. Thanks Alok --

Re: basename equivalent?

2007-04-25 Thread yitzle
my ($name) = $path =~ m|([^/]+)$|; Shouldn't that be a =~ s|([^/]+)$|; not m? On 4/26/07, Nishi [EMAIL PROTECTED] wrote: Rob: On 4/25/07, Rob Dixon [EMAIL PROTECTED] wrote: Nishi wrote: What is the equivalent of basename? Ie if I dont want to use basename package to get the

Re: Logging module in RHEL distro

2007-04-25 Thread Chas Owens
On 4/26/07, Nath, Alok (STSD) [EMAIL PROTECTED] wrote: Hi, I am using perl which comes with RHEL distribution. I think the perl version is 5.8.5. I am not seeing any modules specific for message logging. Does it have any ? I am prohibited from installing

Re: basename equivalent?

2007-04-25 Thread Chas Owens
On 4/26/07, Nishi [EMAIL PROTECTED] wrote: Rob: On 4/25/07, Rob Dixon [EMAIL PROTECTED] wrote: Nishi wrote: What is the equivalent of basename? Ie if I dont want to use basename package to get the filename off a path, what reg expr can i use in perl? Would this work -- my

Re: basename equivalent?

2007-04-25 Thread Mumia W.
On 04/25/2007 11:59 PM, Nishi wrote: On 4/25/07, Rob Dixon [EMAIL PROTECTED] wrote: [...] my ($name) = $path =~ m|([^/]+)$|; I tried it, but somehow doesnt work for me, printing $name returns me the entire string such as C:\temp\abc\abc.txt and not abc.txt. Am I missing something?