Domanda

Use case:

$ cat test.rc 
my $a = 'foo';
$ re.pl --rcfile test.rc
$ $a                                                                                                                                      
$

Expected output: foo. What am I doing wrong?

È stato utile?

Soluzione

Aha, the path handling is a bit funny:

$ re.pl --rcfile ./test.rc                                                                                            
$ $a                                                                                                                                      
foo

It’s in the documentation:

To set a new run control file that's also in that directory [$HOME/.re.pl/], pass it as a filename like so: (…) If the filename happens to contain a forward slash, then it's used absolutely, or realive to the current working directory.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top