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

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



Comment on Beginner needs more help
Select or Download Code
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2015-12-01 23:07 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (29 votes), past polls