RE: trim function

2003-06-11 Thread Dan Muey
> 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 mea

Re: trim function

2003-06-11 Thread Rob Dixon
Jair Santos wrote: > Hi all, > > say that use strict;# always use warnings; # usually > $directory = "C:\\directory\\*.*" Use single quotes for cuter code. my $directory = 'C:\directory\*.*'; > and I am trying to remove the *.* from the end using > > $directory = trim($directory);

trim function

2003-06-11 Thread Jair Santos
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/; $result =~ s/\s//g; return $result; } Can anybody point me out why