Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: mixed case with match

by gam3 (Curate)
on Sep 22, 2020 at 08:30 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11122063]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-23 20:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found