Michael Gale <[EMAIL PROTECTED]> wrote:
> print $input it will equal "Memory Usage: 1234;678;000;4567"
> print $input =~ /(\d+);(\d+);(\d+);(\d+)/; it will produce "12346780004567"
> 
> which may be confusing ... because what happens to $1 ? Remember because
> "/(pattern)/" is supposed to assign the match to a $1 and $2 and so on.
> It actually does ... it just gets printed with out any spaces.

use the field seperator variable, $, if you assign a string to this
variable the output of the print function will more clearly show the
individual values $1,$2,$3,etc.  for example:

$, = "\n";
print $input =~ /(\d+);(\d+);(\d+);(\d+)/;

will print each of the values on their own line.

Dave

_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to