Apodysophilia
12-22-2003, 01:45 AM
i just dont get it bah.
this works, i found a tut on it
#!/usr/bin/perl
sub test
{
$temp = $_ for @_;
print "the var is $temp";
}
test(34);
i dont knwo what the "$_ for @_ " does? and that only works for one argument. what if i want more?
and that doesnt work for text, how do i do it for text?
sub test
{
$temp = shift(@_) ;
print "the add is $temp";
}
test(23);
what does the shift() do. and why does it have to be an array?
i am just more confused now:wtf:
also
@info = <STDIN>;
how do i terminate this. or/and is there a better way to get input from the keyboard?
$temp = <> ;
also works for input, so what does STDIN stand/used for?
thanks for you time
:wavey:
this works, i found a tut on it
#!/usr/bin/perl
sub test
{
$temp = $_ for @_;
print "the var is $temp";
}
test(34);
i dont knwo what the "$_ for @_ " does? and that only works for one argument. what if i want more?
and that doesnt work for text, how do i do it for text?
sub test
{
$temp = shift(@_) ;
print "the add is $temp";
}
test(23);
what does the shift() do. and why does it have to be an array?
i am just more confused now:wtf:
also
@info = <STDIN>;
how do i terminate this. or/and is there a better way to get input from the keyboard?
$temp = <> ;
also works for input, so what does STDIN stand/used for?
thanks for you time
:wavey: