- 论坛徽章:
- 0
|
I can easily input a string to a variable from keyboad using $v=<STDIN>, but how can I input an array or list to an @v? I use dos command and perl Express 2.5. Do I need to use some specific symbols to seperate strings when trying to input from keyboard?
Here is the code:
#!/usr/bin/perl
#Question: How to input array under DOS or in Perl Express for window?
@userinput1= ('name','6');
print @userinput1; #return name6
# but nomatter under DOS or in Perl Express Std.Output I/O box;
@userinput2=<STDIN>; #input name 6 or name, 6 or 'name','6' from Keyboard
print @userinput2; # Nothing return |
|