Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Counting Array in an Array of HoA

by omega_monk (Scribe)
on May 09, 2005 at 16:03 UTC ( [id://455213]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Counting Array in an Array of HoA
in thread Counting Array in an Array of HoA

No, I believe the "=~" is used in regex there, from my minimal understanding $test is the string that contains the regex. I am still trying to understand the how on the rest of the script, though.

Update: After some testing, I used a much simpler version to get to this.
#!/usr/bin/perl -w use strict; my $string='ABCD'; my $string1='DCBA'; my $test='.*?AB'; print "Matched in $string" if $string =~ $test; # Prints Match. print "Matched in $string1" if $string1 =~ $test; # Does not print + Match.

So $test does contain the regex '.*?AB' or '.*?BA'. If I am not correct here, please let me know.

Update: Adjusted code to differentiate the output.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2025-04-19 23:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.