Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Bare BLOCK vrs. grep BLOCK

by pritesh (Scribe)
on Jan 15, 2018 at 20:58 UTC ( #1207312=note: print w/replies, xml ) Need Help??


in reply to Bare BLOCK vrs. grep BLOCK

Hi, may be I am asking a dumb question, but why do you have (&@) in sub mygrep (&@) ? Shouldn't it just be sub mygrep { your greplike function code}?

Replies are listed 'Best First'.
Re^2: Bare BLOCK vrs. grep BLOCK
by mr_mischief (Monsignor) on Jan 15, 2018 at 21:34 UTC

    In perlsub subroutine prototypes are discussed. They are seldom needed, but a grep-like subroutine is one of the examples, and is shown using &@ as a prototype. This means to expect a subroutine and then a list.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1207312]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2022-11-26 19:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?