> You pretty much answered your own question :-). The first is > the an array context and you are telling it to match a chunk > of the expression on the right and place it in the var. > > the second one in a scalar context, ask the question "does > the expr on th right match", answer is yes, to put 1 in $word. > > check this doc on scoping: > http://perl.plover.com/FAQs/Namespaces.html
if you wanted to keep in a scalar context and still print the match do: use warnings; use strict; my $line = "TRAVSTAT 08-27-2002 02:20:15 There is no output file required."; my $word = ($line =~ /(\S+)/); print $1; # the ( .. ) captures in memory to $1, next ( .. ) is $2, etc... > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]