What does this line of Perl mean?
if (/ile.*= (\d*)/ || /ile.*=(\d*)/ ) {
I am particularly interested in what the “/ile” means, and why both sides of the || are identical.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The syntax
/.../contains a regular expression. The two sides of the||are subtly different – the second one has no space after the equals sign.The first
/.../decodes as “match the letters ‘i, l, e’ then any character (.) any number of times (*), then an equals (=), then a space, then there is a capture (the brackets) that grabs zero or more digits (\d*).The match is not tied to a Perl variable so it will be against the default scalar
$_.