Weekly Perl Script

Bill Jones bill at fccj.org
Thu Jun 24 21:50:55 CDT 1999


On the Jax.PM jacksonville-pm-list;
"Bill Jones" <bill at fccj.org> wrote -


NOTE:  This week's script is early because
       I may not be around this weekend...

[Sixth issue in a continuing series...]


Hi All :]

As a benefit for the Jacksonville Perl Monger
membership (now at 11 :) I present the Sixth
Issue in the "Weekly Perl Script" series.

Each Week, around Saturday or Sunday, I will submit
to the list a Perl Script which does something useful,
but one which isn't too hard to follow along with and
can be modified to attend other tasks.

I will post a script to the Jax-PM listserv and
allow one week for the group to discuss it; after
the week has passed I will either post a follow-up,
one which will help describe the functioning of
the prior weeks post or we will move on to a
new script to discuss that week.  Fair enough?

BTW:  The 'other' members may post scripts and/or
questions here as well.  I'm not saying that
any of them will be answered - but together
I am sure we can discover a solution!


Here is this weeks offering for your review -

(An idea I got from Steve.  He may want
 to post another example, more in-line
 with his original idea... :)

# The following is a modified code fragment from
# my own library (other postings covered ideas and
# code I had gotten off Usenet and other WWW sources.)

#!/usr/local/bin/perl -wT

# A script that shows how to
# write data-aware routines...

use strict;
use diagnostics; # -verbose;

my $vSub = '';

while (<DATA>) {
    no strict q/refs/;
    $vSub = \m/^(.+)$/io;
    &$$vSub if defined &$$vSub;
    print "Sorry, I don't see a Subroutine
           $$vSub\n" unless defined &$$vSub;
}

exit;

sub Sneex {
print "Hi from Sneex...\n";
}

sub TheCat {
print "Hi from SnittyMibs!\n";
}

__DATA__
Sneex
TheCat
NoSubr

# End of script...


Look at it, think it over, and if you have
any questions, please post to the list:

jacksonville-pm-list at happyfunball.pm.org


Enjoy!
-Sneex-  :]
FCCJ Data Security Group
______________________________________________________________________
Bill Jones  Data Security Specialist  http://www.fccj.org/cgi/mail?dss


The Jacksonville Perl Monger's Group is operated by -
Bill -Sneex- Jones ( sneex at usa.net ),
to whom send all praises, complaints, or comments...




More information about the Jacksonville-pm mailing list