Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Beginner needs more help

by richmusk (Novice)
on Jun 14, 2001 at 15:02 UTC ( #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


Comment on Beginner needs more help
Select or Download Code
Re: Beginner needs more help
by azatoth (Curate) on Jun 14, 2001 at 15:06 UTC
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>

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2014-07-24 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (156 votes), past polls