lohit [l], on Monday, July 4, 2005 at 13:21 (+0530) contributed this
to our collective wisdom:
l> lets assume I call the function as show below
l> func("arg1","arg2","this is arg 3", "this is arg 4");
l> now inside func function how do I retrieve my arguments
l> sub func()
l> {
l> foreach $arg
lohit am Montag, 4. Juli 2005 09.51:
> lets assume I call the function as show below
> func("arg1","arg2","this is arg 3", "this is arg 4");
> now inside func function how do I retrieve my arguments
> sub func()
> {
> foreach $arg in (@ARGV) {
> print "$arg\n";
> }
> }
> this would print
> arg1
lets assume I call the function as show below
func("arg1","arg2","this is arg 3", "this is arg 4");
now inside func function how do I retrieve my arguments
sub func()
{
foreach $arg in (@ARGV) {
print "$arg\n";
}
}
this would print
arg1
arg2
this
is
arg3
this
is
arg4
On 7/4/05, John Doe <[E
lohit am Montag, 4. Juli 2005 09.17:
> Hi there,
> how do i pass arguments with spaces in it.
> exaple if i pass fun("abc is not bcd");
indicates that you pass the string to a _subroutine_
> @ARGV
is normally used to get arguments to the _script_
> would store this as 4 words. how do i retrie
Hi there,
how do i pass arguments with spaces in it.
exaple if i pass fun("abc is not bcd");
@ARGV would store this as 4 words. how do i retrieve it as $var = "abc is
not bcd";
thanks!!