Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Using perl to teach programming

by ichimunki (Priest)
on Jan 31, 2001 at 02:21 UTC ( [id://55376]=note: print w/replies, xml ) Need Help??


in reply to Using perl to teach programming

Great start!

One nit, ctrl-d is ctrl-z on windows, if memory serves-- and you have to watch handling input done this way. It's a tad idiosyncratic, but consistent.

Replies are listed 'Best First'.
Re: Re: Using perl to teach programming
by Falkkin (Chaplain) on Jan 31, 2001 at 04:39 UTC
    Thanks much for the suggestion... I'd forgotten about that, having not tested the program under windows recently. Again, I'd like to eliminate reading from normal STDIN entirely since it doesn't provide a good way of going back and altering what you've previously entered (aside from undoing the entire block afterwards.)
      You could store the script lines in a list instead of a single scalar, then using (ack!) line numbers, provide a way to list, modify, add (remember BASIC?), or delete lines. This way a tutorial can build up a routine. Then at the end, you can save the whole thing as a real Perl ".pl" script in an external file.

        Yeah, add a LIST command, which will show all those lines, possibly preceded by line number (and automatic renumbering), so you'll be able to fit lines in between them:

        >LIST 10 while($home) { 20 sweet } >15 # Okay, a ++ vote for the first monk to recognise which tv series +I'm referring to :-) >LIST 10 while($home) { 20 # Okay, a ++ vote for the first monk to recognise which tv series I +'m referring to :-) 30 sweet }

        Problem is, BASIC has a bad reputation, but this 'instant gratification' 'mod for Perl' might be very promising. I'll try to test it on my brother tomorrow :-)

        This sounds reasonable. The abiliry to create 'real' working little scripts is simply a good way of 'getting a feeling' for things. If the beginner would see some nicely formatted and correctly indented code, it would it could well improve his or her understanding. You could even go one step further and use the line numbers to output listings like we find in magazines. Maybe even HTML(orwhatever)-style. OK, you're probably right that this would mean a lot of effort ;-)

        The list-storing-method would mean command-history, too (or did you think of theat already ichimunki?)

        Regards
        Stefan K

        $dom = "skamphausen.de"; ## May The Open Source Be With You! $Mail = "mail@$dom; $Url = "http://www.$dom";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found