Dude that doesn't work. You are substituing white space for the word you are trying to
match and store in $server.  Am I missing something.  That just returns the count of
matches.

Rgds
Dexter

Marcos Lorenzo de Santiago wrote:

> On Tue, 14 May 2002, Dexter Casey wrote:
>
>      > There are probably much better ways of doing this but how about
>      > if  ($line =~ /(\\\\)(\w+)\\/){
>      >     $server=$2;
>      > }
>
> ($server=$line)=~s/\\\w*$//
>
> Simpler, easier ;)
>
> m4c.
>
>      >
>      > Rgds
>      > Dexter
>      > [EMAIL PROTECTED] wrote:
>      >
>      > > I'm a little bit rusty on using regular expressions and need some help.
>      > > Let's say that I'm given \\Server\Pathname as a text.  How would I extract
>      > > "\\Server" from this and store it to a variable $server?
>      > >
>      > > Thanks,
>      > > Jason
>      > >
>      > > _______________________________________________
>      > > Perl-Win32-Admin mailing list
>      > > [EMAIL PROTECTED]
>      > > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>      >
>      > _______________________________________________
>      > Perl-Win32-Admin mailing list
>      > [EMAIL PROTECTED]
>      > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>      >

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to