Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Unable to retrieve the string bist_top_ctrl from a file

by hrcerq (Monk)
on May 22, 2021 at 15:55 UTC ( [id://11132890]=note: print w/replies, xml ) Need Help??


in reply to Unable to retrieve the string bist_top_ctrl from a file

Hi, aside from the other suggestions, you could also use split instead of a regex with a capture group, supposing this file will always be structured as a two-column CSV.

while (my $line = <$in>) { my @fields = split /,/, $line; if ($fields[0] = "controller_name") { $fourth = $fields[1]; } }

It could be further improved, but it's just so you get the picture.

Update: The fields variable had the wrong sigil and wasn't lexical. Now corrected.

return on_success() or die;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2026-05-11 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.