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

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

Replies are listed 'Best First'.
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.

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

      Stefan K

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://55412]
marioroy just logged in to say that MCE::Hobo has passed testing and therefore will continue to run like threads but have managed capabilities similar to Parallel:: ForkManager. It allows multiple managed instances to run simultaneously. Zero limitations.
marioroy it's taken a long time to make this possible.

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2017-07-28 19:42 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (433 votes). Check out past polls.