A bug in get_iplayer-3.01?

David Cantrell david at cantrell.org.uk
Wed Jun 7 08:04:52 PDT 2017


On Wed, Jun 07, 2017 at 01:03:26PM +0100, Ralph Corderoy wrote:
> Hi Richard,
> 
> > The function/procedure/subroutine parameters I have difficulty with
> > are ones of the form
> > my $string = shift;
> > I am inclined to agree with MrBrightside's comment in stackoverflow.
> > https://stackoverflow.com/questions/7082811/what-does-assigning-shift-to-a-variable-mean
> > "Forgive me but this seems like the worst convention ever for code
> > readability."
> No, it's fine if you know the Unix programming environment.

Never mind the Unix programming environment, it's fine if you have even
the slightest familiarity with perl. Shift is a keyword in the language.
You might as well complain about a C program using 'void' or 'case'.

As for readability, would you prefer this?

my $string = $_[0]; @_ = @_[1 .. $#_];

cos that's how you avoid using shift.

-- 
David Cantrell | Hero of the Information Age

What is the difference between hearing aliens through the
fillings in your teeth and hearing Jesus in your heart?



More information about the get_iplayer mailing list