Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Please help me with hash

by frozenwithjoy (Priest)
on Jun 06, 2013 at 18:43 UTC ( #1037501=note: print w/replies, xml ) Need Help??


in reply to Please help me with hash

Hi m_alper_yildiz. You are missing a semi-colon on this line: print @array[1..3]                #DIZININ 1. ELEMANINDAN 3. ELEMANINA KADARINI YAZAR

If you add a semi-colon, your script works: print @array[1..3];

FYI: It initially gave me a syntax error on the line of the hash. When debugging, if you don't see a problem on the line specified in the error, always check out the previous line of code and make sure you've ended it w/ a semi-colon. It's such as easy mistake to make.

--------

Off Topic-ish: If you get tired of typing \n when printing, you can you say like this:

use feature 'say'; print "Print requires a new line character.\n"; say "Say doesn't require one.";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037501]
help
Chatterbox?
Discipulus if thezip is still around can be interested into How to hide/inhibit the console window when launching a Perl script on Windows?
[Corion]: sierpinski: Yes, but I don't want to write Javascript in a more involved way ;)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (12)
As of 2017-03-27 19:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (321 votes). Check out past polls.