Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: search one instance

by d5e5 (Beadle)
on Nov 03, 2010 at 15:08 UTC ( #869255=note: print w/replies, xml ) Need Help??


in reply to search one instance

I'm not sure I understand your question, but why not the following?
#!/usr/bin/perl use strict; use warnings; my $string = 'data' x 20; if ($string =~ m/data/) { print "Matching '$&'", "\n"; } print 'from $string which has value of ', "$string\n"; #Output: #Matching 'data' #from $string which has value of datadatadatadatadatadatadatadatadatad +atadatadatadatadatadatadatadatadatadatadata

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2023-03-24 21:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (62 votes). Check out past polls.

    Notices?