Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Regex (find an * after a digit)

by Anonymous Monk
on Feb 06, 2004 at 03:08 UTC ( [id://326977]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://326977]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-19 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found