$str =~ s/Auth.notice: //;
$str =~ s/\[[\]]*\]//;

print $str;

I'm not sure if there's a way to put it all in one line, but this
should do it nonetheless.

-David

On Mon, 23 Aug 2004 14:31:01 -0500, Dave Kettmann
<[EMAIL PROTECTED]> wrote:
> Ok ... I'm going to try to confuse everyone again because either a) I'm dense or b) 
> I'm asking the wrong question. Everyone can agree with option a, and I will not get 
> mad :). Ok .. here goes again...
> 
> I looked at s2p and it spit out 2 pages of perl code of which the sed command was a 
> small bit of code. It is nothing major that I want to do an example is below:
> 
> I want this ...:
> 
> Aug 23 14:28:32 Auth.notice: (Access-Request 10.10.116.4 166 "000611-011c0c"): Login 
> OK [000611-011c0c]
> 
> To be this ...:
> Aug 23 14:25:32 (Access-Request 10.10.116.4 166 "000611-011c0c"): Login OK
> 
> Or to make it easier, I want to take out the 'Auth.notice: ' and anything encased in 
> []'s.
> 
> I dont know if im confusing things more, or if I was pointed in the right direction 
> and I just dont understand. Someone please help this poor confused person figure out 
> WTH he is doing wrong :-D
> 
> Dave Ketmmann
> NetLogic
> 636-561-0680
> 
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 23, 2004 11:04 AM
> To: Dave Kettmann
> Cc: Perl List (E-mail)
> Subject: RE: Sed-type-function
> 
> > Hmm .. wonder why I didnt see that in any of the books i looked at. Ok
> off I go then, Thanks for the help! Sorry to > confuse you guys :)
> 
> > Dave
> 
> start here -
> perldoc perlop (or
> http://www.perldoc.com/perl5.8.4/pod/perlop.html#Regexp-Quote-Like-Operators)
> and
> perldoc perlretut ( or http://www.perldoc.com/perl5.8.4/pod/perlretut.html)
> 
> Jeff
> 
> > I guess and easy syntax for search and replace similar to:
> 
> > s/this/that/g ...
> 
> Perl has that, you can use exactly the same syntax -- s/search/replace/g
> 
> hth
> Jeff
> 
> > Guess I will look at the s2p you mentioned as well.
> > Dave
> 
> -----Original Message-----
> From: Randy W. Sims [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 23, 2004 10:39 AM
> To: Dave Kettmann
> Cc: Perl List (E-mail)
> Subject: Re: Sed-type-function
> 
> Dave Kettmann wrote:
> > List,
> >
> > Does perl have any built-in sed-like function? I found ASED.pm, but would
> rather go with something built in. I looked around a bit, but didnt find
> anything. I guess I could go with using the Shell module but would rather
> using as few modules as possible.
> 
> I'm not sure what you mean by sed-like function. Perl can do anything
> sed can do. There is also a script that converts sed to perl, see
> `perldoc s2p`
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to