in reply to Quating sed string in perl

Your original sed line is missing a quote. If you want to call the same line through system, you have to quote it, but there is no need to quote the slashes or commas. Another problem is the variable $file: if it is a Perl variable, you should not put it into signle quotes, as they do not interpolate variables, but doulbe quotes do. If it is a shell variable, make sure it exists in the subshell started by system.
system "sed -n -e '/log-passed/,/log-end/p' /var/log/app1/$file"; # Pe +rl variable

Update: It is still a mystery why you cannot let Perl do all the work:

open my $FH, '<', "/var/log/app1/$file" or die $!; while (<$FH>) { print if /log-passed/ .. /log-end/; }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Quating sed string in perl
by hdb (Monsignor) on Jun 05, 2013 at 14:05 UTC

    It is probably because Perl's flip-flop operator is a greater mystery to people than sed.

      Understandable. Comma versus two dots!
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re^2: Quating sed string in perl
by SatisfyMyStruggles (Initiate) on Jun 05, 2013 at 14:02 UTC

    Thanks for the suggestion

Re^2: Quating sed string in perl
by SatisfyMyStruggles (Initiate) on Jun 05, 2013 at 14:14 UTC

    its now working and thanks for understanding the question and fixing this problem

Re^2: Quating sed string in perl
by SatisfyMyStruggles (Initiate) on Jun 05, 2013 at 14:08 UTC

    thanks but your perl code does not work on this file. It prints the whole file, I'm only able to get it to work in sed