> Hi all,
> 
> say that 
> 
> $directory = "C:\\directory\\*.*"
> 
> and I am trying to remove the *.* from the end  using
> 
> $directory = trim($directory);
> 
> 
> where 
> 
> trim is
> 
> sub trim {
>    my( $result) = @_;
> 
>  $result =~ s/^\s+(.*?)\s+$/$1/; 

Because . And * have special meanings in a regex.
And the ^ is looking for \s+ ( Whitespace) at the beginning of the string.
Try
$result =~ s/\*\.\*$//;
Which says remove the *.* from the end of this string.

HTH

DMuey

>  $result =~ s/\s//g; 
>  return $result;
> }
> 
> 
> Can anybody point me out why it is not working?
> 
> TIA
> 
> Jair
> 
> 

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

Reply via email to