> Dan,
> 
> return ($_[0] =~ s/^\<|\>$|\n|\r|\s$//g)[0];

Same thing.
No go, also tried with a "$" before the first "(" for kicks.
That gave me an error, of course but hey I tried right?

Thanks

Dan

> 
> ?
> 
> --------------------------
> David Olbersen 
> iGuard Engineer
> 11415 West Bernardo Court 
> San Diego, CA 92127 
> 1-858-676-2277 x2152
> 
> 
> > -----Original Message-----
> > From: Dan Muey [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, March 11, 2003 9:51 AM
> > To: Mark Anderson; [EMAIL PROTECTED]
> > Subject: RE: return a regex substitution in one line
> > 
> > 
> > 
> > > > I have this subroutine and it does what I need ::
> > > >
> > > > print rmgtlt($var);
> > > >
> > > > sub rmgtlt {
> > > > $_[0] =~ s/^\<|\>$|\n|\r|\s$//g;
> > > > return $_[0];
> > > > }
> > > >
> > > > Is there a way to so the substitution and return the
> > result in one
> > > > line?
> > > >
> > > > Like ::
> > > >
> > > > sub rmgtlt {
> > > > return ??? $_[0] =~ s/^\<|\>$|\n|\r|\s$//g;
> > > > }
> > > >
> > > > Is there a way to do this?
> > > > I know I must be missing something obvious , thanks for any
> > > guidance!
> > > 
> > > Without more comments or sample data, I'm not really sure
> > > what your function is doing, but here are some things to try:
> > > 
> > > sub rmgtlt {
> > >     $_[0] =~ s/^\<|\>$|\n|\r|\s$//g;
> > > }
> > > 
> > > sub rmgtlt {
> > >     return $_[0] =~ s/^\<|\>$|\n|\r|\s$//g;
> > > }
> > > 
> > > sub rmgtlt {
> > >     return ($tmp = $_[0]) =~ s/^\<|\>$|\n|\r|\s$//g;
> > > }
> > 
> > All three of those returns the number of matches like what 
> I tried! I 
> > also tried return ($_[0] =~ s/^\<|\>$|\n|\r|\s$//g);
> > Same thing.
> > 
> > Thanks for all the replies! Any other ideas?
> > 
> > Dan
> > 
> > > 
> > > 
> > > 
> > > --
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > > 
> > 
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to