Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Predefining sub Parameters

by mrborisguy (Hermit)
on Jun 22, 2005 at 18:25 UTC ( #469119=note: print w/replies, xml ) Need Help??


in reply to Predefining sub Parameters

I hesitate to mention this, but in this particular example (certainly not every example - and this probably isn't an advisable way to do it), the sub wouldn't need to have an arrayref passed, technically.

sub somesub { my $first = shift; my @second = @_; my $third = pop @second; }

Granted, this doesn't help the OP with his problem, but a couple of people mentioned that it wasn't possible to have a flattened array in the middle of the arguments, when in a crazy way, it is possible.

    -Bryan

Replies are listed 'Best First'.
Re^2: Predefining sub Parameters
by willyyam (Priest) on Jun 22, 2005 at 18:44 UTC

    Very interesting approach :-) It makes sense in the hacker tradition of "assume a situtation is the way it is - then subvert it with cleverness". ++

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://469119]
help
Chatterbox?
[TStanley]: talexb I was actually in your area last week. I was working in Milton, Ontario at the hospital they are building there.
Eily hasn't entered monk school
[Eily]: there are some special array variables that are not interpolated in double strings, like @*, @/, @(, and @)
[Eily]: is this documented somwhere?
[Eily]: "@{/}" does interpolate @/ though
[Eily]: (while the same for @*, @(, and @) throw a warning)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2017-06-23 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (547 votes). Check out past polls.