Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Bare BLOCK vrs. grep BLOCK

by pritesh (Scribe)
on Jan 15, 2018 at 20:58 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 17:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found