Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: Using perl to teach programming

by Falkkin (Chaplain)
on Jan 31, 2001 at 04:39 UTC ( #55412=note: print w/ replies, xml ) Need Help??


in reply to Re: Using perl to teach programming
in thread Using perl to teach programming

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.)


Comment on Re: Re: Using perl to teach programming
Download Code
Re: Re: Re: Using perl to teach programming
by ichimunki (Priest) on Jan 31, 2001 at 20:35 UTC
    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.
      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";

      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 :-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-10-01 21:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (38 votes), past polls