Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by Corion (Patriarch)
on Mar 28, 2022 at 06:00 UTC ( [id://11142443]=note: print w/replies, xml ) Need Help??


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

Please rewrite your code as a SSCCE and tell us what output you get and what output you want.

In your case, such a SSCCE could be:

#!/usr/bin/perl use strict; use warnings; my $localdir = '\\some\\example\\dir\\HD1FA9'; my $tcId; if (($localdir =~ m/^[\w\W\s\S]+\\((H|HD)[0-9]{1,3}(FA|FC|C|P|CO)[0-9] +{1,3})/i) or ($localdir =~ m/^[\w\W\s\S]+\\((FC|LM|CO)+[\w\W\s\S]+)/i)) { $tcId = $1; } else { die "TC directory structure is not proper!"; } print "Have TC id '$tcId'\n";

Note that under Linux, directory names are separated with the forward slash / not the backslash \.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-19 06:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found