Pipe problem (unexpected EOF) 
Author Message
 Pipe problem (unexpected EOF)

: I have a perl program, new_index.pl, called as below:
:
: (ls -1F | grep '.html$'; find * -name 'index.html' -print | grep '/') | new_index.pl
:
: i.e. <Unix filename searching command> | new_index.pl
:
: This works fine, and the program has the line "while ($file = <STDIN>)"
: to deal with the input.
:
: However, what I actually want to do is change this line to:
: open(FILE,"(ls -1F | grep '.html$'; find * -name 'index.html' -print | grep '/') |");
: while($file = <FILE>)
:
: so that I can just execute the program with "new_index.pl". However, this gives me:
: sh: syntax error at line 1: `end of file' unexpected
:
: Anyone  know why?

The parens are unnecessary in either case.  However, the difficulty is
likely to be the $' that you interpolated before passing the string
off to the shell to interpret.  This is a good time to use Perl's
generalized quoting to get single quotes nested inside single quotes:

    open(FILE,
      q[ls -1F | grep '.html$'; find * -name 'index.html' -print | grep '/' |]);

Or you can just backwhack the $.

Larry



Thu, 17 Jul 1997 06:26:21 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Problem with an unexpected "broken pipe"

2. Net::FTP: Unexpected EOF on command channel

3. LWP/HTTPS Error: 500 unexpected EOF before status line seen

4. Net::FTP Unexpected EOF

5. Net::FTP - Unexpected EOF on command channel

6. Net::FTP: Unexpected EOF on command channel

7. Net::FTP: Unexpected EOF on command channel?

8. LWP::UserAgent - unexpected EOF

9. Net::FTP: Unexpected EOF on command channel

10. EOF on pipe

11. EOF condition before actual EOF

12. Unexpected problem with the query string

 

 
Powered by phpBB® Forum Software