Prints:#!/usr/bin/perl use strict; use warnings; while (<DATA>) { # 1 # my @arr = split; # print if $arr[1] != $arr[3]; # 2 print if sub { $_[1] != $_[3] }->(split); } # 3 # while (@_ = <DATA> =~ /(\w+)\s+/g) {print "@_\n" if $_[1] != $_[3]} __DATA__ foo 1000 bar 1000 foo 1000 bar 500
foo 1000 bar 500
In reply to Re: regex search valid only if registers n and n+1 are equal?
by Miguel
in thread regex search valid only if registers n and n+1 are equal?
by Voronich
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |