how to parse the msqid_ds structure return from msgctl(ID, IPC_STAT, $msq_ds)

2006-04-25 Thread Eric Richardson
The docs state the following : == msgctl ID, CMD, ARG Calls the System V IPC function msgctl(2). You'll probably have to say use IPC::SysV; first to get the correct constant definitions. If CMD is IPC_STAT, then ARG must be a variable which will hold the

Maybe off-topic. Detecting code used

2006-04-25 Thread J. Alejandro Ceballos Z. -JOAL-
I am processing a file using Unicode::Transform module to change the coding from UTF-8 to Unicode. Exist some way to detect the code used in one file (utf8, unicode) in order to select if some transform action is needed? TIA, ,_,

Re: Split function help

2006-04-25 Thread Tom Allison
Irfan J Sayed wrote: Hi, I have a following line/statement stored in variable $test deliver.Admin_Irfan_Project.20060413.212355 i want to split this line in . and store in array. I am using following code my @name = Split(/./, $test); split uses regular expressions to identify where to

Re: truncate

2006-04-25 Thread Tom Allison
Smith, Derek wrote: I want to use truncate to delete a matched line out a named.conf file on my DNS box. Here is my code As others have said, this will lop off the end of the file. Another option is to run perl -i and edit the file in place. while(){ print if /Acheck\-names/ } But under

Re: golf

2006-04-25 Thread Dr.Ruud
M. Kristall schreef: Ruud: [ while(local $_ = ARGV) ] With while(), the $_ is already local. not! Wouldn't using that 'local' explicitly, add another local-layer? my $i = 5; $_ = 'Hi there!!!'; while ($_ = $i--) { print } print 543210 my $i = 5; $_ = 'Hi there!!!'; while (local $_ =

Re: Split function help

2006-04-25 Thread Mazhar
Dear Irfan, i think for the code you can try the below, ($some_thing1,$some_thing2,$something_3)=split($test,.) Regards Mazhar On 4/25/06, Tom Allison [EMAIL PROTECTED] wrote: Irfan J Sayed wrote: Hi, I have a following line/statement stored in variable $test

Help in checking the OS type...

2006-04-25 Thread Mazhar
Hi Folks, I need to develop a script where in i need to first check the type of OS and then go about in finding the drives. I need your help in getting an idea of how to start about this... Thanks in Advance Regards Mazhar

Re: Help in checking the OS type...

2006-04-25 Thread Mazhar
Paul, It lists me out the operating system name thanks for the same. How can i go about getting the different drives/volumes created on the same... Regards Mazhar On 4/25/06, Paul D. Kraus [EMAIL PROTECTED] wrote: On 4/25/06, Mazhar [EMAIL PROTECTED] wrote: Hi Folks, I need to

Re: Split function help

2006-04-25 Thread JupiterHost.Net
Mazhar wrote: Dear Irfan, i think for the code you can try the below, ($some_thing1,$some_thing2,$something_3)=split($test,.) You have the split arguments reversed :) Also, don't use double quotes when there is nothing to interpolate. And space them out so its easier to read :) And

Re: Help in checking the OS type...

2006-04-25 Thread Paul D. Kraus
On 4/25/06, Mazhar [EMAIL PROTECTED] wrote: Paul, It lists me out the operating system name thanks for the same. How can i go about getting the different drives/volumes created on the same... Regards Mazhar I am not entirely sure what you are trying to do. Can you give me an example of

Python - NOT TROLLING

2006-04-25 Thread Paul D. Kraus
I am picking up python and messing around with it and I always come running back to perl :) At any rate I am curious what the more experienced programmers think of the language and its uses. Best tool for the best job seems to be the slogan. So my question is what do people use python for that

RegEx (m//) Flinstones

2006-04-25 Thread Monomachus
I need a RegEx (!!!with modify(m//)) what matches the words what ends with 'a'. = I have a test_file (for ex.:) = beforematchafter wilma and nana Mrs. Wilma Flinstone hommie barney wilmafred wilmafred flinstone mamafred

Re: RegEx (m//) Flinstones

2006-04-25 Thread Mr. Shawn H. Corey
On Tue, 2006-25-04 at 17:36 +0400, Monomachus wrote: #!/usr/bin/perl -w use strict; my $i=1; while () { # take one input line at time chomp; if (/(\b\w*a\b)/) { This matches only the first occurrence. You will need a loop to match them all. print $1

Re: RegEx (m//) Flinstones

2006-04-25 Thread Jay Savage
On 4/25/06, Monomachus [EMAIL PROTECTED] wrote: I need a RegEx (!!!with modify(m//)) what matches the words what ends with 'a'. = I have a test_file (for ex.:) = beforematchafter wilma and nana Mrs. Wilma Flinstone hommie barney

perl help

2006-04-25 Thread Praveena Vittal
Hi All, I am newbie of perl joined in this group last month.I could like to know how could i develop my perl programming and my opinion is only reading the materials , and other documents related to perl does not matters.Is there any other way that makes me better in perl like

Re: perl help

2006-04-25 Thread Mr. Shawn H. Corey
On Tue, 2006-25-04 at 21:09 -0700, Praveena Vittal wrote: Hi All, I am newbie of perl joined in this group last month.I could like to know how could i develop my perl programming and my opinion is only reading the materials , and other documents related to perl does not matters.Is

Re: Help in checking the OS type...

2006-04-25 Thread Jay Savage
*Don't top post.* On 4/25/06, Mazhar [EMAIL PROTECTED] wrote: Paul, It lists me out the operating system name thanks for the same. How can i go about getting the different drives/volumes created on the same... Regards Mazhar On 4/25/06, Paul D. Kraus [EMAIL PROTECTED] wrote: On

How To Post (WAS: Help in checking the OS type...)

2006-04-25 Thread Mr. Shawn H. Corey
On Tue, 2006-25-04 at 13:38 -0400, Jay Savage wrote: *Don't top post.* *Prune your posts* Quote only what is important to your comments. Remove nested quotes (unless really, really important). Change the subject when you change the subject. -- __END__ Just my 0.0002 million dollars

sort {} to work with undef values when its expecting an object

2006-04-25 Thread JupiterHost.Net
Hello List, I have a sort() issue that is a bit odd and any input wouls be most appreciated :) The code: use strict; use warnings; ... for my $obj( sort { $a-value() cmp $b-value() || $a-part('Name')-value() cmp $b-part('Name')-value() } grep { defined }

Re: How To Post (WAS: Help in checking the OS type...)

2006-04-25 Thread Jay Savage
On 4/25/06, Mr. Shawn H. Corey [EMAIL PROTECTED] wrote: On Tue, 2006-25-04 at 13:38 -0400, Jay Savage wrote: *Don't top post.* *Prune your posts* Quote only what is important to your comments. Remove nested quotes (unless really, really important). Change the subject when you change the

Re: How To Post (WAS: Help in checking the OS type...)

2006-04-25 Thread Mr. Shawn H. Corey
On Tue, 2006-25-04 at 15:37 -0400, Jay Savage wrote: Seriously, though, go easy on the pruning. The rule of tumb is is that the message should include enough information that a person joining the thread can make sense of the response from the response itself. Unless the OP is particulalry

Re: sort {} to work with undef values when its expecting an object

2006-04-25 Thread Jay Savage
On 4/25/06, JupiterHost.Net [EMAIL PROTECTED] wrote: for my $obj( sort { $a-value() cmp $b-value() || $a-part('Name')-value() cmp $b-part('Name')-value() } grep { defined } @objects ) { ... $a/$b-value() always works since if $a/$b is defined

rm -rf in perl

2006-04-25 Thread Brian McKee
Is there a definative way to recreate the gnu `rm -rf` in perl? I've seen a couple of modules that seem to implement something, and a bunch of variations using File::Find, but it just seems overly complicated.Since it's important I understand exactly what it's going to do (it's removing data

Re: How To Post (WAS: Help in checking the OS type...)

2006-04-25 Thread Jay Savage
On 4/25/06, Mr. Shawn H. Corey [EMAIL PROTECTED] wrote: On Tue, 2006-25-04 at 15:37 -0400, Jay Savage wrote: Seriously, though, go easy on the pruning. The rule of tumb is is that the message should include enough information that a person joining the thread can make sense of the response

RE: rm -rf in perl

2006-04-25 Thread RICHARD FERNANDEZ
Is there a definative way to recreate the gnu `rm -rf` in perl? I've seen a couple of modules that seem to implement something, and a bunch of variations using File::Find, but it just seems overly complicated.Since it's important I understand exactly what it's going to do (it's removing

RE: sort {} to work with undef values when its expecting an object

2006-04-25 Thread Timothy Johnson
Just a thought, but couldn't you put the logic in your grep statement? Something like this: grep {defined($_-value()) or defined($_-part('Name')-value())} @objects; -Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 25, 2006 12:22 PM To:

Re: rm -rf in perl

2006-04-25 Thread Brian McKee
On 25/04/06, RICHARD FERNANDEZ [EMAIL PROTECTED] wrote: Is there a definative way to recreate the gnu `rm -rf` in perl? You could use rmtree. perldoc File::Path Looks good, but then I saw this: NOTE: There are race conditions internal to the implementation of rmtree making it unsafe

Problem while using Lingua::Wordnet...

2006-04-25 Thread Eugene Kosov
Hi, list! Had anybody problems with using Lingua::Wordnet? I have.. I have following simple test script: test.pl: 001: use Lingua::Wordnet; 002: my $dict = new Lingua::Wordnet('lib/Lingua/dict'); Lingua::Wordnet object creation fails with following error: Unable to load

Problem with using Lingua::Wordnet on Linux box

2006-04-25 Thread Косов Евгений
Hi, everybody! Has anybody had any problems with using Lingua::Wordnet on Linux? I have. I can't even open a dictionary. My script fails creating a Lingua::Wordnet object. [EMAIL PROTECTED] ~]$ cat test.pl #!/usr/bin/perl -w -Ilib use Lingua::Wordnet; Lingua::Wordnet-new('lib/Lingua/dict');

Re: Python - NOT TROLLING

2006-04-25 Thread Dave Gray
On 4/25/06, Paul D. Kraus [EMAIL PROTECTED] wrote: I am picking up python and messing around with it and I always come running back to perl :) At any rate I am curious what the more experienced programmers think of the language and its uses. One thing that a lot of people like about Python is

Re: rm -rf in perl

2006-04-25 Thread JupiterHost.Net
Brian McKee wrote: On 25/04/06, RICHARD FERNANDEZ [EMAIL PROTECTED] wrote: Is there a definative way to recreate the gnu `rm -rf` in perl? You could use rmtree. perldoc File::Path Looks good, but then I saw this: NOTE: There are race conditions internal to the implementation of

Re: sort {} to work with undef values when its expecting an object

2006-04-25 Thread JupiterHost.Net
Timothy Johnson wrote: Just a thought, but couldn't you put the logic in your grep statement? Something like this: grep {defined($_-value()) or defined($_-part('Name')-value())} @objects; The only problem is then that the object woudl be completely skipped. I need all objects regardless

Re: sort {} to work with undef values when its expecting an object

2006-04-25 Thread JupiterHost.Net
Jay Savage wrote: On 4/25/06, JupiterHost.Net [EMAIL PROTECTED] wrote: for my $obj( sort { $a-value() cmp $b-value() || $a-part('Name')-value() cmp $b-part('Name')-value() } grep { defined } @objects ) { ... $a/$b-value() always works since if $a/$b is

Re: rm -rf in perl

2006-04-25 Thread Mr. Shawn H. Corey
On Tue, 2006-25-04 at 16:41 -0500, JupiterHost.Net wrote: althought technically any rm -rf (ven the shell itself) has a race condition since it could clean out directory, move on and then, someone adds a file between cleaning out the directory and its removal. Sorry, there is no such race

Re: sort {} to work with undef values when its expecting an object

2006-04-25 Thread Tom Phoenix
On 4/25/06, JupiterHost.Net [EMAIL PROTECTED] wrote: sort { $a-value() cmp $b-value() || $a-part('Name')-value() cmp $b-part('Name')-value() } grep { defined } @objects But sometimes $a-part('Name') returns undef, so the sort fails. I need all

hashref slices

2006-04-25 Thread Ryan Perry
my $hashref; my @num=qw( 0 1 2 3 4 5 ); @hashref-[EMAIL PROTECTED] = ('one', 'two', 'three', 'four', 'five', 'six'); print join('\t', keys %{$hashref}), '\n; print join(\t, values %{$hashref}), '\n; How do I properly use hashref slices? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: hashref slices

2006-04-25 Thread John W. Krahn
Ryan Perry wrote: my $hashref; my @num=qw( 0 1 2 3 4 5 ); @hashref-[EMAIL PROTECTED] = ('one', 'two', 'three', 'four', 'five', 'six'); @{ $hashref [EMAIL PROTECTED] = ('one', 'two', 'three', 'four', 'five', 'six'); print join('\t', keys %{$hashref}), '\n; print join(\t, values

501 Protocol scheme 'http' is not supported

2006-04-25 Thread Sanchita Dahal
Hi, I am trying to run this ++ require LWP::UserAgent; my $ua = LWP::UserAgent-new; my $response = $ua-get('http://search.cpan.org/'); if ($response-is_success) { print $response-content; # or whatever } else { die $response-status_line; } * I

RE: 501 Protocol scheme 'http' is not supported

2006-04-25 Thread Sanchita Dahal
On 4/26/06, nishanth ev [EMAIL PROTECTED] wrote: Hello, Its not the error with the perl script. Your program ran perfect on my machine. Please let me know if you ran it as a cgi script after adding the shebang and other modifications or simply ran as perl script. Simply as a perl script

match file name at end of a http url

2006-04-25 Thread Ken Perl
If I want to use regular expression to extract the charactors after the last '/' in the url, but below regexpr doesn't work, what I do wrong? $url = 'http://website.com/path/file_name.img'; if (/\/.*$/) { print $url.is matched \n; } else { print failed; } -- perl -e 'print

Re: match file name at end of a http url

2006-04-25 Thread Tom Phoenix
On 4/25/06, Ken Perl [EMAIL PROTECTED] wrote: If I want to use regular expression to extract the charactors after the last '/' in the url, but below regexpr doesn't work, what I do wrong? You're not using a module from CPAN. There's one on there that understands the rules about URLs. How

Re: 501 Protocol scheme 'http' is not supported

2006-04-25 Thread Tom Phoenix
On 4/25/06, Sanchita Dahal [EMAIL PROTECTED] wrote: I am getting 501 Protocol scheme 'http' is not supported at test.pl line 11. error. Please help. It sounds as if LWP isn't properly installed. Can you get it to pass all the tests, and then re-install it? Good luck! --Tom Phoenix Stonehenge

Re: match file name at end of a http url

2006-04-25 Thread John Ackley
Ken Perl wrote: If I want to use regular expression to extract the charactors after the last '/' in the url, but below regexpr doesn't work, what I do wrong? $url = 'http://website.com/path/file_name.img'; if (/\/.*$/) { print $url.is matched \n; } else { print failed; } -- perl -e

Re: match file name at end of a http url

2006-04-25 Thread Tom Phoenix
On 4/25/06, John Ackley [EMAIL PROTECTED] wrote: if( $url =~ /\/(.*$)/ ) then characters after last / are found in $1 Unfortunately, characters after the first slash are in there, too. To process a URL requires more than a simple pattern match. Use a module from CPAN. Cheers! --Tom Phoenix

Re: match file name at end of a http url

2006-04-25 Thread nishanth ev
Hello, I tried this and worked. Please let me know in case you find any bugs in this :) $url=http://dev.catalyst.perl.org/wiki/YetAnotherCatalystIntro;; if( $url =~ /\/([\w.]*$)/ ){ print $1; } else{ print No Match; } Regards Nishanth --- Tom Phoenix [EMAIL PROTECTED] wrote:

Re: match file name at end of a http url

2006-04-25 Thread Tom Phoenix
On 4/25/06, nishanth ev [EMAIL PROTECTED] wrote: if( $url =~ /\/([\w.]*$)/ ){ print $1; } http://example.com/some-file.txt To process a URL requires more than a simple pattern match. Use a module from CPAN. Cheers! What I said. --Tom Phoenix Stonehenge Perl Training -- To

Re: Help in checking the OS type...

2006-04-25 Thread Mazhar
On 4/25/06, Jay Savage [EMAIL PROTECTED] wrote: *Don't top post.* On 4/25/06, Mazhar [EMAIL PROTECTED] wrote: Paul, It lists me out the operating system name thanks for the same. How can i go about getting the different drives/volumes created on the same... Regards Mazhar On

Re: perl help

2006-04-25 Thread Mazhar
On 4/26/06, Praveena Vittal [EMAIL PROTECTED] wrote: Hi All, I am newbie of perl joined in this group last month.I could like to know how could i develop my perl programming and my opinion is only reading the materials , and other documents related to perl does not matters.Is there any

Re: match file name at end of a http url

2006-04-25 Thread Kelvin Wu
if ($url =~ /\/([^\/]*)$/) { print $1; } On 26/04/06, Tom Phoenix [EMAIL PROTECTED] wrote: On 4/25/06, nishanth ev [EMAIL PROTECTED] wrote: if( $url =~ /\/([\w.]*$)/ ){ print $1; } http://example.com/some-file.txt To process a URL requires more than a simple pattern

Re: match file name at end of a http url

2006-04-25 Thread Ken Perl
I don't know how to use URI::URI to solve my problem after reading the pod doc. since it is not easy to use regex, I am going to use split '/', $url to extract the last field. On 4/26/06, Tom Phoenix [EMAIL PROTECTED] wrote: On 4/25/06, nishanth ev [EMAIL PROTECTED] wrote: if( $url =~