Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: Plural variable naming (or not?)

by tachyon (Chancellor)
on Mar 19, 2002 at 16:50 UTC ( [id://152770]=note: print w/replies, xml ) Need Help??


in reply to Re: Plural variable naming (or not?)
in thread Plural variable naming (or not?)

Does this look right? Accessing a plural array for a singular element

my @replies = ( 'so', 'plurals', { 'you' => 'think?' } ); my $answer = $replies[2]->{you}; print $answer;

Replies are listed 'Best First'.
Re: Re: Re: Plural variable naming (or not?)
by cjf (Parson) on Mar 19, 2002 at 20:36 UTC

    Actually, yes, it does :)

    It might only appear right to me because I've become accustomed to doing it that way. I do see your point, but I still find plural array names feel more natural than singular ones:

    my @reply = qw/a singular array name? how odd/; my $cannotnamethisreply = $reply[5]; print $cannotnamethisreply;

    Now that looks stranger to me than using a plural for the array name and a singular for the related scalar. I can understand either view though. :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-03-28 10:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found