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

Re^2: Find element in array

by GrandFather (Saint)
on Feb 17, 2020 at 03:35 UTC ( [id://11113036]=note: print w/replies, xml ) Need Help??


in reply to Re: Find element in array
in thread Find element in array

This reply would be better if it actually compiled. Line 19 (the first print in the if body) is missing a semi-colon - obviously not the code you ran to produce the given output!

It would also be better to use a manifest variable instead of the default variable in the while statement so both the intent and scope are clearer. Bundling an assignment and operation on a variable into one line probably isn't best practice in an example for someone new to Perl ((my $bad=$_)=~ tr/[ATCG]/ /;).

Do you really expect $bad=~ s{\w}{print 1+pos($bad),','}eg; to make sense to an entry level Perl user, even with the comment?

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Replies are listed 'Best First'.
Re^3: Find element in array
by clueless newbie (Curate) on Feb 17, 2020 at 15:12 UTC

    mea culpa, mea culpa, mea maxima culpa!

Log In?
Username:
Password:

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

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

    No recent polls found