# Perl without USE_PERL



## OH (Oct 22, 2010)

Feeling brave I decided to uncheck USE_PERL for the build of perl on a new system. Now I found a port that stumbles over this (multimedia/ffmpeg).

Is it worth submitting a pr over this (fixing the shebang of doc/texipod2.pl)?
Is it pointless because everyone uses USE_PERL anyway?
Should this be fixed upstream by having ffmpeg look for perl properly?


----------



## graudeejs (Oct 22, 2010)

Yes, if I understand you correctly
Where id you uncheck USE_PERL? in ffmpeg config?


----------



## OH (Oct 23, 2010)

No, in the config for perl.

When perl moved from base to ports they decided to create a symlink from the new /usr/local/bin/perl to the old /usr/bin/perl. This is basically a hack to prevent a lot of breakage, but I was wondering whether this hack is A. still needed and B. still wanted.


----------



## graudeejs (Oct 23, 2010)

well, you need that, because most (probably all) perl scripts use

```
#!/usr/bin/perl
```

Even I code this way
It's not a bug (as this is what every perl programmer [Even on Linux] expect)
Otherwise every perl script should have to be patched to work on FreeBSD

That's my 2 cents


----------



## OH (Oct 24, 2010)

You don't need it, because you can just as easily write 
	
	



```
#!/usr/local/bin/perl
```
 and every port-maintainer can make sure every perl-file in their port uses the correct shebang.
Better yet, according to perldoc, you should use env when possible 
	
	



```
#!/usr/bin/env perl
```
 (I'll grant you the text seems ambiguous on this).

With the env-option in mind, I seriously doubt your claim that everyone that writes in perl uses /usr/bin/perl, do you have any numbers and/or sources to back that up?
Also, if everyone uses /usr/bin/perl as you say, shouldn't the USE_PERL-option have been removed from perl and the symlink created without asking?

Also note, that as far as I know, perl is the only port to use this "hack", I can't find any symlinks for bash or php for example. Comparing shebangs only, thank you.


----------



## graudeejs (Oct 24, 2010)

OK, maybe I'm wrong...  (My book of perl teaches to use /local/bin/perl, and probably all scripts I have seen use /local/bin/perl, however you're right about env)


----------



## fronclynne (Oct 25, 2010)

OH said:
			
		

> Feeling brave I decided to uncheck USE_PERL for the build of perl on a new system. Now I found a port that stumbles over this (multimedia/ffmpeg).
> 
> Is it worth submitting a pr over this (fixing the shebang of doc/texipod2.pl)?
> Is it pointless because everyone uses USE_PERL anyway?
> Should this be fixed upstream by having ffmpeg look for perl properly?



Submitting a pr does seem like the logical next step (& prs aren't just for massive, Earth-shattering problems in any case), though I don't see #1 & #3 as mutually exclusive.

As for #2, I have an irrational fear of non-optional options.


----------



## graudeejs (Nov 11, 2010)

check this out
/usr/src/crypto/openssl/apps/CA.pl


----------



## OH (Nov 11, 2010)

killasmurf86 said:
			
		

> check this out
> /usr/src/crypto/openssl/apps/CA.pl



It uses /usr/bin/perl. In the same directory CA.pl.in uses /usr/local/bin/perl and it gets worse:


```
root@desktop /usr]# grep -r "#\!/usr/bin/perl" src | wc -l
      74
root@desktop /usr]# grep -r "#\!/usr/local/bin/perl" src | wc -l
      83
root@desktop /usr]# grep -r "#\!/usr/bin/env perl" src | wc -l
      22
```

Granted, not all of those are perl-scripts, but it does seem to show that perl's switch from base to ports was not carried out with due diligence. This is also why I haven't yet filed a pr. This 'problem' should be looked at in a much wider sense than a single port or source-file.


----------



## ProFTP (Nov 11, 2010)

russian perl

```
$ cat t.pl
#!/usr/bin/env perl

use utf8;

my $Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ = Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ();
print $Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ;

sub Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ {
    my $Ð¾Ð´Ð¸Ð½ = 1;
    my $Ð´Ð²Ð°  = 2;

    $Ð¾Ð´Ð¸Ð½ + $Ð´Ð²Ð°;
}
$ perl -l t.pl
3
```


----------

