#!/usr/bin/perl -w use strict; my $line = "
"; if ($line =~ /)*$/) { printf("line matched\n"); if (defined($1)) { printf("right after match, 1 is defined\n"); } }