Ok,

> ## This Does what _not_ do what I would expect  -- return the first 3
> characters of type '\w' 

Give this a shot!


#!/usr/bin/perl -w
use strict;

$tmp ="Joe Smore1qazxswedcvfrtgbnhytujmkilptyoXXXXt5000";
$tmp =~ s/(^\w{3})/$1/;
print "$tmp\n";

This returns the whole string ... sorry about the earlier posts..
Although I still am not clear on the syntax of the following ::

## This Does what I want !!
$tmp ="Joe Smore1qazxswedcvfrtgbnhytujmkilptyoXXXXt5000";
($tmp) = $tmp =~ m/^(\w{3})/;
print "$tmp\n"; ## "Joe"

Why does $tmp need '(...)'  ??



Thx
DG

(kora musician / audiophile / webmaster @ www.coraconnection.com  / Ft. Worth, 
TX, USA)

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to