It looks odd to me b/c * and ? are both quantifiers which usually
triggers an error when you try to run it. See if this works for you:
$file_completename =~ /([^.]*)\.(.*)/;
On Tue, 2003-03-18 at 15:28, Marcelo Taube wrote:
> As u probably have guessed some part of my code is not working properly and
> i don't understand why!!
>
> This is the code.
> #####################################
> $file_completename =~ /(.*?)\.(.*)/;
> if ($2 eq $extension]) {
> #DO SOMETHING!!!
> }
> #####################################
> As u see, i'm trying to separate the complete name of a file in two parts,
> the filename ($1) and the extension($2)... then i check to see whatever a
> extension is of some kind and if it is, i do something.
> However this doesn't work. Because in $2, perl adds a "." before the
> extension.
> 4 example: if file_completename equal to "myfile.jpeg", then $2 equials to
> ".jpeg", but it should be "jpeg".
> What am i doing wrong?
> Thank u very much,
> Marcelo Taube
>
>
>
> _________________________________________________________________
> The new MSN 8: advanced junk mail protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> --
> 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]