At 02:32 PM 4/19/2001 -0500, Purcell, Scott wrote:
>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/;

The problem is that s/x/y/ just replaces x (not the whole string) with y.
How about using:

$tarFile =~ s/\.tar$//;
----------------------------------------------------
John Deighan
Public Consulting Group
2000 Kraft Dr.
Suite 1106
(540) 953-2330
----------------------------------------------------

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

Reply via email to