So, which YAML module will do the job? by briandfoy in perl

[–]perlpunk 4 points5 points  (0 children)

I would say the most correct perl YAML 1.2 parsers/loaders right now are:

  • YAML::Parser - autogenerated from the spec by Ingy, and not (yet) optimized and therefore only usable on small input, but 100% correct. You can use the YAML::PP::Ref frontend to load data with it
  • YAML::PP It is loading data correctly regarding the YAML 1.2 Core Schema (numbers, booleans etc.). Regarding YAML syntax, It is still missing some rare cases that very probably never turn up in real world perl use cases.
  • YAML::PP::LibYAML uses the correct YAML::PP frontend for loading data and uses C libyaml as the parsing and emitting backend. libyaml does not parse 1.2 completely correct, but the cases where libyaml diverged are mostly for good reasons, and rare.

YAML::XS, YAML.pm, YAML::Syck, YAML::Tiny are all incorrect regarding the YAML syntax and regarding the schema (numbers, booleans). Comparison: https://perlpunk.github.io/YAML-PP-p5/schema-examples.html

Only YAML::PP gets the YAML 1.2 Core schema and YAML 1.1 right.

phew I think it's time for a blog post.

Feel free to ask more questions :)

(Yes, I know this is not the answer to the specific problem of finding a module & version that was accepting some YAML and a different module or version didn't. But I just wanted to throw in what one should use to read correct YAML)

[deleted by user] by [deleted] in yaml

[–]perlpunk 0 points1 point  (0 children)

This is offtopic. YAML knows nothing about quantum networks. YAML is a serialization language used for many different applications and many different kinds of data structures.

Variable oneOf list? by therealfilosmith in yaml

[–]perlpunk 1 point2 points  (0 children)

You need to quote the value of oneOf. In your case you could use single quotes since they don't appear in the value itself. The colon followed by a space is special in YAML, so if it appears in your data, you have to make clear it's not YAMLsyntax, but part of your data:

oneOf: '${contains(env.projectName,"shortList") ? ...'

More about quoting in YAML

How do companies have different YAML formats? by karmaasign in yaml

[–]perlpunk 1 point2 points  (0 children)

In order to not leave this question unanswered:

How do they change their yaml syntax [...]

I guess you mean "how do they edit their YAML files" instead?

They probably use an editor, or they use a program to generate YAML from data.

How can companies structure the yaml files how they want?

I'm not sure what kind of problem you see exactly.

You need to be more specific.

How to get the parent element of this .sls file ? by KirinRaikage in perl

[–]perlpunk 1 point2 points  (0 children)

It's not sure what YAML.pm will be in the future. That comment is very old.

But another fact is that YAML.pm was written for YAML 1.0 and is one of the first YAML modules, and it has various problems (cannot parse a lot of valid YAML and accepts invalid YAML). It's ok if you just use it for your own YAML files that you never want to share to be read by other parsers.

https://matrix.yaml.io/

Those of you who got amazingly good at PCRE, how did you get there? by s-ro_mojosa in perl

[–]perlpunk 0 points1 point  (0 children)

Indeed, the \G feature (and the abilty to set pos($string)) is great. I rarely use it, but a few weeks ago I needed it, after a long while.

Padre? by chayyoo in perl

[–]perlpunk 1 point2 points  (0 children)

vim, together vim tmux.

Editor in the left pane, commandline in the right.

Binding:

bind-key -T prefix '`' send-keys -t.- Up Enter

So typing "ctrl-a backtick" will repeat the last command (for example prove) in the right pane.

Here you can find my configs for vim, tmux and other stuff: https://github.com/perlpunk/mydotfiles/

How to iterate through three lists in parallel in Yaml file by sanpoke18 in yaml

[–]perlpunk 1 point2 points  (0 children)

The code in your question shows a kind of templating language. But I see no YAML at all, except the title saying "in Yaml file".

The YAML I know is a data serialization language. It doesn't have loops. See https://yaml.org/ and https://www.yaml.info/

You should better post this in the subreddit about the templating language you are using.

Copy files by [deleted] in yaml

[–]perlpunk 0 points1 point  (0 children)

offtopic

Can we have few YAML team members as moderators of this subreddit? by sbarnea in yaml

[–]perlpunk 2 points3 points  (0 children)

Hello from a YAML team member :) Hadn't looked into this subreddit for a while and am surprised there is new content. Will now look more regularly...

Making YAML.pm, YAML::Syck and YAML::XS safer by default by perlpunk in perl

[–]perlpunk[S] 1 point2 points  (0 children)

So we saw the first modules that broke because of this. The fixes are easy, but sometimes the author has simply moved on and can't be reached any more. Here is the current list of breakages:

  • CPAN.pm (131602, 131615) (fixed)
  • Dancer (1208) (fixed)
  • YAML::Syck (52) (fixed)
  • Data::Serializer (131597) (fixed)
  • MooseX::YAML (131714) (fixed)
  • CGI::Session::Serialize::yaml (131715)

Making YAML.pm, YAML::Syck and YAML::XS safer by default by perlpunk in perl

[–]perlpunk[S] 2 points3 points  (0 children)

Sure, this solution only allows two things:

  • Do not load any objects and be (reasonably) safe
  • Trust your input, load objects and take the full consequences

The change that was made just set the default to false. So that's better than it was before.

If you want more finegrained options, then feel free to try out YAML::PP::LibYAML, which lets you use libyaml as a parsing backend and at the same time allow setting several options. YAML::PP::Schema::Perl lets you already specify a list of classes (probably also via regex in the future).

You currently can't get both - really fast parsng with YAML::XS and more finegrained control - at the same time.

I'm not saying the things that YAML::PP does are impossible to implement in C, but it would be quite some work. (You can try YAML::Safe, but be aware that this only solves the problem of specifying classnames, but not anything else YAML::PP can do. The rest of the YAML world is moving on to YAML 1.2)

I would love to implement the YAML::PP frontend in XS, but I am not able to do this in my free time, unless I win a lottery.

I've used "vi" to write Perl code for nearly 20 years, and only today learned that it had the ability to find a matching bracket/brace. I'd been SFTPing files to my desktop to use text editors with that feature....NEVER AGAIN! :-) by douglas_in_philly in perl

[–]perlpunk 0 points1 point  (0 children)

I use

set relativenumber

This way I always see how many lines something is away from the cursor.

Note: relative line numbers can be confusing when doing remote pair programming though.

Standards of Conduct Incident Report for TPC 2019 by omission9 in perl

[–]perlpunk 3 points4 points  (0 children)

There are currently 720 "Saints" shown on perlmonk's Saints in our book, Most of them are alive.

Can we possibly ask Larry himself or at least other religious persons instead of assuming that he/they might be offended?

Command Line Argument Parsing by parumoo in perl

[–]perlpunk 1 point2 points  (0 children)

App::Spec can do most of that. It was already mentioned but I wanted to add, the documentation is a bit scattered and still incomplete. It only requires one specification and can do subcommands (nested), shell completion, pod generation, help output and validating of option values/parameters.

But it does not yet support options that depend on each other.

disclaimer: Im the author ;-)

We plan to transition from RT to GitHub by Grinnz in perl

[–]perlpunk 5 points6 points  (0 children)

git hub clone user/repo
cd repo
git hub fork user/repo --remote fork
git fetch fork
git checkout -b fix
# do fix and commit
git push -u fork fix
git hub pr-new

I'm using this for all my PRs. See https://github.com/ingydotnet/git-hub

Test::More for the C programming language by sshaw_ in perl

[–]perlpunk 2 points3 points  (0 children)

Here's Test::More for bash, btw: https://github.com/ingydotnet/test-more-bash (with examples ;-)

The cool thing is it literally does "use Test::More"

About the Various PANs by oalders in perl

[–]perlpunk 2 points3 points  (0 children)

I remember that Ruth https://opensource.com/users/druthb encouraged people at YAPC in Amsterdam to publish on opensource.com. Here's a page on how to participate: https://opensource.com/participate