Ahh!! Thanks for help. That did it.
-Scott
-Original Message-
From: Jeff 'japhy/Marillion' Pinyan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 11:46 AM
To: [EMAIL PROTECTED]
Cc: Perl Help
Subject: RE: Remove White Space
On Aug 7, Scott Martin said:
>I am
On Aug 7, Scott Martin said:
>I am stumped, none of these are working. I even tried something like
>$url=~s/\t*^\.htm/\.htm/g
Well, that is totally broken, so don't worry.
> $url =~ s///gs;#removes accidental in the file
That /s modifier is totally useless there.
> $url
again for everyones help!
-Scott
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 5:09 PM
To: [EMAIL PROTECTED]
Cc: Perl Help; 'Mooney Christophe-CMOONEY1'
Subject: RE: Remove White Space
make sure you are also getting rid of t
On Aug 6, Mooney Christophe-CMOONEY1 said:
>That would do it. Without the 's' in front of the regex, it doesn't know
>you're trying to search and replace.
>
>The divide error is odd, and shouldn't be happening, but try this instead:
> s(\s*)()g
The divide-by-zero error was because writing
Hi,
I think that you can do it like this:
s/^/ //g;
will work (or should work) in SED, so I assume that it
will in Perl also.
HTH,
Thomas Adam
--- Scott Martin <[EMAIL PROTECTED]> wrote: >
How can I remove white space from the beginning of a
> variable?
>
> -Scott
>
>
=
Thomas
Actually, \s takes care of any whitespace, including tabs.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 4:09 PM
To: [EMAIL PROTECTED]
Cc: Perl Help; 'Mooney Christophe-CMOONEY1'
Subject: RE: Remove White Space
make su
make sure you are also getting rid of tabs
$var=~s/\t*^//g
"The software said it required Windows 3.1 or better so I installed Linux.
"
Royce Wells
Unix Systems Engineer
Dept # 8023
103 S. Front St.
Memphis, TN 38101
Phone: (901)495-7538
Fax: (901)495-3300
--
PROTECTED]]
Sent: Monday, August 06, 2001 4:10 PM
To: 'Mooney Christophe-CMOONEY1'
Cc: Perl Help
Subject: RE: Remove White Space
No error messages or anything, but the white space is still in there. I
did, however change the syntax to
$var=~ s/\s*//g;
From
$var=~/\s*//g;
Because I got
At 01:49 PM 8/6/2001 -0700, Wagner-David wrote:
> Should be ^ not $ to remove leading and \s+$ to remove trailing.
To quote a famous philosopher:
D'OH
(The hamster falls off the wheel if he's not paying attention)
My bad and my sincere apologies.. Thanks for the correction.
]]
Sent: Monday, August 06, 2001 5:01 PM
To: 'Perl Help'
Subject: RE: Remove White Space
What happens when you try?
-Original Message-
From: Scott Martin [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 4:05 PM
To: 'Mooney Christophe-CMOONEY1'
Cc: 'Perl Help
What happens when you try?
-Original Message-
From: Scott Martin [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 4:05 PM
To: 'Mooney Christophe-CMOONEY1'
Cc: 'Perl Help'
Subject: RE: Remove White Space
That's what I thought it would be but still no luc
That's what I thought it would be but still no luck.
-Scott
-Original Message-
From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 4:52 PM
To: Perl Help
Subject: RE: Remove White Space
$var=~/\s*//g; # ;)
-Original Message-
From:
$var=~/\s*//g; # ;)
-Original Message-
From: Scott Martin [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 3:56 PM
To: Perl Help
Subject: RE: Remove White Space
After I sent it out, I actually came up with the idea myself after some
digging. (go figure) any case, I am now
Should be ^ not $ to remove leading and \s+$ to remove trailing.
Wags ;)
-Original Message-
From: Carl Rogers [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 13:46
To: [EMAIL PROTECTED]; Perl Help
Subject: Re: Remove White Space
At 04:13 PM 8/6/2001 -0400, Scott
any ideas?
-Scott
-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 4:45 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Remove White Space
> -Original Message-
> From: Scott Martin [mailto:[EMAIL PROTECTED]]
> Sent: Mond
At 04:13 PM 8/6/2001 -0400, Scott Martin wrote:
>How can I remove white space from the beginning of a variable?
$variable =~ s/$\s+//;
removes one or more spaces in the beginning
HTH
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
$var=~s/^\s*//;
-Original Message-
From: Scott Martin [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 3:13 PM
To: Perl Help
Subject: Remove White Space
How can I remove white space from the beginning of a variable?
-Scott
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For a
> -Original Message-
> From: Scott Martin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 06, 2001 4:13 PM
> To: Perl Help
> Subject: Remove White Space
>
>
> How can I remove white space from the beginning of a variable?
This is a FAQ:
perldoc -q strip
--
To unsubscribe, e-mail
substitute whitespace for nothing while matching the beginning of the
scalar?
On Mon, 6 Aug 2001, Scott Martin wrote:
> How can I remove white space from the beginning of a variable?
>
> -Scott
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED
19 matches
Mail list logo