Works in shell, but not in perl! Please Help!

M

mikeybe

I can't seem to get this to work properly. I am running trying to print
the output of the commands that were piped, but I am only getting part
of the expected output.
Here is the code:
------------------------
@cat_progs = `selit -t"BOOK" -oC | selcat -iC -oeq -q">20060415"
-e{100},{245}`;
foreach (@cat_progs) {
print $_;
}
------------------------------
The commands will NOT be obvious. They are for use in a proprietary
program. However, the behavior is unexpected. For example,

If I run this command in the shell (same as in the script): selit
-t"BOOK" -oC | selcat -iC -oSeq -q">20060415" -e{100},{245} ... I get
the output that I WANT:

Roberts, Nora.|Carnal innocence / Nora Roberts.|20060425|
Coulter, Catherine.|Riptide / Catherine Coulter.|20060425|
O'Dell, Tawni.|Back roads / Tawni O'Dell.|20060425|

But when I run the script (which inserts the same command between the
ticks), I get this:
-|-|20060425|
-|-|20060425|
-|-|20060425|

I know it must be missing something easy, but I can't find it and I
have been pulling my hair out. Can anyone help?
Thanks!
Mike
 
D

DJ Stunks

mikeybe said:
I can't seem to get this to work properly. I am running trying to print
the output of the commands that were piped, but I am only getting part
of the expected output.
[from perl]: `selit -t"BOOK" -oC | selcat -iC -oeq -q">20060415" -e{100},{245}`;
[from shell]: selit -t"BOOK" -oC | selcat -iC -oSeq -q">20060415" -e{100},{245}
Can anyone help?

well, could it be the -S switch to selcat?

-jp
 
M

mikeybe

Wow. After much trial and error, I found it was the brackets-
-e{100},{245} should have been -e100,245...wierd how it worked in shell
but not in perl. Sorry and thanks:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top