Re: putting ";" as a replacement in the substitution.

2007-01-20 Thread Michael Alipio
- Original Message From: Bill Jones <[EMAIL PROTECTED]> To: begginers perl.org Sent: Sunday, January 21, 2007 1:03:33 PM Subject: Re: putting ";" as a replacement in the substitution. On 1/20/07, Michael Alipio <[EMAIL PROTECTED]> wrote: > > my $string = 'vd=root,status='; > '> vd=root

Date and time

2007-01-20 Thread M. Lewis
Given the following code, if I were to want $day, $month, $hour, $minute & $sec to have a leading zero (ie 01 for Jan rather than 1), is my only option to use printf? Or is there a better way. What I'm searching for here is the *correct* method to get $day, $month, etc for uses like naming b

Re: putting ";" as a replacement in the substitution.

2007-01-20 Thread Bill Jones
On 1/20/07, Michael Alipio <[EMAIL PROTECTED]> wrote: my $string = 'vd=root,status='; 'vd=root;status=' $string =~ s[\,][\;]g; -- WC (Bill) Jones -- http://youve-reached-the.endoftheinternet.org/ http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0x2A46CF06&fingerprint=on -- To unsubscribe,

putting ";" as a replacement in the substitution.

2007-01-20 Thread Michael Alipio
Hi, #I have this string: my $string = 'vd=root,status='; #Now, I want to transform it into: 'vd=root;status=' #That is replace the comma(,) between root and status with semicolon (;); $string =~ s/vd=\w+(,)/;/; print $string,"\n"; #And it prints: ;status= Can you tell me why it has ate up

Re: Alternative lookaheads in substitution, is it possible? (SOLVED!!!)

2007-01-20 Thread I . B .
one more to remove spaces selectively: $string =~ s/(\s+)(?:(?!date=|time=)(?=\w+=))/*/g; cheers, ~i On 1/20/07, Mumia W. <[EMAIL PROTECTED]> wrote: On 01/20/2007 06:46 AM, Michael Alipio wrote: > Cool > > I got this from approximately 71% perldoc perlre: > > print "5: got $1\n" if $

Re: maximum file size for while() loop? -> maybe HASH problem?

2007-01-20 Thread Tom Phoenix
On 1/19/07, Bertrand Baesjou <[EMAIL PROTECTED]> wrote: While running my script it seems to use around a gigabyte of memory (there is 1GB of RAM and 1GB of swap in the system), might this be the problem? If you're running low on memory, unless you're working on an inherintly large problem, you

Re: Alternative lookaheads in substitution, is it possible? (SOLVED!!!)

2007-01-20 Thread Mumia W.
On 01/20/2007 06:46 AM, Michael Alipio wrote: Cool I got this from approximately 71% perldoc perlre: print "5: got $1\n" if $x =~ /^(\D*)(?=\d)(?!123)/; so I don't need "||" between multiple look ahead assertions... Sometimes, it's more rewarding to solve you're problem on your own.

Re: Alternative lookaheads in substitution, is it possible? (SOLVED!!!)

2007-01-20 Thread Michael Alipio
Cool I got this from approximately 71% perldoc perlre: print "5: got $1\n" if $x =~ /^(\D*)(?=\d)(?!123)/; so I don't need "||" between multiple look ahead assertions... Sometimes, it's more rewarding to solve you're problem on your own. You just have to RTFM.. :-) More power to this

Alternative lookaheads in substitution, is it possible?

2007-01-20 Thread Michael Alipio
Hi, Suppose I want to match all white spaces if it is followed by "\w+=" or not followed by "date or time" : $_ =~ s(/\s+(?=\w+=)/ || /\s+(?!(date|time)))/*/g; Doesn't seem to do what I want. Given a string: "Jan 19 11:37:21 firewall date=2007-01-19 time=11:42:15 msg="User admin login" I wa