RE: Remove White Space

2001-08-07 Thread Scott Martin

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 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=~s/\t*^\.htm/\.htm/g  #the troubled line I can't figure
out, 
>remove the space between filename and .htm

If you want to remove ANY whitespace immediately preceding the .htm,
then
do:

  $url =~ s/\s+\.htm/.htm/;

If you want to remove ANY whitespace in the string at all, do:

  $url =~ s/\s+//g;

-- 
Jeff "japhy" Pinyan  [EMAIL PROTECTED]
http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/
http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002
**


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




RE: Remove White Space

2001-08-07 Thread Scott Martin

I am stumped, none of these are working.  I even tried something like 
$url=~s/\t*^\.htm/\.htm/g
But I'm not sure if that is even remotely close.  Incase this might
help, here are a couple of lines BEFORE my new line.

$url = substr($url, 18, -3);   #removes the java script text to
get the filename
$url =~ s/^\s+//;  #removes white space at beginning of
filenames
$url =~ s///gs;#removes accidental  in the file
name
$url=~s/\t*^\.htm/\.htm/g  #the troubled line I can't figure
out, remove the space between filename and .htm

Thanks 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 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

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer.


-- 
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]




RE: Remove White Space

2001-08-06 Thread Scott Martin

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 a divide error when using the later.

-Scott



-Original Message-
From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] 
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'
Subject: RE: Remove White Space


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: 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 having another problem which,
even after some research still proves difficult.  I have a variable
like:  file .htm but what I want to do is trim the white space between
file and .htm   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: 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: [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]


-- 
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]




Remove White Space

2001-08-06 Thread Scott Martin

How can I remove white space from the beginning of a variable?
 
-Scott
 



RE: Remove White Space

2001-08-06 Thread Scott Martin

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: 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 having another problem which,
even after some research still proves difficult.  I have a variable
like:  file .htm but what I want to do is trim the white space between
file and .htm   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: 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: [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]


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




RE: Remove White Space

2001-08-06 Thread Scott Martin

After I sent it out, I actually came up with the idea myself after some
digging. (go figure) any case, I am now having another problem which,
even after some research still proves difficult.  I have a variable
like:  file .htm but what I want to do is trim the white space between
file and .htm   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: 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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




execute if NOT true.

2001-08-06 Thread Scott Martin

I am testing a string like so:  if ($url =~ /maincat/)  { block }  but I
want to execute if it does NOT find maincat.  How would I do that?
Could I use a ! in front of the = 
thanks
 
-Scott