Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: mixed case with match

by gam3 (Curate)
on Sep 22, 2020 at 08:30 UTC ( #11122063=note: print w/replies, xml ) Need Help??


in reply to mixed case with match

# But I'm not a golfer. use strict; use warnings; sub test { my ($m, $line) = (undef, 0); while ( <DATA> ) { $line++; last if (($m) = m/(perl)/i); } if ($m) { printf "There were %d lines until I found '%s'\n", $line, $m; } else { printf "I never found 'perl' in %d lines\n", $line; } } test test __END__ 1 2 3 This is peRl ok 1 2 3

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2021-01-23 04:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?