On Friday, July 26, 2002, at 10:56 , Jay Grant wrote:
[..]
> what am I doing wrong?
>
> #!/usr/local/bin/perl
> $date = "/usr/bin/date";
the double quotes there make that a 'string' just as
my $date = "that really cute one with the big tracks of land";
what you want to do is 'execute' and external command in the form
my $date = `/usr/bin/date`;
with the 'back tick' - other strategies would be to use open(),
or stay inside perl with
my $date = localtime();
you should also get into the habit of
a) '-w' - eg: /usr/local/bin/perl -w
to set warnings
b) use strict;
so that you have some additional error messages
when you do 'interesting things' that perl can detect
and warn you that you may not wish to do those....
at which point you will want to know the difference between
my, our, local
ciao
drieux
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]