Help for this page

Select Code to Download


  1. or download this
    my $stream = 't1 t2 t1 t3 t1 t4';
    my @tokens = ('t1, 't2', 't3', 't4');
    ...
        print "token: $1\n";
    }
    
  2. or download this
    while ($stream =~ /$regex/g) {
        print "token: $1\n";
    }
    
  3. or download this
    while ($stream =~ /($pattern)/g) {
        print "token: $1\n";
    }