Giter Club home page Giter Club logo

Comments (10)

guest20 avatar guest20 commented on August 28, 2024 1

You likely don't see it a lot because push my @thing,... is very similar to my @thing =... , since you're pushing into an empty array.

from perl5.

guest20 avatar guest20 commented on August 28, 2024 1

Sorry? Just to clarify... Are you saying you've not ever seen push my @thing in any code?

from perl5.

Leont avatar Leont commented on August 28, 2024 1

And never having seen exactly even one example of my style

It's fine to have a personal style, but the docs are not the place to evangelize it. Especially when it is a lot easier to get this wrong than the obvious my @thing =... and push @thing, ....

from perl5.

rwp0 avatar rwp0 commented on August 28, 2024 1

It is somewhat reminiscent of:

for my $item ( @items ) {
  ...
}

or:

chomp my $line = readline();

I also like this style and use it a lot, ie. defining/declaring/scoping variables in-place (rather than in a separate statement earlier).

I find it to be a lovely Perlism esp. where other languages lack this "shortcut".

from perl5.

Leont avatar Leont commented on August 28, 2024 1

I also like this style and use it a lot, ie. defining/declaring/scoping variables in-place (rather than in a separate statement earlier).

No one argued against declaring variables in-place per se, and in fact we have plenty of examples of that in our docs.

from perl5.

guest20 avatar guest20 commented on August 28, 2024 1

@jidanni The motto of perl is "There's more than one way to do it".

from perl5.

Grinnz avatar Grinnz commented on August 28, 2024

my @x can be used in almost any place @x can be used. It doesn't really need examples everywhere.

from perl5.

jidanni avatar jidanni commented on August 28, 2024

my @x can be used in almost any place @x can be used. It doesn't really need examples everywhere.

I wish the documentation would say just what you said too then. But it's never mentioned that either.

Anyway I've never seen anybody use the useage that I've presented. How did I figure it out? By accident!

from perl5.

jidanni avatar jidanni commented on August 28, 2024

Well that is very well and good that most people can immediately tell that they're all the same. But for us other people, they're totally two different animals. And never having seen exactly even one example of my style, I think it would be high time to throw a few on some Man pages. Thanks.

from perl5.

jidanni avatar jidanni commented on August 28, 2024

Maybe somewhere in the docs have a

Stick to the documented usage

You might have discovered different ways to write Perl expressions.

But we purposely don't document them. Please use the documented reliable syntax.

from perl5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.