Making a mistake once can be exused,
making it twice is stupidity and
making the same mistake a third time only proves you have no brain ;-)

Sorry, I figured out where the problem is...

al

-----Ursprüngliche Nachricht-----
Von: Alessandro Lenzen [mailto:[EMAIL PROTECTED]]
Gesendet: Freitag, 27. Juli 2001 11:44
An: Beginners@Perl. Org
Betreff: $1


Hello folks!

I'm reading Jos Boumans "Perl Beginners Tutorial To Regular Expressions".
I'm stuck with a problem. Jos writes:

Also realise that $1 and friends store the contents of the last succesfull
match...
I wanted to check that and wrote this code:

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

my($string) = "This is a test!";
my($ergebnis);

$string =~ m/(\s\w+\s)/g;
$ergebnis = $1;
print("$ergebnis\n");
--------------------------------

Shouldn't a be printed?
I'm runnig perl, v5.6.0 built for i586-linux.
I wouldn't bother normally, but I'm trying to understand every bit of
perl...

al


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to