From aa96bf2faf1a6291b1fb47a8f1581b61f8c0ec6a Mon Sep 17 00:00:00 2001 From: Vit Gottwald Date: Tue, 22 Apr 2025 09:49:34 +0200 Subject: [PATCH 1/2] Fix perl example The perl example does not work with http://nixos.org because it redirects. Updating the url to https requires additional package. --- doc/manual/source/command-ref/nix-shell.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/manual/source/command-ref/nix-shell.md b/doc/manual/source/command-ref/nix-shell.md index e95db9bea..9f371bff3 100644 --- a/doc/manual/source/command-ref/nix-shell.md +++ b/doc/manual/source/command-ref/nix-shell.md @@ -242,16 +242,18 @@ print(t) ``` Similarly, the following is a Perl script that specifies that it -requires Perl and the `HTML::TokeParser::Simple` and `LWP` packages: +requires Perl and the `HTML::TokeParser::Simple`, `LWP` and +`LWP::Protocol::Https` packages: ```perl #! /usr/bin/env nix-shell #! nix-shell -i perl --packages perl perlPackages.HTMLTokeParserSimple perlPackages.LWP +#! nix-shell -i perl --packages perl perlPackages.HTMLTokeParserSimple perlPackages.LWP perlPackages.LWPProtocolHttps use HTML::TokeParser::Simple; # Fetch nixos.org and print all hrefs. -my $p = HTML::TokeParser::Simple->new(url => 'http://nixos.org/'); +my $p = HTML::TokeParser::Simple->new(url => 'https://nixos.org/'); while (my $token = $p->get_tag("a")) { my $href = $token->get_attr("href"); From 9f94a1b9fb87a8d56c5d2d676551a23c589933a5 Mon Sep 17 00:00:00 2001 From: Vit Gottwald Date: Tue, 22 Apr 2025 10:45:15 +0200 Subject: [PATCH 2/2] Put every package on its own line --- doc/manual/source/command-ref/nix-shell.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/manual/source/command-ref/nix-shell.md b/doc/manual/source/command-ref/nix-shell.md index 9f371bff3..455899d56 100644 --- a/doc/manual/source/command-ref/nix-shell.md +++ b/doc/manual/source/command-ref/nix-shell.md @@ -247,8 +247,11 @@ requires Perl and the `HTML::TokeParser::Simple`, `LWP` and ```perl #! /usr/bin/env nix-shell -#! nix-shell -i perl --packages perl perlPackages.HTMLTokeParserSimple perlPackages.LWP -#! nix-shell -i perl --packages perl perlPackages.HTMLTokeParserSimple perlPackages.LWP perlPackages.LWPProtocolHttps +#! nix-shell -i perl +#! nix-shell --packages perl +#! nix-shell --packages perlPackages.HTMLTokeParserSimple +#! nix-shell --packages perlPackages.LWP +#! nix-shell --packages perlPackages.LWPProtocolHttps use HTML::TokeParser::Simple;