Skip to content

Tag: perl

open command in perl

I am try to use open command in perl. But getting and error as follows. Command open(IN_TRIALS, ‘<‘, “F:/2010_nist_sre_test_set/data/eval/keys/coreext-coreext.trialkey.csv”) or die “cannot open trials list”; Error cannot open trials. how to fix this? Answer First, make s…

need perl to die when implicit open fails

I’m trying to migrate a sed script to a perl one-liner, because perl supports non-greedy regexp. I’ve taken advices from Non greedy (reluctant) regex matching in sed? and Why is my Perl in-place script exiting with a zero exit code even though it’s failing? I need my oneliner to exit with no…

Redirect STDERR to a file from Perl in Linux

So, I was trying to catch the error messages from running some basic Linux command, using Perl. For example, I try to catch the STDERR when running the ldd command: But, even if the output of the ldd command does contain error messages such as ldd: warning: you do not have execution permission for, it won&#82…

Replacement of PS1 variable in .bashrc using Sed or Perl

I am trying to replace a line in file and am running in to issues. Original File: Command I am running: Error message: I also tried sed: Result with Sed: Expected Result File: End Result This doesn’t have much to do with the question except to show folks what the PS1 will look like when working properly…