Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: What would you do?

by merlyn (Sage)
on Mar 16, 2001 at 03:15 UTC ( [id://64831]=note: print w/replies, xml ) Need Help??


in reply to What would you do?

# set even elements of @list to 'hi'... $_ % 2 or $list[$_] = 'hi' for 0..$#list;
And yes, the comment would be mandatory.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: What would you do?
by jlawrenc (Scribe) on Mar 16, 2001 at 23:02 UTC
    I would like to underscore the wisdom of merlyn's comment comment.

    Not only does his comment exist, but it is a succinct explaination of the code. (It is not an English translation of the statement like: do nothing if default variable is not mod 2 otherwise set the list of the default variable to 'hi' for the size of the list.).

    Good example - good style. I wish more people would follow this example! :)

Re: Re: What would you do?
by Anonymous Monk on Mar 16, 2001 at 04:27 UTC
    How is the comment mandatory? It works fine without it.

Log In?
Username:
Password:

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

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

    No recent polls found