in reply to Re: Regex (find an * after a digit)
in thread Regex (find an * after a digit)

It thinks so, but I'm not using Unicode anywhere. Here's the whole script.
#!/usr/bin/perl # # use strict; use warnings; my $file = "input.txt"; open ( FILE, $file ) || die "Can't open $file $!"; while ( <FILE> ) { chomp; if ( $_ = /\d+\*/ ) { print "$_\n"; } }
As for the \d{1,} -- I was actually going to put an upper limit on it at one point, so just wrote it that way. For now the + will do though.

Update - I tried on another machine, and it works, so it's definitely machine related. Both machines are running Perl v5.8.0 Cheers

Replies are listed 'Best First'.
Re: Re: Re: Regex (find an * after a digit)
by I0 (Priest) on Feb 06, 2004 at 03:39 UTC
    Do you get the same error if you use =~ instead of = ?
Re: Re: Re: Regex (find an * after a digit)
by ysth (Canon) on Feb 06, 2004 at 09:52 UTC
    From perl581delta:
    =head2 UTF-8 On Filehandles No Longer Activated By Locale In Perl 5.8.0 all filehandles, including the standard filehandles, were implicitly set to be in Unicode UTF-8 if the locale settings indicated the use of UTF-8. This feature caused too many problems, so the feature was turned off and redesigned: see L</"Core Enhancement +s">.
    Consider upgrading, or switch to a non-UTF8 locale, or binmode FILE.