Re: Re:must 'x' in g^x be a prime number

2011-03-23 Thread fakessh @
e > longger parameters you created, the more time you need to compute the > value. > ref: > int DH_generate_parameters_ex(DH *dh, int prime_len,int generator, > BN_GENCB *cb); > > > At 2011-03-23 08:12:37,ikuzar wrote: > Hello, > I 'd like to know

Re: how to remove (^M ^G ) characters

2010-11-02 Thread John W. Krahn
Mike McClain wrote: Hi John, Thank you for your comments. Though I've been coding for many years I've never had a chance to work in a team environment and thus never had the benefit of code reviews. It's an education to see things from another viewpoint. On Sat, Oct 30, 2010 at 03:16:5

Re: how to remove (^M ^G ) characters

2010-11-01 Thread Mike McClain
Hi John, Thank you for your comments. Though I've been coding for many years I've never had a chance to work in a team environment and thus never had the benefit of code reviews. It's an education to see things from another viewpoint. On Sat, Oct 30, 2010 at 03:16:51PM -0700, John W. Krah

Re: how to remove (^M ^G ) characters

2010-10-30 Thread John W. Krahn
Mike McClain wrote: On Thu, Oct 28, 2010 at 07:28:19PM +0530, perl_haxor 123 wrote: characters and how can remove them using perl?.and also please let me if there is any link form where i can find what these characters are and their ascii values?..any sugges would be really helpful # m

Re: how to remove (^M ^G ) characters

2010-10-30 Thread Mike McClain
E ENQ (enquiry) 21 Ctrl U NAK (negative ack.) 6 Ctrl F ACK (acknowledge) 22 Ctrl V SYN (synchronous idle) 7 Ctrl G BEL '\a' (bell) 23 Ctrl W ETB (end of trans. blk) 8 Ctrl H BS '\b' (backspace)24 Ctrl X CAN

Re: how to remove (^M ^G ) characters

2010-10-29 Thread John W. Krahn
Eitan Adler wrote: Did you know that Perl has built-in idioms to handle multiple file manipulation: #!/usr/bin/perl Small nitpick, but one that irks me very much: please keep this portable #!/usr/bin/env perl And you believe that to be portable? http://lists-archives.org/git/719934-perl-she

Re: how to remove (^M ^G ) characters

2010-10-29 Thread Eitan Adler
> Did you know that Perl has built-in idioms to handle multiple file > manipulation: > > #!/usr/bin/perl Small nitpick, but one that irks me very much: please keep this portable #!/usr/bin/env perl %ls -laod /usr/bin/perl ls: /usr/bin/perl: No such file or directory %ls -laod /usr/local/bin/perl

Re: how to remove (^M ^G ) characters

2010-10-28 Thread John W. Krahn
^M" above but in your unix2dos.pl program you used $line =~ s/\cJ/\cM\cJ/g; and I misread that as "\cJ\cM". Also, you don't need a /g option on that substitution as there can only be one newline per line (unless you change the value of $/ [the Input Record Separator] which

Re: how to remove (^M ^G ) characters

2010-10-28 Thread Brandon McCaig
On Fri, Oct 29, 2010 at 12:57 AM, John W. Krahn wrote: > That is usually written as: > > use File::Copy qw/ cp mv /; > > use takes a list after the module name. I thought it was up to the module to interpret the list and the documentation that I was reading online wasn't very clear so I played it

Re: how to remove (^M ^G ) characters

2010-10-28 Thread John W. Krahn
Brandon McCaig wrote: On Thu, Oct 28, 2010 at 9:28 PM, Jeff Peng wrote: You get the files from windows to un*x? try the command 'dos2unix'. ^G is a bell character (\a). That's not a platform issue, AFAIK. Anyway, in response to this thread I wrote Perl scripts that

Re: how to remove (^M ^G ) characters

2010-10-28 Thread Brandon McCaig
On Thu, Oct 28, 2010 at 11:21 PM, Brandon McCaig wrote: >    cp $in_fn, "$backup" or die "Failed to backup '$in_fn': $!"; *snip* >    unlink "$backup" or Sigh. I [wrongly] quoted a variable. :P For the record, $backup started as "$in_fn.orig". After seeing myself use it more than once I decided t

Re: how to remove (^M ^G ) characters

2010-10-28 Thread Brandon McCaig
On Thu, Oct 28, 2010 at 9:28 PM, Jeff Peng wrote: > You get the files from windows to un*x? > try the command 'dos2unix'. ^G is a bell character (\a). That's not a platform issue, AFAIK. Anyway, in response to this thread I wrote Perl scripts that seem to work as replacem

Re: how to remove (^M ^G ) characters

2010-10-28 Thread Jeff Peng
于 2010-10-28 21:58, perl_haxor 123 写道: Hi All, I'm a beginner in perl and i try to read a file, but these files contains characters like (^M ^G)..I wanted to know what are these characters and how can remove them using perl?.and also please let me if there is any link

Re: how to remove (^M ^G ) characters

2010-10-28 Thread Shlomi Fish
Hi perl_haxor, On Thursday 28 October 2010 15:58:19 perl_haxor 123 wrote: > Hi All, > >I'm a beginner in perl and i try to read a file, but these files > contains characters like (^M ^G)..I wanted to know what are these > characters and how can remove them

how to remove (^M ^G ) characters

2010-10-28 Thread perl_haxor 123
Hi All, I'm a beginner in perl and i try to read a file, but these files contains characters like (^M ^G)..I wanted to know what are these characters and how can remove them using perl?.and also please let me if there is any link form where i can find what these character

Re: Too many arguments for OneTickUtil::getFilesFromDir at G:\workspace1\scripts\fooPackage.pl line 4, near "$pattern)"

2010-04-28 Thread Dermot
On 27 April 2010 15:39, dbtouch wrote: > Hi, Perl Folks Hello. > I am getting error "Too many arguments for > OneTickUtil::getFilesFromDir at G:\workspace1\scripts\fooPackage.pl > line 4, near "$pattern)" when running a small script calling a package > routine. Cou

Too many arguments for OneTickUtil::getFilesFromDir at G:\workspace1\scripts\fooPackage.pl line 4, near "$pattern)"

2010-04-28 Thread dbtouch
Hi, Perl Folks I am getting error "Too many arguments for OneTickUtil::getFilesFromDir at G:\workspace1\scripts\fooPackage.pl line 4, near "$pattern)" when running a small script calling a package routine. Could you give some ideas on what I did wrong? Thanks, db # OneTickU

Re: tr// versus s///g

2010-03-08 Thread Uri Guttman
> "TE" == Tony Esposito writes: TE> You miss my point but thanks for the syntax check.  I am concerned TE> with comparing the functionality, one versus the other. they are not comparable at all. tr/// works on individual characters and nothing else. s/// works with regexes which can modi

Re: tr// versus s///g

2010-03-08 Thread John W. Krahn
Tony Esposito wrote: On Mon, 8/3/10, John W. Krahn wrote: Tony Esposito wrote: Does tr/'\n'/' '/ Replace every ' with ' and every "\n" with " " and every ' with '. Should probably just be tr/\n/ /. do the same as tr/'\n&#

Re: tr// versus s///g

2010-03-08 Thread Tony Esposito
Sorry about the syntax errors ... Yes, just want to replace all newline characters with a space and since tr does not have g (global) 'option' I was thinking that s/\n/ /g is actually better. Or does tr do a global translate by default?   Thanks --- On Mon, 8/3/10, John W. Krahn wro

Re: tr// versus s///g

2010-03-08 Thread Tony Esposito
You miss my point but thanks for the syntax check.  I am concerned with comparing the functionality, one versus the other.   Thanks. --- On Mon, 8/3/10, Shawn H Corey wrote: From: Shawn H Corey Subject: Re: tr// versus s///g To: "Tony Esposito" Cc: "Beginners Perl" D

Re: tr// versus s///g

2010-03-08 Thread John W. Krahn
Tony Esposito wrote: Does tr/'\n'/' '/ Replace every ' with ' and every "\n" with " " and every ' with '. Should probably just be tr/\n/ /. do the same as tr/'\n'/' '/g? I assume you mean s/'\n'/&#

Re: tr// versus s///g

2010-03-08 Thread Shawn H Corey
Tony Esposito wrote: > Does tr/'\n'/' '/ do the same as tr/'\n'/' '/g? ( replace newline with space > ) > If so, is one preferred over the other? Neither of the above is correct. The correct forms are: tr/\n/ /; s/\n/ /g; -- Just my 0.00

tr// versus s///g

2010-03-08 Thread Tony Esposito
Does tr/'\n'/' '/ do the same as tr/'\n'/' '/g?  ( replace newline with space ) If so, is one preferred over the other?  

Re: print $var =~ s/\s+\).$/)./g;

2008-11-21 Thread Mr. Shawn H. Corey
On Fri, 2008-11-21 at 15:13 -0800, [EMAIL PROTECTED] wrote: > Is there any way I can get rid of that pesky number and just have the > $var string printed? No. Substitution returns the number of substitutions made. Only match will return the matches. -- Just my 0.0002 million dollars worth

print $var =~ s/\s+\).$/)./g;

2008-11-21 Thread bluecrab22
I would like to print the result of a $var that has been s///'ed. Sure, I can do this: $var =~ s/\s+\).$/)./g; print "$var\n"; but I was thinking more like this: print $var =~ s/\s+\).$/)./g; However, I get a "1" returned (to term), probably b/c one match is found. Is th

Re: iterating over m//g matches and capturing groups

2008-08-05 Thread John W. Krahn
Mike C wrote: I'd like to iterate over each of a m//g style regex's FULL matches, even though it contains capturing groups. Then, for each FULL match, I'd like to examine the capturing groups that are local to that match. The thing I'm struggling with is that, while it&#x

iterating over m//g matches and capturing groups

2008-08-04 Thread Mike C
I'd like to iterate over each of a m//g style regex's FULL matches, even though it contains capturing groups. Then, for each FULL match, I'd like to examine the capturing groups that are local to that match. The thing I'm struggling with is that, while it's easy to itera

Re: howto simplfy this regex if ($string =~/^$match | $match | $match$/g){

2008-05-03 Thread Gunnar Hjalmarsson
Chas. Owens wrote: On Sun, May 4, 2008 at 1:45 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: snip if ($string =~/^$match | $match | $match$/g){ snip my $match = qr(\b1\b); snip Ah, I was missing something, the spaces. This is much better than my answer. I think this is even

Re: howto simplfy this regex if ($string =~/^$match | $match | $match$/g){

2008-05-03 Thread Chas. Owens
On Sun, May 4, 2008 at 1:45 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: snip > > if ($string =~/^$match | $match | $match$/g){ snip > my $match = qr(\b1\b); snip Ah, I was missing something, the spaces. This is much better than my answer. -- Chas. Owens wonkden.net The

Re: howto simplfy this regex if ($string =~/^$match | $match | $match$/g){

2008-05-03 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: How do I simplify the regex below so that it matches only the number 1, henceforth it should return false if I match $string with $match. use strict; use warnings; my $string = "10 11 12 13 40"; my $match = 1; if ($string =~/^$match | $match | $match$/g)

Re: howto simplfy this regex if ($string =~/^$match | $match | $match$/g){

2008-05-03 Thread Chas. Owens
t;10 11 12 13 40"; > my $match = 1; > > if ($string =~/^$match | $match | $match$/g){ > print "match"; > }else{ >print "unmatch"; > }; > I may be missing something, but I believe you will get the same results with just if ($string =~ /$ma

howto simplfy this regex if ($string =~/^$match | $match | $match$/g){

2008-05-03 Thread itshardtogetone
Hi, How do I simplify the regex below so that it matches only the number 1, henceforth it should return false if I match $string with $match. use strict; use warnings; my $string = "10 11 12 13 40"; my $match = 1; if ($string =~/^$match | $match | $match$/g){ print "match&qu

Re[2]: regexp /g question

2007-08-22 Thread Alexandru Maximciuc
Hello Chas, Wednesday, August 22, 2007, 10:21:01 AM, you wrote: > On 8/22/07, Alexandru Maximciuc <[EMAIL PROTECTED]> wrote: >> Hello, >> >> could someone please explain me these results: > snip >> print "1) ".scalar($_ =~ /$re/g)."\n"

Re: regexp /g question

2007-08-22 Thread Chas Owens
On 8/22/07, Alexandru Maximciuc <[EMAIL PROTECTED]> wrote: > Hello, > > could someone please explain me these results: snip > print "1) ".scalar($_ =~ /$re/g)."\n"; > my @a = $_ =~ /$re/g; > print "1) ".scalar(@a)."\n"; snip > 1)

Re[2]: regexp /g question

2007-08-21 Thread Alexandru Maximciuc
e please explain me these results: >> >> >> use strict; >> use warnings; >> >> my $re = qr!a!; >> >> $_ = join '', ; >> >> print "1) ".scalar($_ =~ /$re/g)."\n"; >> my @a

Re: regexp /g question

2007-08-21 Thread yitzle
warnings; > > my $re = qr!a!; > > $_ = join '', ; > > print "1) ".scalar($_ =~ /$re/g)."\n"; > my @a = $_ =~ /$re/g; > print "1) ".scalar(@a)."\n"; > > __DATA__ > jaskdgbanio ehioa sdoija oihfcasoi dnfmalmods gnijashdugo

regexp /g question

2007-08-21 Thread Alexandru Maximciuc
Hello, could someone please explain me these results: use strict; use warnings; my $re = qr!a!; $_ = join '', ; print "1) ".scalar($_ =~ /$re/g)."\n"; my @a = $_ =~ /$re/g; print "1) ".scalar(@a)."\n"; __DA

Re: /s, /g and /m modifiers

2007-06-01 Thread John W. Krahn
Sharan Basappa wrote: > I have a script as follows : > > $str = "once upon a time > once upon a time"; > @store = $str =~ m/(once)/g; That could be simplified to: @store = $str =~ /once/g; > print @store ; > > This outputs "onceonce" >

Re: /s, /g and /m modifiers

2007-06-01 Thread Paul Lalli
On Jun 1, 7:16 am, [EMAIL PROTECTED] (Paul Lalli) wrote: > the string "onex\ntwox" will match /o(.*)x/ by setting $1 to 'on'. Obviously, I meant $1 would be set to "ne". My bad. Paul Lalli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http:/

Re: /s, /g and /m modifiers

2007-06-01 Thread Sharan Basappa
Simply great .. thanks On 6/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote: On Jun 1, 4:54 am, [EMAIL PROTECTED] (Sharan Basappa) wrote: > I have a script as follows : > > $str = "once upon a time > once upon a time"; > @store = $str =~ m/(once)/g; &g

Re: /s, /g and /m modifiers

2007-06-01 Thread Paul Lalli
On Jun 1, 4:54 am, [EMAIL PROTECTED] (Sharan Basappa) wrote: > I have a script as follows : > > $str = "once upon a time > once upon a time"; > @store = $str =~ m/(once)/g; > print @store ; > > This outputs "onceonce" > How come regex is sear

Re: /s, /g and /m modifiers

2007-06-01 Thread Tom Allison
There's nothing here to say "stop at a new line" Without the modifiers the string looks like: 'one upon a time\nonce upon a time' Which matches your regex the same way 'once upon a time once upon a time' would. without the /g you'll match on the firs

/s, /g and /m modifiers

2007-06-01 Thread Sharan Basappa
I have a script as follows : $str = "once upon a time once upon a time"; @store = $str =~ m/(once)/g; print @store ; This outputs "onceonce" How come regex is searching beyond newline. I thought the search will stop after first once. When I replace /g with /m, the o

Re: the only difference is the 'x' after '/g'

2006-03-31 Thread tom arnall
> the following code: > > > > > > > > my (@main); > > > > $_=" > > > > From a > > > > From: b > > > > From: c > > > > From: d > > > >

Re: the only difference is the 'x' after '/g'

2006-03-31 Thread Hans Meier (John Doe)
> $_=" > > > From a > > > From: b > > > From: c > > > From: d > > > "; > > > @main = /From [^\n]*?\n.*?(From: .*?\n).*?/gx; > > > print "@main"; > > >

Re: the only difference is the 'x' after '/g'

2006-03-30 Thread tom arnall
uot;; > > @main = /From [^\n]*?\n.*?(From: .*?\n).*?/gx; > > print "@main"; > > print "--\n"; > > @main = /From [^\n]*?\n.*?(From: .*?\n).*?/g; > > print "@main"; > > > > produces: >

Re: the only difference is the 'x' after '/g'

2006-03-30 Thread Hans Meier (John Doe)
gx; > print "@main"; > print "--\n"; > @main = /From [^\n]*?\n.*?(From: .*?\n).*?/g; > print "@main"; > > produces: > > From: b >From: d > ------ > From

the only difference is the 'x' after '/g'

2006-03-30 Thread tom arnall
main = /From [^\n]*?\n.*?(From: .*?\n).*?/g; print "@main"; produces: From: b From: d -- From: b the only difference between the two regex lines is the 'x' after '/g' in the first of the tw

Re: xA0 ( decimal 160 ) in code fixed from email $_ =~ s/\xA0/ /g;

2006-03-22 Thread Tom Phoenix
id script) > reports such character on the commandline as xA0 This character is, I believe, the "non-breaking space". It's often used in rendering code which might otherwise not be properly formatted in a web browser, but it ruins the code for copy-and-paste. > $_ =~ s/\xA0/ /g; # xA

xA0 ( decimal 160 ) in code fixed from email $_ =~ s/\xA0/ /g;

2006-03-22 Thread Alan_C
the escape of xA0 and it works! I'm most certainly open to any further suggestions/ideas/tips. #!/usr/bin/perl -w use strict; my $old = shift; my $new = "$old.tmp"; open(OLD, "<", $old) or die "cant open $old: $!"; open(NEW, ">", $new) or die &q

Re: reg exp using \G

2005-08-03 Thread DBSMITH
cc Please respond to Subject Jay Savage Re: reg exp using \G

Re: reg exp using \G

2005-08-02 Thread Jay Savage
Please don't top post. I think you've been asked this before. On 8/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > ok I understand now...thanks, but I tried it and it is still stopping at > original1.1 > I then modified it to print YE if ($1) but never saw YE in STDOUT. Tha's becau

Re: reg exp using \G

2005-08-02 Thread DBSMITH
03:11 cc PM Subject Re: reg exp using \G Please resp

Re: reg exp using \G

2005-08-02 Thread Dave Gray
On 8/2/05, Dave Gray <[EMAIL PROTECTED]> wrote: > On 8/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > yes but the problem is my start point and end point have identical entries > > under them. It is stopping at original1.1 when I need for it to stop at > > the end of original1.1 and print

Re: reg exp using \G

2005-08-02 Thread Dave Gray
On 8/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > yes but the problem is my start point and end point have identical entries > under them. It is stopping at original1.1 when I need for it to stop at > the end of original1.1 and print > > media: sf > Volumes: >STK000 > Total space av

Re: reg exp using \G

2005-08-02 Thread DBSMITH
PM Subject Re: reg exp using \G Please respond to Dav

Re: reg exp using \G

2005-08-02 Thread Dave Gray
On 8/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > technically you are correct about escaping the dot, but in this particular > situation my regexp is working. I will escape the dot. > my goal again is to print from one sting to another from "allsets" > down. I apologize for the long o

Re: reg exp using \G

2005-08-02 Thread John Doe
[EMAIL PROTECTED] am Dienstag, 2. August 2005 19.36: > reg exp using \G > Datum: 2.8.05  19:36:44 > Von: [EMAIL PROTECTED] > An: beginners@perl.org > > All, > > I think I am on the right track as far as what assertion to use.  I need to > print from one string to ano

Re: reg exp using \G

2005-08-02 Thread DBSMITH
PM Subject Re: reg exp using \G Please respond to

Re: reg exp using \G

2005-08-02 Thread Dave Gray
On 8/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I think I am on the right track as far as what assertion to use. I need to > print from one string to another using .. with \G Why do you want to use \G? > My goal is to capture from allsets down. > Here is my code: &g

reg exp using \G

2005-08-02 Thread DBSMITH
All, I think I am on the right track as far as what assertion to use. I need to print from one string to another using .. with \G My goal is to capture from allsets down. thank you Here is my code: #!/usr/bin/perl use strict; use warnings; $ENV{PATH} = qq(/opt/SUNWsamfs/sbin:/usr/bin); open

RE: Attempting OO with Perl - New() method in subclass not workin g

2005-04-01 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > I am trying to build an inheritable object, and I am using examples > from the Perl Cookbook, 2nd edition, mostly Recipe 13.1, using the > new and _init methods. Your subclass does not need (and should not have) a new() method; it can use the one from the base class. As

Re: how to add Control G in the message

2004-10-31 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Sreedhar Kalkunte-Venkatachala) writes: >Hi > >I am printing the message using print statement. print "the message is = >$msg"; > >How to add control G in that. I assume that what you want to do is ring the

Re: how to add Control G in the message

2004-10-27 Thread Chris Devers
On Wed, 27 Oct 2004 [EMAIL PROTECTED] wrote: > I am printing the message using print statement. print "the message is $msg"; > > How to add control G in that. You still don't seem to be looking these questions up for yourself before turning to this list. Please, pl

how to add Control G in the message

2004-10-27 Thread Sreedhar . Kalkunte-Venkatachala
Hi I am printing the message using print statement. print "the message is $msg"; How to add control G in that. Regards Sreedhar Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not

Re: Trouble with m///g

2004-09-30 Thread Chap Harrison
On Sep 30, 2004, at 10:41 AM, Jan Eden wrote: my @a = ($foo =~ m'(? Careful, you mistyped the original proposition: my @a = ($foo =~ m'(? Oops, sorry - I copied that into the email from Wiggins' reply, but actually tested with Dave Gray's. Didn't notice the difference. What you posted gives the

Re: Trouble with m///g

2004-09-30 Thread Jan Eden
Chap Harrison wrote on 30.09.2004: > >On Sep 30, 2004, at 9:55 AM, Wiggins d Anconia wrote: > >> Out of curiousity based on your description shouldn't it return, >> >> ::::::: >> >> Or do you really mean, you are trying to capture all 4 digit strings >> that are not

Re: Trouble with m///g

2004-09-30 Thread Dave Gray
> TIMTOWTDI: > > @list = grep length==4, /\d+/g Shouldn't that be: @list = grep length==4, $foo =~ /\d+/g; Cool solution, I wouldn't have thought to do it that way. I'm getting varying Benchmarking results, though. I think it might have something to do with grep spee

Re: Trouble with m///g

2004-09-30 Thread Chap Harrison
On Sep 30, 2004, at 9:55 AM, Wiggins d Anconia wrote: Out of curiousity based on your description shouldn't it return, ::::::: Or do you really mean, you are trying to capture all 4 digit strings that are not in a string of longer digits? You need to be very explic

Re: Trouble with m///g

2004-09-30 Thread Gunnar Hjalmarsson
Chap Harrison wrote: I'm trying to extract all four-digit numbers from a string in one fell swoop, but I can't seem to come up with the proper regexp. This is my first time using /g in a match so maybe there's a trick I'm missing. For example, the string " aa33

RE: Trouble with m///g

2004-09-30 Thread Bob Showalter
Chap Harrison wrote: > Hi, > > I'm trying to extract all four-digit numbers from a string in one fell > swoop, but I can't seem to come up with the proper regexp. This is my > first time using /g in a match so maybe there's a trick I'm missing. > > For

Re: Trouble with m///g

2004-09-30 Thread Chap Harrison
Hmmm... m'\b(\d{4})\b'g < aa 444 -> ::: Doesn't give me or . I think the problem has to do with where m///g starts on subsequent iterations. The pattern specifies a delimiter for both the start and the end of the

RE: Trouble with m///g

2004-09-30 Thread Wiggins d Anconia
n there is the set with the '-' > Rob > > -Original Message- > From: Chap Harrison [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 30, 2004 10:38 AM > To: [EMAIL PROTECTED] > Subject: Trouble with m///g > > > Hi, > > I'm trying to

Re: Trouble with m///g

2004-09-30 Thread Dave Gray
> For example, the string > > " aa 444 -" > > should yield > > , , , , , . That's actually kind of tricky. How about: $aa = " aa 444 -"; @aa = $aa =~ /(?http://learn.perl.org/>

RE: Trouble with m///g

2004-09-30 Thread Hanson, Rob
I think this might work. /\b\d{4}\b/ Rob -Original Message- From: Chap Harrison [mailto:[EMAIL PROTECTED] Sent: Thursday, September 30, 2004 10:38 AM To: [EMAIL PROTECTED] Subject: Trouble with m///g Hi, I'm trying to extract all four-digit numbers from a string in one fell

Trouble with m///g

2004-09-30 Thread Chap Harrison
Hi, I'm trying to extract all four-digit numbers from a string in one fell swoop, but I can't seem to come up with the proper regexp. This is my first time using /g in a match so maybe there's a trick I'm missing. For example, the string " aa 444 55

Re: Explanation of G Modifier

2004-04-05 Thread WC -Sx- Jones
gohaku wrote: "What good is \G in a regular expression?" while (<>) { chomp; PARSER: { m/ \G( \d+\b)/gcx&& do { print "number: $1\n"; redo; }; m/ \G( \w+ )/gcx&& do { print "word: $1\n"; redo; }; m/ \G( \

Re: Explanation of G Modifier

2004-04-05 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

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

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///

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 experi

Re: Count the number of lines in a file without actually iteratin g through the file

2004-02-26 Thread Jenda Krynicky
From: WC -Sx- Jones <[EMAIL PROTECTED]> > Hanson, Rob wrote: > >>Is there a way to determine the number of lines > >>in a file without actually iterating through the > >>file and incrementing a file? > > > > > > > # No silver bullet; but shorter - > > undef $/; # Slurp; > > foreach $target (

RE: Count the number of lines in a file without actually iteratin g through the file

2004-02-26 Thread Charles K. Clarkson
Jenda Krynicky <[EMAIL PROTECTED]> wrote: : : From: WC -Sx- Jones : > : > undef $/; # Slurp; : > : > foreach $target (@ARGV) { : > @lines = (); : > : > open (HTML_FILE, "<$target") or die "owie"; : > @lines = split(/\n/, ); : > : > print "In $target - Seen: ". ($#lines + 1) ." lines.

Re: Count the number of lines in a file without actually iteratin g through the file

2004-02-25 Thread WC -Sx- Jones
[ what was all that? in-line top posting? please don't ] Hanson, Rob wrote: Is there a way to determine the number of lines in a file without actually iterating through the file and incrementing a file? # No silver bullet; but shorter - undef $/; # Slurp; foreach $target (@ARGV) { @lines =

RE: Count the number of lines in a file without actually iteratin g through the file

2004-02-25 Thread Hanson, Rob
> Is there a way to determine the number of lines > in a file without actually iterating through the > file and incrementing a file? No. > I found the following on perlmonks.org, it works > great but this is command line syntax When you deparse that command (see below), you can see that all it d

Re: misunderstanding the /g modifier on REGEX

2003-06-13 Thread Rob Dixon
of the job. > > What is wrong with this code? > > while (<>) { > while($_ =~ /([|])([|])/g) { > $_ =~ s/([|])([|])/$1 $2/g; > print "$_"; > } > } > > The problems seems that my bit of code doesn't > completely catch "all" of the

Re: misunderstanding the /g modifier on REGEX

2003-06-13 Thread John W. Krahn
Tim Johnson wrote: > > I'm not really giving you the answer you're looking for, but here is one way > to go about it: > > while(<>){ > my @temp = split(/\|/,$_); > foreach my $item(@temp){ > if($item eq ''){ > $item .= ' '; > } > } > print join('|',@temp); > } Or you could

Re: misunderstanding the /g modifier on REGEX

2003-06-13 Thread Sudarshan Raghavan
CTED] Sent: Thursday, June 12, 2003 5:28 PM To: [EMAIL PROTECTED] Subject: Re: misunderstanding the /g modifier on REGEX M Z wrote: hello all - I am trying to do the following to this data: input: X|YZ||A desired output: X|Y| | | |Z| |A simply replacing || with | | whereever it may occur in

RE: misunderstanding the /g modifier on REGEX

2003-06-12 Thread Tim Johnson
To: [EMAIL PROTECTED] Subject: Re: misunderstanding the /g modifier on REGEX M Z wrote: > hello all - > > I am trying to do the following to this data: > input: > X|YZ||A > > desired output: > X|Y| | | |Z| |A > > simply replacing || with | | > whereever it may oc

RE: misunderstanding the /g modifier on REGEX

2003-06-12 Thread Tim Johnson
Original Message- From: M z [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 3:35 PM To: [EMAIL PROTECTED] Subject: misunderstanding the /g modifier on REGEX hello all - I am trying to do the following to this data: input: X|YZ||A desired output: X|Y| | | |Z| |A simply replacing ||

Re: misunderstanding the /g modifier on REGEX

2003-06-12 Thread david
all of the job. > > What is wrong with this code? > > while (<>) { > while($_ =~ /([|])([|])/g) { > $_ =~ s/([|])([|])/$1 $2/g; > print "$_"; > } > } > > The problems seems that my bit of code doesn't > completely catch "all" of

misunderstanding the /g modifier on REGEX

2003-06-12 Thread M z
t;) { while($_ =~ /([|])([|])/g) { $_ =~ s/([|])([|])/$1 $2/g; print "$_"; } } The problems seems that my bit of code doesn't completely catch "all" of the || occurences within a given line. Please help!!! __ Do you Yahoo!? Yahoo! Calendar - Free onl

misunderstanding the /g modifier on REGEX

2003-06-12 Thread M z
t;) { while($_ =~ /([|])([|])/g) { $_ =~ s/([|])([|])/$1 $2/g; print "$_"; } } The problems seems that my bit of code doesn't completely catch "all" of the || occurences within a given line. Please help!!! __ Do you Yahoo!? Yahoo! Calendar - Free onl

RE: MIME::Lite : Can someone please point out what I'm doing wron g?

2003-05-31 Thread Rich Fernandez
-Original Message- From: Rich Fernandez [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 3:51 PM To: '[EMAIL PROTECTED]' Subject: MIME::Lite : Can someone please point out what I'm doing wrong? my $msg = MIME::Lite -> new( From=> '[EMAIL PROTECTED]', To =

Re: ppm: No suitable installation target for package G

2003-01-17 Thread David Eason
It installs now, thanks so much for your help! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: ppm: No suitable installation target for package G

2003-01-15 Thread Jenda Krynicky
From: "David Eason" <[EMAIL PROTECTED]> > Thanks! Now I have another problem. > > Is there a ppm repository for File-DosGlob or do I need to figure out > how to get the cpan shell working in Windows? File::DosGlob is part of the core. I've removed the dependency from the .ppd file, could you try

Re: ppm: No suitable installation target for package G

2003-01-15 Thread David Eason
alhost... > From: "David Eason" <[EMAIL PROTECTED]> > > What does the error "No suitable installation target for package ..." > > mean? I am using ppm 3.0.1 from perl 5.8.0 build 802. > > It means that PPM did not find the right version of the module

Re: ppm: No suitable installation target for package G

2003-01-12 Thread Jenda Krynicky
From: "David Eason" <[EMAIL PROTECTED]> > What does the error "No suitable installation target for package ..." > mean? I am using ppm 3.0.1 from perl 5.8.0 build 802. It means that PPM did not find the right version of the module for your version of Perl. >

  1   2   >