Perl Reguler expression meaning

Hello there,
could you please Help me,
My perl scrpt is
#if (($infoline =~ /$costCenter/) && !($infoline =~ /_/))
                  if ($infoline =~ /[^_]$costCenter/)
                  {
                        $debugString = $infoline;
                        myDebug();
                        $receivedLoginPath = $infoline;
                  }

            }

What the regular expression tell in tthis matter?

Because I need to get in the log file is below info,

CTSA1_state=Name of the state.
CTSA1_city=_Name of the city.
CTSA1_postalCode=5 numbers
CTSA1_company=Name of the Company
CTSA1_sAMAccountName=Some specific account name
CTSA1_scriptPath=\alluser.bat (Specially here instead of just /alluser.bat I should have got Company name/Department/COst center number/alluser.bat)

how I shoul dget it?
Is there anything wrong in regular expression or what?
Thank you,

racheleeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ozoConnect With a Mentor Commented:
for example, if $costCenter is X then $infoline =~ /[^_]$costCenter/   it true when $infoline contanins a character other than _ followed by X

if $costCenter is )(**  then /[^_]$costCenter/ is an error
0
 
ozoCommented:
it tells whether $infoline contains a character other than _ followed by whatever is matched by $costCenter

If there is something wrong in $costCenter, then there is something wrong in the regular expression
0
 
racheleeAuthor Commented:
Mr OZO,
Thnx a lot for a prompt reply ,

would u please give more explaination about this
>>it tells whether $infoline contains a character other than _ followed by whatever is matched by $costCenter

Because I am new bie ..Sorry to bother u.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
racheleeAuthor Commented:
yep I could solve it dear ...
Thank you so much....

I appreaciate u for explaining it.
I just put a debug there for cost center and worked well...
0
 
racheleeAuthor Commented:
Would please so kind to suggest what all I can read to understand regarding Perl scripting and problems or tutorials regarding the same.

Thanking you,
0
 
racheleeAuthor Commented:
Please let m eknow if you can...but only online stuff I can not buy books I think.
0
 
ozoCommented:
perldoc perlre
0
 
racheleeAuthor Commented:
thnx ,

have a nice day...byeeee
0
All Courses

From novice to tech pro — start learning today.