Re: use strict;
by chipmunk (Parson) on Feb 01, 2001 at 22:43 UTC
|
If 'use' and 'my' are not recognized, then you're using perl4. The #! line in your script is pointing to a very old version of perl.
Type which perl at the command line, since your script works with that one, and change your #! line accordingly. | [reply] [Watch: Dir/Any] [d/l] |
Re: use strict;
by azatoth (Curate) on Feb 01, 2001 at 22:34 UTC
|
First, post the code and i'll know for sure.
Second, it sounds like you've missed a " somewhere, or something.
As I said, post up your code using the code tags and I'll help you.
Also, don't make a new node, just update the one above with the code...
Aza | [reply] [Watch: Dir/Any] |
Re: use strict;
by stefan k (Curate) on Feb 01, 2001 at 22:32 UTC
|
It would help a lot if you'd post the program code here as well. How should The Monks be able to help you otherwise?
Another thing is that you may consider not using the strong-tag in your post, but that's just a minor topic.
Regards
Stefan K
$dom = "skamphausen.de"; ## May The Open Source Be With You!
$Mail = "mail@$dom; $Url = "http://www.$dom";
| [reply] [Watch: Dir/Any] [d/l] |
Re (tilly) 1: use strict;
by tilly (Archbishop) on Feb 01, 2001 at 22:33 UTC
|
I suspect you are not using semi-colons at the end of your
lines. | [reply] [Watch: Dir/Any] |
(tye)Re: use strict;
by tye (Sage) on Feb 01, 2001 at 22:41 UTC
|
| [reply] [Watch: Dir/Any] |
Re: use strict;
by mikfire (Deacon) on Feb 01, 2001 at 22:50 UTC
|
I would be willing to bet if you did a perl -v you
would discover that you are not using perl 5. This warning
is what is generated when you attempt perl5isms on perl4.
Make sure the #! line is pointing at the correct perl. I
hope you have perl5 installed somewhere else. If not, you
need to scream very loudly and get it installed.
mikfire | [reply] [Watch: Dir/Any] |
Re: use strict;
by snowrider (Pilgrim) on Feb 01, 2001 at 22:53 UTC
|
when i type perl -v i get
This is perl, v5.6.0 built for 9000/777-hpux
Copyright 1987-2000, Larry Wall
Perl may be copied only under the terms of either the Artistic License
+ or the
GNU General Public License, which may be found in the Perl 5.0 source
+kit.
Complete documentation for Perl, including FAQ lists, should be found
+on
this system using `man perl' or `perldoc perl'. If you have access to
+ the
Internet, point your browser at http://www.perl.com/, the Perl Home Pa
+ge.
when i type which perl i get
/opt/perl5/bin/perl
i replaced #!/usr/contrib/bin/perl -w with #!/opt/perl5/bin/perl -w
and it seems to work fine thanks alot fellow monks you saved
me alot of hair pulling
snowrider | [reply] [Watch: Dir/Any] [d/l] [select] |
Re: use strict;
by arturo (Vicar) on Feb 01, 2001 at 22:35 UTC
|
We can't tell you what's happening unless you post your
code (be sure to put it in between <code> and </code> tags when you do!). One possibility is that you have simply misplaced or forgotten a quote.
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
| [reply] [Watch: Dir/Any] [d/l] [select] |
Re: use strict;
by snowrider (Pilgrim) on Feb 01, 2001 at 22:36 UTC
|
monks,
sorry about not attaching my code here it is.
#!/usr/contrib/bin/perl -w
use strict;
my $a="5.0";
my $b="5";
print "Are these variables equal as numbers? ",$a==$b,"\n";
print "Are the variables equal as strings? ",$a eq $b,"\n";
print "These variables are equal as strings\n" if($a eq $b);
print "These variables are equal numerically\n" if($a==$b);
snowrider | [reply] [Watch: Dir/Any] [d/l] |
|
When you're running perl script.pl you are
using the version of Perl from your path. This seems to
be fine.
When running ./script.pl you're using the
version in /usr/contrib/bin/perl. Looks like
that's Perl version 4. to confirm this type /usr/contrib/bin/perl -v at your command
line.
To fix it, find out which version of Perl is on your
path by typing which perl and replace the
/usr/contrib/bin/perl in your script with the
results of that command.
--
<http://www.dave.org.uk>
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
| [reply] [Watch: Dir/Any] |
|
Looks ok to me ... are you sure there's a perl interpreter at the location specified in your
'#!' line? Try issuing the following on the command line and see what you get:
which perl
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
| [reply] [Watch: Dir/Any] [d/l] |
Re: use strict;
by Gloom (Monk) on Feb 01, 2001 at 22:35 UTC
|
some code can be helpfull to try to debug this :)
| [reply] [Watch: Dir/Any] |
Re: use strict;
by curtisb (Monk) on Feb 02, 2001 at 02:00 UTC
|
If you post your code then we (the Perl Monks) can help in a more perlish way. But, from what the error messages you have posted say; you may not be using semi-colons on lines 3, 7, and 8.
In my experience with Perl, from the command line you have to type "c:\perl program_name" to make it execute (this in in windows). In UNIX you can execute it if the path to Perl is in you liberary search path. Then you can execute it by using "./program_name", if you are in that directory.
What OS are you writing this perl script in? And please post your code as well.
curtisb -- "trying to help"
| [reply] [Watch: Dir/Any] |