Arguments for subroutine

This is a multi-part message in MIME format.

--===============0740379312==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C7D293.A8448020"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C7D293.A8448020
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,
I want to send array as input argument for subroutine. Please help me =
how to do this.

Ex: =
ug_convert( [at] dr_con_list,$dataset,$datasettype,$release_statu s,$item_id,$i=
tem_revision,$local_option);
Sub convert()
{
=
local(( [at] dr_con_list,$dataset,$datasettype,$release_status,$i tem_id,$item_=
revision,$local_option)=3D [at] _;
}

but it is not giving correct values.

Thanks && Regards
Karunakar Reddy B.V.

BSH Bosch Siemens Hausgeräte GmbH

ITD

Carl-Wery-Straße 34

81739 München

Tel.: +49 (0) 89 / 4590-3979

Fax: +49 (0) 89 / 4590-4489

e-mail: Reddy.Beri-Veera-ext [at] BSHG.COM

_______________________________________________

BSH Bosch und Siemens Hausgeräte GmbH, Carl-Wery-Str. 34, 81739 =
München

Vorsitzender des Aufsichtsrats: Rudi Lamprecht

Geschäftsführung: Dr. Kurt-Ludwig Gutberlet (Vors.), Dr. Wolfgang =
Colberg, Jean Dufour, Prof E.h. Werner Vogt

Sitz: München; Registergericht: Amtsgericht München; HRB 75534;

WEEE-Reg.-Nr. DE 57986696



Diese Mitteilung ist ausschließlich für den beabsichtigten =
Empfänger bestimmt. Sie kann Betriebs- oder Geschäftsgeheimnisse =
oder sonstige vertrauliche Informationen enthalten. Jede(r) =
unberechtigte Gebrauch, Kopie, Weitergabe oder Veröffentlichung ist =
untersagt. Sollten Sie diese E-Mail irrtümlich erhalten haben, =
benachrichtigen Sie uns bitte sofort durch Antwortmail und löschen Sie =
diese E-Mail nebst etwaigen Anlagen und einschließlich aller =
angefertigten Kopien von Ihrem System.



------_=_NextPart_001_01C7D293.A8448020
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.3086" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D199001910-30072007>Hello,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D199001910-30072007> I want to send
array as input argument for subroutine. Please help me how to do
this.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D199001910-30072007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D199001910-30072007>Ex:
ug_convert( [at] dr_con_list,$dataset,$datasettype,$release_statu s,$item_id,$i=
tem_revision,$local_option);</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D199001910-30072007>Sub
convert()</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D199001910-30072007>{</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D199001910-30072007>  
local(( [at] dr_con_list,$dataset,$datasettype,$release_status,$i tem_id,$item_=
revision,$local_option)=3D [at] _;</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D199001910-30072007>}</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D199001910-30072007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D199001910-30072007>but it =
is not giving
correct values.</SPAN></FONT></DIV>
<DIV> </DIV><!-- Converted from text/rtf format --><SPAN =
lang=3Den-us><FONT
face=3D"Monotype Corsiva" color=3D#0000ff>
<P class=3DMsoNormal
style=3D"BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: =
medium none; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; MARGIN: 0cm 0cm =
0pt; BORDER-LEFT: medium none; PADDING-TOP: 0cm; BORDER-BOTTOM: =
windowtext; mso-element: para-border-div; mso-border-bottom-alt: solid =
windowtext .75pt; mso-padding-alt: 0cm 0cm 1.0pt 0cm"
align=3Dleft><I style=3D"mso-bidi-font-style: normal"><SPAN
style=3D"COLOR: blue"><FONT face=3D"Times New Roman">Thanks && =
Regards
<BR>Karunakar Reddy B.V. <?xml:namespace prefix =3D o ns =3D
"urn:schemas-microsoft-com:office:office" =
/><o:p></o:p></FONT></SPAN></I></P>
<P class=3DMsoNormal
style=3D"MARGIN: 0cm 0cm 0pt; mso-pagination: none; =
mso-layout-grid-align: none"><SPAN
lang=3DDE style=3D"FONT-SIZE: 9pt; FONT-FAMILY: Arial; =
mso-ansi-language: DE"><FONT
color=3D#000000>BSH Bosch Siemens Hausgeräte =
GmbH<o:p></o:p></FONT></SPAN></P>
<P class=3DMsoNormal
style=3D"MARGIN: 0cm 0cm 0pt; mso-pagination: none; =
mso-layout-grid-align: none"><SPAN
lang=3DDE style=3D"FONT-SIZE: 9pt; FONT-FAMILY: Arial; =
mso-ansi-language: DE"><FONT
color=3D#000000>ITD<o:p></o:p></FONT></SPAN></P>
<P class=3DMsoNormal
style=3D"MARGIN: 0cm 0cm 0pt; mso-pagination: none; =
mso-layout-grid-align: none"><SPAN
lang=3DDE style=3D"FONT-SIZE: 9pt; FONT-FAMILY: Arial; =
mso-ansi-language: DE"><FONT
color=3D#000000>Carl-Wery-Straße 34<o:p></o:p></FONT></SPAN></P>
<P class=3DMsoNormal
style=3D"MARGIN: 0cm 0cm 0pt; mso-pagination: none; =
mso-layout-grid-align: none"><SPAN
lang=3DDE style=3D"FONT-SIZE: 9pt; FONT-FAMILY: Arial; =
mso-ansi-language: DE"><FONT
color=3D#000000>81739 München<o:p></o:p></FONT></SPAN></P>
<P class=3DMsoNormal
style=3D"MARGIN: 0cm 0cm 0pt; mso-pagination: none; =
mso-layout-grid-align: none"><SPAN
lang=3DDE style=3D"FONT-SIZE: 9pt; FONT-FAMILY: Arial; =
mso-ansi-language: DE"><FONT
color=3D#000000>Tel.: +49 (0) 89 / =
4590-3979<o:p></o:p></FONT></SPAN></P>
<P class=3DMsoNormal
style=3D"MARGIN: 0cm 0cm 0pt; mso-pagination: none; =
mso-layout-grid-align: none"><SPAN
lang=3DDE style=3D"FONT-SIZE: 9pt; FONT-FAMILY: Arial; =
mso-ansi-language: DE"><FONT
color=3D#000000>Fax: +49 (0) 89 / 4590-4489<o:p></o:p></FONT></SPAN></P>
<P class=3DMsoNormal
style=3D"MARGIN: 0cm 0cm 0pt; mso-pagination: none; =
mso-layout-grid-align: none"><SPAN
lang=3DDE style=3D"FONT-SIZE: 9pt; FONT-FAMILY: Arial; =
mso-ansi-language: DE"><FONT
color=3D#000000>e-mail: </FONT><U><SPAN
style=3D"COLOR: =
blue">Reddy.Beri-Veera-ext [at] BSHG.COM<o:p></o:p></SPAN></U></SPAN></P>
<P class=3DMsoNormal
style=3D"MARGIN: 0cm 0cm 0pt; mso-pagination: none; =
mso-layout-grid-align: none"><FONT
color=3D#000000><FONT face=3D"Times New Roman"><SPAN lang=3DDE
style=3D"FONT-SIZE: 9pt; FONT-FAMILY: ' [at] Arial Unicode MS'; =
mso-ansi-language: DE; mso-hansi-font-family: Arial; =
mso-bidi-font-family: ' [at] Arial Unicode =
MS'">______________________________________________</SPAN><SPAN
lang=3DDE
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: ' [at] Arial Unicode MS'; =
mso-ansi-language: DE; mso-hansi-font-family: Arial; =
mso-bidi-font-family: ' [at] Arial Unicode =
MS'">_<o:p></o:p></SPAN></FONT></FONT></P></FONT></SPAN><FONT
face=3D"Monotype Corsiva" color=3D#0000ff><FONT size=3D1>
<P>BSH Bosch und Siemens Hausgeräte GmbH, Carl-Wery-Str. 34, 81739 =
München</P>
<P>Vorsitzender des Aufsichtsrats: Rudi Lamprecht</P>
<P>Geschäftsführung: Dr. Kurt-Ludwig Gutberlet (Vors.), Dr. Wolfgang =
Colberg,
Jean Dufour, Prof E.h. Werner Vogt</P>
<P>Sitz: München; Registergericht: Amtsgericht München; HRB =
75534;</P>
<P>WEEE-Reg.-Nr. DE 57986696</P>
<P> </P><I>
<P>Diese Mitteilung ist ausschließlich für den beabsichtigten =
Empfänger
bestimmt. Sie kann Betriebs- oder Geschäftsgeheimnisse oder sonstige
vertrauliche Informationen enthalten. Jede(r) unberechtigte Gebrauch, =
Kopie,
Weitergabe oder Veröffentlichung ist untersagt. Sollten Sie diese =
E-Mail
irrtümlich erhalten haben, benachrichtigen Sie uns bitte sofort durch
Antwortmail und löschen Sie diese E-Mail nebst etwaigen Anlagen und
einschließlich aller angefertigten Kopien von Ihrem
System</I>.</P></FONT></FONT>
<DIV> </DIV></BODY></HTML>

------_=_NextPart_001_01C7D293.A8448020--

--===============0740379312==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0740379312==--
Reddy.Beri-Veera-ext [ Mo, 30 Juli 2007 12:23 ] [ ID #1782364 ]

Re: Arguments for subroutine

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Beri-Veera-ext, Reddy (n.a.) wrote:
> Hello,
> I want to send array as input argument for subroutine. Please help me how to do this.
>
> Ex: ug_convert( [at] dr_con_list,$dataset,$datasettype,$release_statu s,$item_id,$item_revision,$local_option);
> Sub convert()
> {
> local(( [at] dr_con_list,$dataset,$datasettype,$release_status,$i tem_id,$item_revision,$local_option)= [at] _;
> }
>
> but it is not giving correct values.

You need to pass a reference to the array and then dereference it within
the subroutine:

ug_convert(\ [at] dr_con_list,$dataset,$datasettype,$release_stat us,$item_id,$item_revision,$local_option);

Sub convert()
{
my($dr_con_list,$dataset,$datasettype,$release_status,$item_ id,$item_revision,$local_option)= [at] _;

# then need to deference using things like:
my $first_element = $dr_con_list->[0];
foreach my $element ( [at] {$dr_con_list} ) {
# do something with each element of the list
}
}

HTH
Nath
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGsGDch5z4PPfwHQoRAqDBAJ9ZlnIjQC9im3keOJUr1hqLwGgzoQCg 44mD
ZdH5iu8lYkwpUGJOlV/x4rU=
=zYvX
-----END PGP SIGNATURE-----
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
n.haigh [ Mo, 30 Juli 2007 12:33 ] [ ID #1782365 ]

Re: Arguments for subroutine

Nathan S Haigh wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Beri-Veera-ext, Reddy (n.a.) wrote:
>
>>Hello,
>> I want to send array as input argument for subroutine. Please help me how to do this.
>>
>>Ex: ug_convert( [at] dr_con_list,$dataset,$datasettype,$release_statu s,$item_id,$item_revision,$local_option);
>>Sub convert()
>>{
>> local(( [at] dr_con_list,$dataset,$datasettype,$release_status,$i tem_id,$item_revision,$local_option)= [at] _;
>>}
>>
>>but it is not giving correct values.
>
>
> You need to pass a reference to the array and then dereference it within
> the subroutine:

Or if you only have one array, you can just pass it as the last argument.

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Bill Luebkert [ Mo, 30 Juli 2007 13:15 ] [ ID #1782366 ]

RE: Arguments for subroutine

Hello,
Thanks for your help. I wrote like
$status
=ug_convert(\ [at] dr_con_list,$dataset,$datasettype,$release_sta tus,$item_id
,$item_revision,$local_option);
Sub ug_convert()
{

my($local_con_list,$local_dataset,$local_datasettype,$local_ release_stat
us,$local_item_id,$local_item_rev,$local_option) = [at] _;
foreach my $element ( [at] {$local_con_list} )
{print "$element\n";}
}

But it is giving the error
Error: Missing $ on loop variable at
C:\UG\tceng0913\bsh\export\bin\bsh_flexcax_export_server.pl line 1300

Please help on this.

Thanks && Regards
Karunakar Reddy B.V.

-----Original Message-----
From: Nathan S Haigh [mailto:n.haigh [at] sheffield.ac.uk]
Sent: 01 August 2007 12:31
To: Beri-Veera-ext, Reddy (n.a.)
Cc: ActivePerl
Subject: Re: Arguments for subroutine

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Beri-Veera-ext, Reddy (n.a.) wrote:
> Hello,
> I want to send array as input argument for subroutine. Please help me
how to do this.
>
> Ex:
ug_convert( [at] dr_con_list,$dataset,$datasettype,$release_statu s,$item_id,$
item_revision,$local_option);
> Sub convert()
> {
>
local(( [at] dr_con_list,$dataset,$datasettype,$release_status,$i tem_id,$item
_revision,$local_option)= [at] _;
> }
>
> but it is not giving correct values.

You need to pass a reference to the array and then dereference it within
the subroutine:

ug_convert(\ [at] dr_con_list,$dataset,$datasettype,$release_stat us,$item_id,
$item_revision,$local_option);

Sub convert()
{
my($dr_con_list,$dataset,$datasettype,$release_status,$item_ id,$item_rev
ision,$local_option)= [at] _;

# then need to deference using things like:
my $first_element = $dr_con_list->[0];
foreach my $element ( [at] {$dr_con_list} ) {
# do something with each element of the list
}
}

HTH
Nath
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGsGDch5z4PPfwHQoRAqDBAJ9ZlnIjQC9im3keOJUr1hqLwGgzoQCg 44mD
ZdH5iu8lYkwpUGJOlV/x4rU=
=zYvX
-----END PGP SIGNATURE-----
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Reddy.Beri-Veera-ext [ Mo, 30 Juli 2007 13:50 ] [ ID #1782367 ]

Re: Arguments for subroutine

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Beri-Veera-ext, Reddy (n.a.) wrote:
> Hello,
> Thanks for your help. I wrote like
> $status
> =ug_convert(\ [at] dr_con_list,$dataset,$datasettype,$release_sta tus,$item_id
> ,$item_revision,$local_option);
> Sub ug_convert()
> {
>
> my($local_con_list,$local_dataset,$local_datasettype,$local_ release_stat
> us,$local_item_id,$local_item_rev,$local_option) = [at] _;
> foreach my $element ( [at] {$local_con_list} )
> {print "$element\n";}
> }
>
> But it is giving the error
> Error: Missing $ on loop variable at
> C:\UG\tceng0913\bsh\export\bin\bsh_flexcax_export_server.pl line 1300
>
> Please help on this.
>
> Thanks && Regards
> Karunakar Reddy B.V.
>

I don't see anything obviously wrong - are you able to supply more of
your code around line 1300 and also indicate which line is 1300.

Nath
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGsHUrh5z4PPfwHQoRAgzyAKCK05hPNkW0ZXntthni8666MObBBQCf QN4j
WDtK6yFOovCRWTIIGpgBlMg=
=Heat
-----END PGP SIGNATURE-----
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
n.haigh [ Mo, 30 Juli 2007 13:57 ] [ ID #1782368 ]

RE: Arguments for subroutine

This is a multi-part message in MIME format.

------_=_NextPart_001_01C7D2A2.68954223
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi Please see my sample program.
Error:Missing $ on loop variable at
C:\BSH\Flexcax_export\samples\arry_arg.pl line 11.


Thanks && Regards
Karunakar Reddy B.V.


-----Original Message-----
From: Nathan S Haigh [mailto:n.haigh [at] sheffield.ac.uk]
Sent: 01 August 2007 13:58
To: Beri-Veera-ext, Reddy (n.a.)
Cc: ActivePerl
Subject: Re: Arguments for subroutine

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Beri-Veera-ext, Reddy (n.a.) wrote:
> Hello,
> Thanks for your help. I wrote like
> $status
>
=3Dug_convert(\ [at] dr_con_list,$dataset,$datasettype,$release_s tatus,$item_i=
d
> ,$item_revision,$local_option);
> Sub ug_convert()
> {
>
>
my($local_con_list,$local_dataset,$local_datasettype,$local_ release_stat
> us,$local_item_id,$local_item_rev,$local_option) =3D [at] _;
> foreach my $element ( [at] {$local_con_list} )
> {print "$element\n";}
> }
>
> But it is giving the error
> Error: Missing $ on loop variable at
> C:\UG\tceng0913\bsh\export\bin\bsh_flexcax_export_server.pl line 1300
>
> Please help on this.
>
> Thanks && Regards
> Karunakar Reddy B.V.
>

I don't see anything obviously wrong - are you able to supply more of
your code around line 1300 and also indicate which line is 1300.

Nath
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGsHUrh5z4PPfwHQoRAgzyAKCK05hPNkW0ZXntthni8666MObBBQCf QN4j
WDtK6yFOovCRWTIIGpgBlMg=3D
=3DHeat
-----END PGP SIGNATURE-----

------_=_NextPart_001_01C7D2A2.68954223
Content-Type: application/octet-stream;
name="arry_arg.pl"
Content-Transfer-Encoding: base64
Content-Description: arry_arg.pl
Content-Disposition: attachment;
filename="arry_arg.pl"

IyEvdXNyL2Jpbi9wZXJsDQokc3RhdHVzID0gdWdfY29udmVydChcQGRyX2Nv bl9saXN0LCRkYXRh
c2V0LCRkYXRhc2V0dHlwZSwkcmVsZWFzZV9zdGF0dXMsJGl0ZW1faWQsJGl0 ZW1fcmV2aXNpb24s
JGxvY2FsX29wdGlvbik7IA0Kc3ViIHVnX2NvbnZlcnQoKQ0Kew0KICBteSgk bG9jYWxfY29uX2xp
c3QsJGxvY2FsX2RhdGFzZXQsJGxvY2FsX2RhdGFzZXR0eXBlLCRsb2NhbF9y ZWxlYXNlX3N0YXR1
cywkbG9jYWxfaXRlbV9pZCwkbG9jYWxfaXRlbV9yZXYsJGxvY2FsX29wdGlv bikgPSBAXzsNCiAg
cHJpbnQgImVudGVyZWQgaW4gdG8gY29udmVydGlvbiBmb3JtXG4iOw0KICAN CiAgICAgbXkgJGZp
cnN0X2VsZW1lbnQgPSAkbG9jYWxfY29uX2xpc3QtPlswXTsNCiAgICAgcHJp bnQgIiRmaXJzdF9l
bGVtZW50XG4iOw0KICAgICAjcHJpbnQgInRoZSBjb24gY291bnQgaXMgJGNv bl9saXN0X2xlblxu
IjsNCiAgICAgZm9yZWFjaCBteSAkZWxlbWVudCAoIEB7JGxvY2FsX2Nvbl9s aXN0fSApDQogICAg
IHtwcmludCAiJGVsZW1lbnRcbiI7fQ0KfQ0K

------_=_NextPart_001_01C7D2A2.68954223
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
------_=_NextPart_001_01C7D2A2.68954223--
Reddy.Beri-Veera-ext [ Mo, 30 Juli 2007 14:08 ] [ ID #1782369 ]

Re: Arguments for subroutine

Beri-Veera-ext, Reddy (n.a.) wrote:
> Hi Please see my sample program.
> Error:Missing $ on loop variable at
> C:\BSH\Flexcax_export\samples\arry_arg.pl line 11.

This gets no errors:

#!/usr/bin/perl

use strict;
use warnings;

my [at] dr_con_list = (1, 2, 3, 4);
my $dataset = 1;
my $datasettype = 1;
my $release_status = 1;
my $item_id = 1;
my $item_revision = 1;
my $local_option = 1;

my $status = ug_convert (\ [at] dr_con_list, $dataset, $datasettype,
$release_status, $item_id, $item_revision, $local_option);

sub ug_convert {
my ($local_con_list, $local_dataset, $local_datasettype,
$local_release_status, $local_item_id, $local_item_rev,
$local_option) = [at] _;

print "entered ug_convert\n";

my $first_element = $local_con_list->[0];
print "first_element = $first_element\n";

foreach my $element ( [at] {$local_con_list}) {
print "element=$element\n";
}

}

__END__

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Bill Luebkert [ Mo, 30 Juli 2007 14:27 ] [ ID #1782370 ]

Re: Arguments for subroutine

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Beri-Veera-ext, Reddy (n.a.) wrote:
> Hi Please see my sample program.
> Error:Missing $ on loop variable at
> C:\BSH\Flexcax_export\samples\arry_arg.pl line 11.
>
>
> Thanks && Regards
> Karunakar Reddy B.V.
>
>

Firstly, the script you supplied doesn't run on it's own! Ensure you
have the following at the top of your script:

use strict;
use warnings;

They will force you to use good programming practice when it comes to
scope etc. You will then need to specify values for variables you pass
to your method.


The slightly modified version of your script produces no warnings like
the one you mentioned:

#!/usr/bin/perl
use strict;
use warnings;

my [at] dr_con_list = (1..10);
my $dataset = 1;
my $datasettype = 1;
my $release_status = 1;
my $item_id = 1;
my $item_revision = 1;
my $local_option = 1;

my $status =
&ug_convert(\ [at] dr_con_list,$dataset,$datasettype,$release_sta tus,$item_id,$item_revision,$local_option);

sub ug_convert
{

my($local_con_list,$local_dataset,$local_datasettype,$local_ release_status,$local_item_id,$local_item_rev,$local_option)
= [at] _;
print "entered in to convertion form\n";

my $first_element = $local_con_list->[0];
print "$first_element\n";
#print "the con count is $con_list_len\n";
foreach my $element ( [at] {$local_con_list} )
{print "$element\n";}
}
__END__


Changes I made:
1) added "use strict;" and "use warnings;" at the top of the script.
2) set the values of the method arguments to some value as you didn;t
supply any.
3) set scope of $status using "my"

Nath

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGsH/eh5z4PPfwHQoRAhSGAJwJENIBNImick3No/J2KBrIUUrsKACg ioYE
N4lu+J1wTWWXqMJcJroF83U=
=Cipd
-----END PGP SIGNATURE-----
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
n.haigh [ Mo, 30 Juli 2007 14:43 ] [ ID #1782371 ]
Perl » gmane.comp.lang.perl.active-perl » Arguments for subroutine

Vorheriges Thema: Decode just as Javascript's decodeURIComponent() does.
Nächstes Thema: print bug