Re: Standard input errors



elite elite wrote:

Here are my error:


[syntax@localhost ~]$ perl hello.pl
String found where operator expected at hello.pl line
15, near "print ""
(Might be a runaway multi-line "" string starting on
line 11)
(Missing semicolon on previous line?)
Backslash found where operator expected at hello.pl
line 15, near "print "\"
(Do you need to predeclare print?)
Backslash found where operator expected at hello.pl
line 15, near "address\"
String found where operator expected at hello.pl line
15, at end of line
(Missing semicolon on previous line?)
syntax error at hello.pl line 15, near "print ""
Global symbol "$address" requires explicit package
name at hello.pl line 11.
Global symbol "$name" requires explicit package name
at hello.pl line 11.
Can't find string terminator '"' anywhere before EOF
at hello.pl line 15.



here my code.I not sure what i did wroung here.

#!/usr/bin/perl

use strict;
use warnings;

my $street='Wright'; print "$street\n";
$street='Washington';
print "$street\n";
print "One major street in madison is Washington\n";
print "enter your address"/n";
my $address

$name =<>;
print "\nPerl has received your address\n";

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com



I don't think this is your whole problem, but I did notice this error:

print "enter your address"/n";

Along with typing a forward slash instead of a backslash, you have an extra double-quote. This means that perl reads

print "enter your address"

and has no idea what to with the /n.

Then, it sees the following text string:

";
my $address

$name =<>;
print "

It probably takes this as a scalar and has no idea how to process it; and after that, it gets some more funny text followed by another unresolved double-quote.

Marc
msacks@xxxxxxxxxxxxx



--
Marc Sacks, Ed.D. | Quality Assurance Manager
Lextranet | 107 Union Wharf | Boston, MA 02109
http://www.lextranet.com
(617) 227-4469 Extension 228 msacks@xxxxxxxxxxxxx

THE INFORMATION IN THIS MESSAGE IS INTENDED ONLY FOR THE PERSONAL AND CONFIDENTIAL USE OF THE DESIGNATED RECIPIENTS NAMED ABOVE AND MAY CONTAIN LEGALLY PRIVILEGED INFORMATION. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error, and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone at 617-227-4469 Ext. 228. Thank you.


.



Relevant Pages

  • Re: Standard input errors
    ... Missing semicolon after "my $address"? ... String found where operator expected at hello.pl line ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (perl.beginners)
  • RE: parsing csv-file for inserting in database
    ... String found where operator expected at ./csv_auslesen.pl line 34, ... (Missing semicolon on previous line?) ... This e-mail may contain confidential information. ... Any opinion expressed in this e-mail is personal to the sender ...
    (perl.beginners)
  • Re: parsing csv-file for inserting in database
    ... "pint Auftrag "$Datenfelder" ... String found where operator expected at ./csv_auslesen.pl line 34, ... (Might be a runaway multi-line "" string starting on line 29) ... (Missing semicolon on previous line?) ...
    (perl.beginners)
  • Re: Standard input errors
    ... On Tue, 26 Sep 2006, elite elite wrote: ... String found where operator expected at hello.pl line ... (Missing semicolon on previous line?) ... Backslash found where operator expected at hello.pl ...
    (perl.beginners)
  • Re: gfortran diagnostics and so on
    ... Well, in f0003, backslash is part of the standard Fortran character set. ... Because the backslash is part of the standard Fortran character set, the default behavior should be the printable character, **NOT** some kind of magic introductory character that transforms the interpretation of following character. ... The one I like best is to use one of the popular extensions to designate a particular literal string according to the C language. ...
    (comp.lang.fortran)