Re: Hash ref's of hash's

2004-04-04 Thread R. Joseph Newton
Mark Goland wrote: > John, > this code didn't work for me. Although I did have to change to > ; What code? I see nothing above this to indicate what you are referring to. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Regular expression question: non-greedy matches

2004-04-04 Thread R. Joseph Newton
Boris Shor wrote: > Hello, > > Perl beginner here. I am having difficulty with a regular expression > that uses non-greedy matches. Here is a sample code snippet: > > $test = "Yea 123xrandomYea 456xdumdumNay 789xpop"; > while ($test =~ /Yea (.*?)x.*?(?:Nay (.*?)x)?/g) You have your non-capturing

Re: test - please ignore

2004-04-04 Thread Oliver Fuchs
On Sun, 04 Apr 2004, Paul Johnson wrote: > But yes, test messages are not necessary. If you need to ask something, > just do so. If you need to test something, find an appropriate forum. > If you need to read something, just wait a few minutes. Yes, shame on me ... I hate test-messages too ...

Re: Hash ref's of hash's

2004-04-04 Thread Mark Goland
- Original Message - From: "Wiggins d'Anconia" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, April 01, 2004 9:24 PM Subject: Re: Hash ref's of hash's > [EMAIL PROTECTED] wrote: > > Hi all, > > I am trying to setup a hash who's values are refera

Re: Hash ref's of hash's

2004-04-04 Thread WC -Sx- Jones
Mark Goland wrote: John, this code didn't work for me. Although I did have to change to ; Probably because he use the sample data in the DATA filehandle. His code works correctly near as I can tell; so - My question is - is your data actually in this format? Sample DATA port = 0 bmanset = 0

Re: Hash ref's of hash's

2004-04-04 Thread Mark Goland
John, this code didn't work for me. Although I did have to change to ; - Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]> To: <> Sent: Friday, April 02, 2004 7:47 PM Subject: Re: Hash ref's of hash's > [EMAIL PROTECTED] wrote: > > > > Hi all, > > Hello, > > > I

Re: Regular expression question: non-greedy matches

2004-04-04 Thread Randy W. Sims
Boris Shor wrote: Hello, Perl beginner here. I am having difficulty with a regular expression that uses non-greedy matches. Here is a sample code snippet: $test = "Yea 123xrandomYea 456xdumdumNay 789xpop"; while ($test =~ /Yea (.*?)x.*?(?:Nay (.*?)x)?/g) { print "$1\n"; print "

Regular expression question: non-greedy matches

2004-04-04 Thread Boris Shor
Hello, Perl beginner here. I am having difficulty with a regular expression that uses non-greedy matches. Here is a sample code snippet: $test = "Yea 123xrandomYea 456xdumdumNay 789xpop"; while ($test =~ /Yea (.*?)x.*?(?:Nay (.*?)x)?/g) { print "$1\n"; print "$2\n"; } The

Re: Explanation of G Modifier

2004-04-04 Thread Randy W. Sims
WC -Sx- Jones wrote: gohaku wrote: Hi everyone, Sorry for asking this question again for what must be the umpteenth time but I have a problem with the g modifier when matching. I have read Newsgroup Postings about this topic including: "What good is \G in a regular expression?" G is likely be

Re: Explanation of G Modifier

2004-04-04 Thread WC -Sx- Jones
gohaku wrote: $src = "a 1 b 2 c 3"; $_ = "a 1 b 2 c 3"; print "I see numbers" if /(?!\d)/; __END__ Or /(?!\w)/ et al... Maybe /pattern/sgi isn't what you want for your test? -Sx- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Explanation of G Modifier

2004-04-04 Thread WC -Sx- Jones
gohaku wrote: Hi everyone, Sorry for asking this question again for what must be the umpteenth time but I have a problem with the g modifier when matching. I have read Newsgroup Postings about this topic including: "What good is \G in a regular expression?" G is likely best for s/// syntax as

Explanation of G Modifier

2004-04-04 Thread gohaku
Hi everyone, Sorry for asking this question again for what must be the umpteenth time but I have a problem with the g modifier when matching. I have read Newsgroup Postings about this topic including: "What good is \G in a regular expression?" Listed below is what I'm experiencing problems with

tracking mail logs

2004-04-04 Thread WC -Sx- Jones
[ BTW - I did se Mail::Toaster and I am currently researching it, but it doesn't hurt to ask ... not too painfully anyways... ] I have a huge set of logs (from many mail servers) that each have logs in this format: Apr 4 17:23:51 chasecreek postfix/smtpd[4265]: [ID 197553 mail.info] A778E1375E:

Re: using strict

2004-04-04 Thread R. Joseph Newton
Paul Johnson wrote: > On Sun, Apr 04, 2004 at 01:28:42PM -0700, R. Joseph Newton wrote: > > > Guay Jean-Sébastien wrote: > > > > > > my $errors = 0; > > > open (CRITICALSERVERS, "$crout") || $errors += 2; > > > > > > that will translate to: > > > > > > my $errors = 0; > > > ( open (CRITICALSERVERS

Re: nested parens

2004-04-04 Thread JupiterHost.Net
Let's test it. use strict; use warnings; use Data::Dumper 'Dumper'; foreach my $string ( '(foo) (bar)', '(foo) (bar) (baz)', '((foo) bar)) (baz)', '(foo bar)',) { my @text_inside_parens = $string =~ m/\((.*)\)/g; print Dumper

Re: Passing file handles into modules

2004-04-04 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > Unfourtunately, the code is on an isolated PC. Post again from the machine your script is on, or use some transfer machine to move it to the machine you post from. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: nested parens

2004-04-04 Thread R. Joseph Newton
"Charles K. Clarkson" wrote: > JupiterHost.Net <[EMAIL PROTECTED]> wrote: > : > : [EMAIL PROTECTED] wrote: > : > Is there a module out there that I can use to parse > : > a text line and return the pieces that are enclosed > : > in paren's? > : > : You don't need a module for that just use regex's

Re: Basic question

2004-04-04 Thread WC -Sx- Jones
WC -Sx- Jones wrote: Kumar, Praveen (cahoot) wrote: Hi, yes i could solve my problem, but can you let me know what is the difference in using '{' '[' Thank You very much.. {$0} = hash [0] = array Sorry. { indicates a hash [ indicates an array -Sx- Also, maybe I missed it in the th

Re: Using $_ in a function if no argument is passed

2004-04-04 Thread R. Joseph Newton
Paul Johnson wrote: > On Sat, Apr 03, 2004 at 11:53:59AM -0800, R. Joseph Newton wrote: > > > Paul Johnson wrote: > > > > > $_ = "Leave me alone!"; > > > $s = "0"; > > > > Better yet: > > $lower_or-mixed_case_string = 'o'; > > I worry that you may have missed the point of the example, which was th

Re: Using $_ in a function if no argument is passed

2004-04-04 Thread Paul Johnson
On Sat, Apr 03, 2004 at 11:53:59AM -0800, R. Joseph Newton wrote: > Paul Johnson wrote: > > > $_ = "Leave me alone!"; > > $s = "0"; > > Better yet: > $lower_or-mixed_case_string = 'o'; I worry that you may have missed the point of the example, which was the value of the variable being passed in

Re: nested parens

2004-04-04 Thread JupiterHost.Net
Let's test it. use strict; use warnings; use Data::Dumper 'Dumper'; foreach my $string ( '(foo) (bar)', '(foo) (bar) (baz)', '((foo) bar)) (baz)', '(foo bar)',) { my @text_inside_parens = $string =~ m/\((.*)\)/g; print Dumper

Re: Help with pattern matching

2004-04-04 Thread R. Joseph Newton
A Lukaszewski wrote: > Greetings all, > > I have a comma-delimited lexical file with four fields: line number, the > first part of a word, the second part of a word, and the word combined. > The first and fourth fields are only for reference. The program I am > developing is very simple. If fi

Re: using strict

2004-04-04 Thread Paul Johnson
On Sun, Apr 04, 2004 at 01:28:42PM -0700, R. Joseph Newton wrote: > Guay Jean-Sébastien wrote: > > > > my $errors = 0; > > open (CRITICALSERVERS, "$crout") || $errors += 2; > > > > that will translate to: > > > > my $errors = 0; > > ( open (CRITICALSERVERS, "$crout") || $errors ) += 2; > > Nope.

Re: using strict

2004-04-04 Thread R. Joseph Newton
Guay Jean-Sébastien wrote: > > There is no problem syntactically. But there is a problem with the > precdence. If you ever have another operation on either the left or right > side of the || operator, the || operator will bind tighter than the other > operation. So for example, if you do: > > my $

Re: using strict

2004-04-04 Thread R. Joseph Newton
david wrote: > Guay Jean-Sébastien wrote: > > > >> open (CRITICALSERVERS, "$crout") || die "can't open file \n: $!"; > > > > As I said, you should replace || by or in the above line. See the > > precedence rules in "perldoc perlop" for details. > > > > why do you think so? is there any problem in

Re: using strict

2004-04-04 Thread R. Joseph Newton
Guay Jean-Sébastien wrote: > Hello Derek, > > > Guay, > > Err, my first name is Jean-Sebastien. Hi Jean-Sebastien, > My last name is Guay. French-language > people have a bad habit to put the last name first, as in "Guay, > Jean-Sebastien"... So I understand why this is a bit confusing. Thanks

Re: using strict

2004-04-04 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > Yet another great explanation.. What explanation? I see niothing above this. Please do not top-post when posting to this list. Instead, follow the material to which you are directly responding with your response, then trim any extraneous material. Most of us keep re

Re: Passing file handles into modules

2004-04-04 Thread Randy W. Sims
On 4/4/2004 11:34 AM, [EMAIL PROTECTED] wrote: Hey! I'm having some trouble passing a file handle from a script into a module as a function parameter. I'm passing it as a variable. The program says that I'm trying to use an un-opened file handle. Does anybody have any thoughts on this? Here is

Re: Passing file handles into modules

2004-04-04 Thread Lolbassett
Unfourtunately, the code is on an isolated PC. I am using a scalar to store the file handle, it was opened in the main script and then passed to the module which is used to read 16bits from the file and split it into an array containing each element (my module is using 16bit machine code instru

Re: Passing file handles into modules

2004-04-04 Thread WC -Sx- Jones
[EMAIL PROTECTED] wrote: Hey! I'm having some trouble passing a file handle from a script into a module as a function parameter. I'm passing it as a variable. The program says that I'm trying to use an un-opened file handle. Does anybody have any thoughts on this? I think you passed a FH out of

Re: Passing file handles into modules

2004-04-04 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: Hey! I'm having some trouble passing a file handle from a script into a module as a function parameter. I'm passing it as a variable. The program says that I'm trying to use an un-opened file handle. Does anybody have any thoughts on this? Thanks, Lewis AS Bassett S

Passing file handles into modules

2004-04-04 Thread Lolbassett
Hey! I'm having some trouble passing a file handle from a script into a module as a function parameter. I'm passing it as a variable. The program says that I'm trying to use an un-opened file handle. Does anybody have any thoughts on this? Thanks, Lewis AS Bassett -- To unsubscribe, e-mail:

Re: CPAN install from a local directory of module sources

2004-04-04 Thread WC -Sx- Jones
Peter Scott wrote: In article <[EMAIL PROTECTED]>, Which tells you how to duplicate that particular installtions... Thbis is NOT recommended... Why? Granted, it is somewhat different from what the OP asked for. He had a list of tgz files to install. Autobundle lists all the modules that are

Passing file handles into modules

2004-04-04 Thread Lolbassett
Hey! I'm having some trouble passing a file handle from a script into a module as a function parameter. I'm passing it as a variable. The program says that I'm trying to use an un-opened file handle. Does anybody have any thoughts on this? Thanks, Lewis AS Bassett -- To unsubscribe, e-mail:

Re: CPAN install from a local directory of module sources

2004-04-04 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Wc -Sx- Jones) writes: >zentara wrote: > >> Is it possible to put a dirlist of my module sources into a file, and >> feed the file to CPAN and let it install each one? > > >If CPAN is properly confiured to start with; >on the OLD system - do: > >p

Re: Error in Script

2004-04-04 Thread John W. Krahn
Prabu wrote: > >Hi, Hello, > I have wrote a script to search for a pattern and replace it in > all files of a directory,that i specified at commandline. > I want another one thing is to be done in the script.That's,it should > search only for the type of files I specified at commandline. > T

Re: Error in Script

2004-04-04 Thread Martin Lercher
That's 'cause you have put the question inside the foreach loop: # get all files foreach $file (@allfiles){ $filetoopen = $path ."/" .$file; # filter to check the type of file print "Enter the type of extension:"; my $ext=; Btw, it would be easier to just use the fileglob operator from the start (

Error in Script

2004-04-04 Thread prabu
Hi, I have wrote a script to search for a pattern and replace it in all files of a directory,that i specified at commandline. I want another one thing is to be done in the script.That's,it should search only for the type of files I specified at commandline. That is,it should g