This may be written cleaner, but it works

($tarfile) = $tarfile =~ /\.(.*)$/;



                                                                                       
                              
                    "Purcell, Scott"                                                   
                              
                    <[EMAIL PROTECTED]>                      To:                   
                              
                    Sent by:                                     
"'[EMAIL PROTECTED]'"       
                    [EMAIL PROTECTED]        
<[EMAIL PROTECTED]>         
                    eState.com                                   cc:                   
                              
                                                                 Subject:     $1 
question                            
                                                                                       
                              
                    04/19/01 03:32 PM                                                  
                              
                                                                                       
                              
                                                                                       
                              


Hello,
I don't know why I can't ever do this, but I know I have seen what I am
trying to accomplish done in one line.

I have a line that looks like the following:
my $tarFile = 1234567_six12.tar
And I want to strip off the '.tar'

So I know I can catch everything up to the first '.' in a ()
$tarFile =~ s/^(\w+)\./$1/;

print "$tarFile; gives me 1234567_six12tar, it just removes the period?

What the heck am I doing wrong today? Any ideas? Or does this have to be
done on two lines like my next eg. which works.

$tarFile =~ s/^(\w+)\./$1/;
my $tmpGoodFile = $1;

That just doesn't seem proper to me.

Thanks
Scott Purcell

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users




_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to