On May 18, David Merrill said:
>$title =~ s/\s*$//;
>
>where $title = "The Linux Programmer's Guide "
>
>and it is being truncated after the ' mark. All I want to do is remove
>the trailing spaces from the string. Can someone please help?
You've already solved your problem about single q
This should work!
Can you give us a bit more context?
To be precise:
$title = "The Linux Programmer's Guide ";
$title =~ s/\s*$//;
That works.
If you don't get "The Linux Programmer's Guide" there has to
be something wrong in the code around that bit.
cr
On Fri, 18 May 2001 12:08:25
On Fri, May 18, 2001 at 10:38:50AM -0500, John Joseph Trammell wrote:
> On Fri, May 18, 2001 at 12:08:25PM -0400, David Merrill wrote:
> > Hi,
> >
> > I'm working on my very first perl application, which is a front end to
> > a database for the LDP. I am trying to truncate a string, using:
> >
>
Hi David,
try this one.
$title=~s/ *$//;
it does an in-place search for all trailing spaces and replaces them
with nothing.
Gary
On Friday 18 May 2001 5:08 pm, David Merrill wrote:
> Hi,
>
> I'm working on my very first perl application, which is a front end
> to a database for the LDP. I
On Fri, May 18, 2001 at 12:08:25PM -0400, David Merrill wrote:
> Hi,
>
> I'm working on my very first perl application, which is a front end to
> a database for the LDP. I am trying to truncate a string, using:
>
> $title =~ s/\s*$//;
>
> where $title = "The Linux Programmer's Guide "
>
Try this:
it just replaces MORE then one whitespace...
$title = "The Linux Programmer's Guide ";
$title =~ s/\s+$//;
Regards,
Jos
David Merrill wrote:
> Hi,
>
> I'm working on my very first perl application, which is a front end to
> a database for the LDP. I am trying to truncate a
Hi,
I'm working on my very first perl application, which is a front end to
a database for the LDP. I am trying to truncate a string, using:
$title =~ s/\s*$//;
where $title = "The Linux Programmer's Guide "
and it is being truncated after the ' mark. All I want to do is remove
the trai