Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Beginner needs more help

by richmusk (Novice)
on Jun 14, 2001 at 15:02 UTC ( [id://88354]=note: print w/replies, xml ) Need Help??


in reply to Syntax Error Messages (was: Beginner needs help (in more ways than one !))

Ok .. I have been requested to provide more info ... here is the first part of my program ...
#!/home/freetool/bin/perl5 open(CLI,"datablitz_dump") or die "datablitz_dump not found\n"; $iline = 0; while(<CLI>) { if (/^Dn:/) { $iline++; # ($dn1)= $_ =~ /^Dn: \w+ (\w+ = \d+)/; $trav=$_; $nbwd = ($trav =~ s/(\w+\s+=\s+\d+)//g); $trav=$_; $trav=~ s/Dn: //; $walknbwd[$iline][0] = $nbwd; for ($i=1;$i<=$nbwd;$i++) { # ($bid,$dns[$i-1]) = ($trav =~ /(\w+\s+(\w+\s+=\s+\d+),*\s*){$i} +/); ($bid1,$bid2,$walkdns[$iline][$i-1],$walkdnval[$iline][$i-1]) = +($trav =~ /(\w+\s+((\w+)\s+=\s+(\d+)),*\s*){$i}/); }
I get the following syntax error during compliation
perlprog[3]: syntax error at line 3: '(' unexpected
If I replace line 3 with open CLI, "database_dump"; I get the following errors during compliation
perlprog[3]: open: not found perlprog[5]: =: not found perlprog[7]: syntax error at line 7: ')' unexpected
I know this works in theory but I can't seem to run it on my machine ... my machine is the problem I think but I don't know why ...

Ta

Rich

Replies are listed 'Best First'.
Re: Beginner needs more help
by davorg (Chancellor) on Jun 14, 2001 at 15:09 UTC

    There must be something wrong with your shebang line as these are are the errors that you get when a perl script is run by the shell rather than by perl.

    Is there actually a file at /home/freetool/bin/perl5? Is it a valid Perl interpreter? What do you get if you type

    perl -v /home/freetool/bin/perl5

    Also worth checking that there are no spurious invisible characters added to the end of the shebang line.

    Oh, and when adding more info like this, you'd usually add it as a follow-up to the original node.

    --
    <http://www.dave.org.uk>

    Perl Training in the UK <http://www.iterative-software.com>

Re: Beginner needs more help
by azatoth (Curate) on Jun 14, 2001 at 15:06 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://88354]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-03-29 15:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found