what is $date means?

Y

yezi

Dear all:

The following code is like this:
# the sendmail binary.
$sendmail = "/usr/lib/sendmail";


# base of your httpd installation.
$basedir = '/www';
# log file
$logfile = "$basedir/etc/logs/$progname.log";


# today
$date = `date`;
print " $logfile $date";


suppose the output to the screen is :

/www/etc/logs/progra.log date

however the outpur is /www/etc/logs/progra.log Wed Aug 3 17:29:06
MDT 2005


that means the $date is current date but not a string , right? $date is
kind of reserved variable?
Thanks for any comments
 
J

John Bokma

yezi said:
Dear all:

The following code is like this:
# the sendmail binary.
$sendmail = "/usr/lib/sendmail";


# base of your httpd installation.
$basedir = '/www';
# log file
$logfile = "$basedir/etc/logs/$progname.log";


# today
$date = `date`;
print " $logfile $date";


suppose the output to the screen is :

/www/etc/logs/progra.log date

however the outpur is /www/etc/logs/progra.log Wed Aug 3 17:29:06
MDT 2005


that means the $date is current date but not a string , right?
wrong

$date is
kind of reserved variable?

no

It gets its value from `date`. Look up what back ticks do in Perl.
 
Y

yezi

It means the date is some function and get the information of date and
send the value to $date, right?
$date = `date`, so even the date is quoted,but is not a string.
right?
 
T

Tony Curtis

[ top-posting rearranged ]
It means the date is some function and get the information
of date and send the value to $date, right? $date = `date`,
so even the date is quoted,but is not a string. right?

Nope, on both counts.

So if not a string, what do you think $date is?

hth
t
 
J

John Bokma

yezi said:

What? Please don't top post. This is a technical group, learn how it works
before you abuse it.
the date is some function
No

and get the information of date and
send the value to $date, right?
$date = `date`, so even the date is quoted,but is not a string.
right?

No

Do what I suggested before: read the documentation. You can't program by
just guessing what things do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top