From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 19 October 2005 21:43
To: [email protected]
Subject: Late-day brane fade question: dereferencing?
> This is going to be a head-slapper, I know, but it's late and my brain
hurts... I've got a script that has a
> sub that accepts a hash of arguments, one of which happens to be an
array. If I pass the array as a reference, > everything works fine.
> Now for the head slapping part, how do I handle things INSIDE the sub
so I don't have to pass the array as a
> reference? Code and desired output are below.
>
> Thanks,
>
Deane
>
> use strict;
> use warnings;
>
> sub do_smthng{
> my %args = ( -s1 => undef,
> -s2 => undef,
> -ar => undef,
> @_
> );
>
> print " s1: $args{-s1}\n";
> print " s2: $args{-s2}\n";
> print "ary[0]: $args{-ar}->[0]\n";
> print "ary[1]: $args{-ar}->[1]\n";
> print "ary[2]: $args{-ar}->[2]\n";
> }
>
>
> my @arg_ary = ( 'alpha', 'bravo', 'charlie' );
>
> do_smthng( -s1 => 42,
> -s2 => 96,
> -ar => [EMAIL PROTECTED] ); # I wanna lose the "\" here
Why? I don't see the problem.
Perhaps if you explained what you are trying to accomplish that makes
you want to lose the "\" it might be easier to offer suggestions.
HTH
--
Brian Raven
=================================
Atos Euronext Market Solutions Disclaimer
=================================
The information contained in this e-mail is confidential and solely for the
intended addressee(s). Unauthorised reproduction, disclosure, modification,
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message do not
necessarily reflect those of Atos Euronext Market Solutions.
L'information contenue dans cet e-mail est confidentielle et uniquement
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee.
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail
vous parvient par erreur, nous vous prions de bien vouloir prevenir
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre
systeme. Le contenu de ce message electronique ne represente pas necessairement
la position ou le point de vue d'Atos Euronext Market Solutions.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs