Questions tagged [sigils]

Symbols attached to variable names, showing datatype or scope.

A sigil is a symbol attached to a variable name, showing the variable's datatype or scope.

For instance in Perl, $ is the sigil denoting scalar type of the variable $foo, while @ is the sigil denoting the array type of @foo.

For more information and a list of other languages featuring sigils, see the Wikipedia article on sigils.

30 questions
1
vote
2 answers

How to replace deprecated ~E sigil with ~H in Phoenix render funciton

Background In my quest to learn Phoenix LiveView I found myself using a render function that uses a deprecated sigil: def render(_assigns) do ~E""" ">
Flame_Phoenix
  • 16,489
  • 37
  • 131
  • 266
1
vote
1 answer

Sigil editor: Regex string to look for a (hyphen) character in text, but not html attributes

My problem: I use Sigil to edit xhtml files of an ebook. When exporting from InDesign to ePub I tick option to remove forced line breaks. This act removes all - hyphen characters which are auto-generated by InDesign, but the characters which were…
Peter
  • 2,634
  • 7
  • 32
  • 46
1
vote
2 answers

Escape closed parenthesis in elixir sigil

I want to have a custom sigil, so that i can have one element per line. This is code i have def sigil_l(text,[]), do: String.split(text,"\n") This works fine for ~l(Clash of Titans The day after Tomorrow The Transporter ) This fails…
Sandesh Soni
  • 410
  • 2
  • 9
1
vote
2 answers

Why the syntax for defining sigils in Elixir doesn't use "defsigil"?

I was reading the page about sigils in the Elixir tutorial. I expected the syntax for defining sigils uses "defsigil" just like "defstruct", "defprotocol", and so on. But it was not so. Why?
ryo33
  • 31
  • 4
1
vote
2 answers

Why I can use @list to call an array, but can't use %dict to call a hash in perl?

Today I start my perl journey, and now I'm exploring the data type. My code looks like: @list=(1,2,3,4,5); %dict=(1,2,3,4,5); print "$list[0]\n"; # using [ ] to wrap index print "$dict{1}\n"; # using { } to wrap key print…
Zen
  • 4,381
  • 5
  • 29
  • 56
1
vote
1 answer

Perl: assign a scalar directly to a hash

While looking at some Perl code, I came across the assignment of the output of chr directly to a hash: local %str = chr(shift); Confused that the code worked fine, this made me realise the following: perl -le 'my $jurso = 23; print…
Badder
  • 13
  • 2
1
vote
2 answers

Inconsistent (silly?) data access in Perl 5 (also confusing me regarding use of sigils)

This question is about asking for some explanation of what's going on in the Perl system for I don't implicitly see the point though I'm coding for more than 25 years now. So here comes the story ... On trying to work with Cyrus::IMAP::Admin…
Thomas Urban
  • 4,649
  • 26
  • 32
0
votes
1 answer

In Elixir, how do I remove ALL whitespace from a string?

I want to remove ALL whitespace from a string, that is, if I have: rna= "AUG UUU UCU" Then I'd like to have: new_rna="AUGUUUUCU" How do I do that in Elixir?` I looked up way of trimming strings but that hardly helps for whitespace in the interior of…
0
votes
0 answers

SIGILL /proc/self/maps: cant execute native codes

Can somebody help me how to repair this problem ? how to repair a /proc/self/maps path ? bcs i cant start native codes ... When i try open native script i get automatically SIGILL and i dont know why... root@server:/servers/Fivem/server-data# cd…
0
votes
1 answer

Backporting Sigils and make it work with variables

So I'm just starting out in Elixir and saw that the current master adds support for a ~U[2015-01-13 13:00:07Z] sigil to create/parse UTC date. Code follows: defmodule MySigils do defmacro sigil_U(datetime_string, modifiers) defmacro…
John Smith
  • 1,726
  • 2
  • 18
  • 30
0
votes
1 answer

Perl compilation woes

I'm having some troble compiling this method: #changes the names of the associations for $agentConf #where the key value pairs in %associationsToChangeDict are the old and new values respectively sub UpdateConfObjectAssociations{ my($agentConf,…
chickeninabiscuit
  • 9,061
  • 12
  • 50
  • 56
0
votes
2 answers

Join Broken Paragraphs HTMl Regex

I'm trying to edit some xhtml on Sigil. With the command < p>([a-z]) I'm able to find all paragraphs that begin with lower case. That tells me that they shouldn't be separate from the previous one. It's just a conversion issue. What should I do to…
Reno
  • 1
0
votes
1 answer

What does the @ sign do?

I have code @array = array. What does putting the @ sign before array do?
maudulus
  • 10,627
  • 10
  • 78
  • 117
0
votes
2 answers

double $ statement in php

What does the double $ statement stands for in PHP?
mck89
  • 18,918
  • 16
  • 89
  • 106
-3
votes
1 answer

What is the benefit of Sigils in Perl?

I understand the rules with sigils. I can make hashes from lists, and pass refs around with the mediocre-ist of them. What I don't understand are the benefits sigils provide in Perl. Some of the reasons I've heard are: String Interpolation Ruby…
user63438
  • 5
  • 1
1
2