>>it seems that not all hooks should have @args, but rather something else.<<
Thats what I first though but Alex explained that some hooks have multiple arguments so using:
my @args = @_;
....covers them all whereas:
my $hashref = shift;
....may be skipping the 2nd arg onwards.
You can still obviously access the hashref using the first method with:
%{$args[0]}
...or for specific keys:
$args[0]->{key}
Thats what I first though but Alex explained that some hooks have multiple arguments so using:
my @args = @_;
....covers them all whereas:
my $hashref = shift;
....may be skipping the 2nd arg onwards.
You can still obviously access the hashref using the first method with:
%{$args[0]}
...or for specific keys:
$args[0]->{key}