in reply to Getting times (weeks, days, hours, minutes, seconds)
There is an easy way to understand -> (at least I hope so):
$something->func($x);
is nearly the same as
func($something,$x);
with func a subroutine out of the package (called class) that $something belongs to
There is also an easy way to understand printf:
printf("bla %xyz chink %ru wong",$a,$b);
is somewhat equivalent to
print "bla $a chink $b wong";
The printf often does some conversions of the variables, but basically thats it.
Now in the code someone on IRC gave you the printf is not the normal builtin perl printf, since it was called with the -> syntax. Instead it must be subroutine out of the package $t belongs to. What package does $t belong to? Date::Manip::Delta, since $t was created with my $t = Date::Manip::Delta->new;
UPDATE: Added the word 'nearly'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting times (weeks, days, hours, minutes, seconds)
by DrHyde (Prior) on Jul 05, 2010 at 10:16 UTC | |
|
Re^2: Getting times (weeks, days, hours, minutes, seconds)
by ikegami (Patriarch) on Jul 05, 2010 at 16:29 UTC | |
by jethro (Monsignor) on Jul 06, 2010 at 08:33 UTC | |
by ikegami (Patriarch) on Jul 06, 2010 at 16:34 UTC | |
by jethro (Monsignor) on Jul 07, 2010 at 00:18 UTC |