Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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 ...



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.


    Perl Training in the UK <>

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://88354]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2017-05-24 01:09 GMT
Find Nodes?
    Voting Booth?