DEV Community

loading...

Perl Sigil is inherited from Shell Script Variable Expansion.

Yuki Kimoto
Perl and Mojolicious
・1 min read

Perl Sigil is inherited from Shell Script Variable Expansion.

my $name = 'Kimoto';
my $message = "I'm $name";
Enter fullscreen mode Exit fullscreen mode

I wish Perl's philosophy of respecting shell scripts became known.

This is not dirty things as some people say.

Discussion (13)

Collapse
emilper profile image
Emil Perhinschi

Perl's "sigils" are dereference operators , not true sigils ; BASIC had sigisl, PHP has sigils, Raku has sigils ... BASH and Perl 5 have dereference operators

if you think of them as dereference operators it is a lot easier to read Perl code

Collapse
brtastic profile image
brtastic

Partly yes, because $$var in PHP reads: variable with name stored in $var, while in Perl reads: variable which $var refers to.
Partly no, because $var and @var and %var are completely independent variables, and they likely shouldn't if they were dereferencing the same thing I guess.
Also, var itself is a bareword and does not exist as a variable without its sigil and outside of symbol table.

Collapse
emilper profile image
Emil Perhinschi

"$var and @var and %var are completely independent variables"

they're not independent in the symbol table

"var itself" would be a subroutine, which is stored in the same symbol table and accessed by using the & "sigil" if you really want to use "&", though the compiler tries subs first when encountering barewords

Collapse
yukikimoto profile image
Yuki Kimoto Author

Python is all of all unrelated in this entry.

Collapse
szabgab profile image
Gabor Szabo

Did you add the Python tag to this?

Collapse
yukikimoto profile image
Yuki Kimoto Author

"read next" show me unrelated python topic.

If the Dev Community team knows this things, it may lead to improvements.

Thread Thread
szabgab profile image
Gabor Szabo

There is a "#python" tag on this post.

My question was, if you added the #python tag to this post, or someone else?

Thread Thread
yukikimoto profile image
Yuki Kimoto Author

It's me, on the other hand, there is a reason to add it.

Thread Thread
szabgab profile image
Gabor Szabo

So you are misleading the algorithm by adding a Python tag to a post that has nothing to do with Python and then you are complaining that the algorithm does not work well.

Sounds totally reasonable.

Thread Thread
yukikimoto profile image
Yuki Kimoto Author

To be honest, I don't feel this is the best way to do it. This would be a bit rough way.

On the other hand, I have felt algorithms that increase prejudice and prejudgment in many places.

I want to reduce these because some people are suffering from it.

Collapse
yukikimoto profile image
Yuki Kimoto Author

This entry read next show pyenv. why?

Collapse
smonff profile image
🌌 Sébastien Feugère ☔

I guess the read next entries are based on your own interest on the platform. They are different for me.

  • ZSH
  • EOFError
  • Bash
  • Vim

By the way, they don't reflect my interests that much either.

Collapse
yukikimoto profile image
Yuki Kimoto Author

thank you.

I send a message and wait for improvement.

It feels like an algorithm that further widens the gap.