in reply to Re: Perl What for?
in thread Perl What for?
This is close to what you probably have in mind when saying "interactive Perl". Unfortunately, this one has some confusing behaviour with scopes, caused by the eval block:
Writing the same commands in a file scoped script would produce different results.perl> $_ = 'Foo'; print; Foo perl> print; print; perl> my $a = 'Bar'; print $a; Bar perl> print $a; Use of uninitialized value in print at (eval 4) line 1, <> line 4.
I think it might be better to go this way:
Write a testscript in your favorite text editor. It might look like this:
Then you can save the script (e.g. "C:\test.pl"). Open your DOS command window and type in the following to run your script:#!perl # header use warnings; # enable warnings use diagnostics; # explain warnings # code to test: print "Hey world, I'm coming!!!\n";
When your script succeeds, you can modify it (trying out something else), save it and run the command again.perl C:\test.pl
Hope this helps, have a lot of fun with Perl!
~Django
"Why don't we ever challenge the spherical earth theory?"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Perl What for?
by BrowserUk (Patriarch) on Sep 08, 2002 at 16:26 UTC |