in reply to Re^2: perldoc -lf anomaly
in thread perldoc -lf anomaly

I'm not sure about the "another anomaly". You get the documentation of splice for $_, as $_ without quotes is the shell variable which contains the last argument of the last command.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: perldoc -lf anomaly (OT bash last output)
by LanX (Saint) on May 09, 2026 at 20:15 UTC
    > as $_ without quotes is the shell variable which contains the last argument of the last command

    Similar to ALT-. which is introducing the last argument verbatim.

    But what I was really longing for is a variable or hotkey producing the last output , alas this doesn't exist.

    The closest I could find now is `!!` , I.e. to backtick the last command.

    But I'd really love to facilitate this be defining a shortcut introducing `!!` ...

    So I figured out bind '"\e,":"`!!`"' (ESC for ALT) which also works well on termux.

    Put it into your bashrc and it'll help you to incrementally build one liners.

    Dumb example:

    $ bind '"\e,":"`!!`"' $ ls *re.pl tst_re.pl $ echo `!!` # typed "echo ALT-," echo `ls *re.pl` # expanded history entry tst_re.pl $

    Update

    This will nest better when used repeatedly

    $ bind '"\e,":"$(!!)"'

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

Re^4: perldoc -lf anomaly
by Anonymous Monk on May 08, 2026 at 08:40 UTC
    $_ without quotes is the shell variable which contains the last argument of the last command.

    🤦