469,951 Members | 2,625 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

help with perl code

hi
i have written some perl code like this

$telnetcmd << "EOF";
perl -ne "chdir(/tmp); while ($file = <*.txt>) { print stat($file); }"
EOF
print $telnetcmd;

it give me some errors:

syntax error at ./test.pl line 3, near "-ne"
Semicolon seems to be missing at ./test.pl line 3.
Execution of ./test.pl aborted due to compilation errors.
what is wrong with the code...?? thanks
Jul 19 '05 #1
1 2001
s9************@yahoo.com (mike) wrote in message news:<df**************************@posting.google. com>...

$telnetcmd << "EOF";
perl -ne "chdir(/tmp); while ($file = <*.txt>) { print stat($file); }"
EOF
print $telnetcmd;

it give me some errors:

syntax error at ./test.pl line 3, near "-ne"
Semicolon seems to be missing at ./test.pl line 3.
Execution of ./test.pl aborted due to compilation errors.
what is wrong with the code...?? thanks


You meant:

$telnetcmd = << "EOF";

Actually I suspect you didn't what $file interpolated so you meant:

$telnetcmd = << 'EOF';

Actually, come to think of it, if you don't like wasting your time
hunting down obscure bugs, you probably should have said:

use strict;
use warnings;
my $telnetcmd = << 'EOF';

This newsgroup does not exist (see FAQ). Please do not start threads
here.
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by MK | last post: by
5 posts views Thread by enkidu72 | last post: by
2 posts views Thread by geniuskanwal | last post: by
4 posts views Thread by rsaharia | last post: by
4 posts views Thread by negzero7 | last post: by
rajiv07
1 post views Thread by rajiv07 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.