K
Kenny McCormack
I have an old program that I wrote back in 2001, which has worked fine ever
since - right up until today, when I ran it for the first time in quite a
while. The script depends on the fact that (when it was written) when you
do split(), it puts the data into @_.
From what I can tell, the following are all true. Please confirm or deny:
1) In 5.8, this worked.
2) Somewhere along the way, this usage became "deprecated". I found a web
site that explicitly said that, while the usage is deprecated, it still
works, since if it was removed, old code (heh heh - such as mine) would
get broken.
3) In 5.14, it doesn't work. No error or warning message is generated, but
@_ is left unchanged.
P.S. I changed the program line from something like:
$x = @_[split(...)-1];
to:
@tmp = split(...);
$x = @tmp[@tmp-1];
And everything seems to be working fine now.
--
One of the best lines I've heard lately:
Obama could cure cancer tomorrow, and the Republicans would be
complaining that he had ruined the pharmaceutical business.
(Heard on Stephanie Miller = but the sad thing is that there is an awful lot
of direct truth in it. We've constructed an economy in which eliminating
cancer would be a horrible disaster. There are many other such examples.)
since - right up until today, when I ran it for the first time in quite a
while. The script depends on the fact that (when it was written) when you
do split(), it puts the data into @_.
From what I can tell, the following are all true. Please confirm or deny:
1) In 5.8, this worked.
2) Somewhere along the way, this usage became "deprecated". I found a web
site that explicitly said that, while the usage is deprecated, it still
works, since if it was removed, old code (heh heh - such as mine) would
get broken.
3) In 5.14, it doesn't work. No error or warning message is generated, but
@_ is left unchanged.
P.S. I changed the program line from something like:
$x = @_[split(...)-1];
to:
@tmp = split(...);
$x = @tmp[@tmp-1];
And everything seems to be working fine now.
--
One of the best lines I've heard lately:
Obama could cure cancer tomorrow, and the Republicans would be
complaining that he had ruined the pharmaceutical business.
(Heard on Stephanie Miller = but the sad thing is that there is an awful lot
of direct truth in it. We've constructed an economy in which eliminating
cancer would be a horrible disaster. There are many other such examples.)