Perl: Difference between revisions
imported>HLandau mNo edit summary |
imported>Raboof document caveats running a perl script |
||
Line 1: | Line 1: | ||
== | ==Running a Perl script== | ||
Common problems and solutions: | |||
<code>Can't locate DB_File.pm in @INC (you may need to install the DB_File module)</code>: run it with <code>nix-shell -p perl -p perlPackages.DBFile --run ./myscript.pl</code> | |||
<code>./myscript.pl: bad interpreter: /usr/bin/perl: no such file or directory</code>: change the first line of the script to <code>#!/usr/bin/env -S perl</code> or start it with <code>perl ./myscript.pl</code> | |||
==Adding something from CPAN to nixpkgs== | |||
* Use the <tt>nix-generate-from-cpan.pl</tt> script (see <tt>nixpkgs/maintainers/scripts/</tt>) to generate something appropriate.<br/>Example usage: <tt>nix-generate-from-cpan.pl Devel::REPL</tt> | * Use the <tt>nix-generate-from-cpan.pl</tt> script (see <tt>nixpkgs/maintainers/scripts/</tt>) to generate something appropriate.<br/>Example usage: <tt>nix-generate-from-cpan.pl Devel::REPL</tt> |