Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: 3 member list ouput

by toolic (Bishop)
on Sep 25, 2018 at 14:44 UTC ( #1222978=note: print w/replies, xml ) Need Help??


in reply to 3 member list ouput

The problem is that your code evaluates the arrays in scalar context, which returns the number of elements in the array. One way to evaluate the arrays in list context is to change the period to a comma in your say lines:
use feature 'say'; say "Please enter 3 string variables, :" . "(Please crtl-D after ente +ring strings)\n "; @lines = <STDIN>; say 'Here ', @lines; chomp(@lines); @backwards = reverse(@lines); say "Here are the values in reverse order:", @backwards;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1222978]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2021-10-18 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (73 votes). Check out past polls.

    Notices?