Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: In my it is printing in the else i want to get output for the for loop in linux.

by hippo (Bishop)
on Mar 29, 2022 at 10:15 UTC ( [id://11142493]=note: print w/replies, xml ) Need Help??


in reply to Re: In my it is printing in the else i want to get output for the for loop in linux.
in thread In my it is printing in the else i want to get output for the for loop in linux.

Describe in words that you are trying to match.

Sometimes that can help; other times it just makes things worse.

How to ask better questions using Test::More and sample data is usually the winner.


🦛

Replies are listed 'Best First'.
Re^3: In my it is printing in the else i want to get output for the for loop in linux.
by Marshall (Canon) on Mar 31, 2022 at 00:57 UTC
    Well one would hope that "in words" means showing some examples in order to fully describe what is supposed to happen. I really have no idea from the OP's current code this thing is supposed to do. I will add "show some actual examples of match and no match" in future such requests.

    Test::More is fine, but something even easier could be fine too. The OP could get his point across by flushing this out with more examples...

    use strict; use warnings; #wild ass guess foreach (qw( /HD123FA45 /HD123FA45/anything anything/HD123FA45 /FC/blah /LM /H4p5 asdf/blah/x/H4p9 /asdf7758 )) { print "$_ "; if (/\/(H|HD)[0-9]{1,3}(FA|FC|C|P|CO)[0-9]{1,3}$/i or /\/(FC|LM|CO)/i) { print "\t...match!\n"} else {print "\t...no match!\n";} } __END__ /HD123FA45 ...match! /HD123FA45/anything ...no match! anything/HD123FA45 ...match! /FC/blah ...match! /LM ...match! /H4p5 ...match! asdf/blah/x/H4p9 ...match! /asdf7758 ...no match!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-03-29 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found