473,396 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2098
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then...
2
by: MK | last post by:
Hello, I am new to XML and PERL and I have a few questions the answers to which I need to complete a project. All your time and effort would be highly appreciated. I have to make a small HTML page...
5
by: enkidu72 | last post by:
Hello everybody , I have a problem with arrays ... I need to get some data from files in some directories . The names of the dirs are something like 12.12344 or 23.34441. Some contains one ,...
2
by: sangith | last post by:
Hi, I am trying to understand a concept in Regex in Perl. How to write regex in Perl such that metacharacter * is not greedy. Here is my code:- #!usr/bin/perl use strict; my $sentence =...
2
by: geniuskanwal | last post by:
Before I begin to explain my problem, I just want to say that I can do the following two things: 1. Using Perl, connect to a MS Access Databse Table and perform the required operations.(Database...
4
by: rsaharia | last post by:
Hello All, I need help with this particular .pl file I picked up from http://www.veritools-usa.com/xnf2vhdl.htm What it's supposed to do is really convert an xnf file to a vhdl file. I need it for...
3
by: itdaddy | last post by:
hey perl gurus! i am new to this forum cause i need help. I have done many scripts. but i want to use perl to do this: What I want to do is this. I have a QRP file that I can convert to a txt...
4
by: negzero7 | last post by:
Hi everyone, I am trying to teach myself Perl with the aid of some books I have boughten. I'm doing some exercises with regular expressions but am having some trouble, specifically with this...
1
rajiv07
by: rajiv07 | last post by:
Hi to all I have some problem to use DBIx::Class package My::Schema; use base qw/DBIx::Class::Schema::Loader/; __PACKAGE__->loader_options( debug => 1, );
0
by: Scotsman | last post by:
Hi All I have a sticky problem! Its a LEFT JOIN sql statement which works fine in MySQL but not when called in Perl. Any ideas? I have 2 tables: campaigns & companies. I'm trying to join them...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.