[21903] in Perl-Users-Digest
Perl-Users Digest, Issue: 4107 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 12 18:11:58 2002
Date: Tue, 12 Nov 2002 15:10:18 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 12 Nov 2002 Volume: 10 Number: 4107
Today's topics:
Help with https and lwp <eweintra@jhmi.edu>
Re: How to call C routines from perl? <not.me@nowhere.com>
Re: how to debug anonymous functions <perl-dvd@ldschat.com>
Investigating perl compilers. Any help appreciated! <not.me@nowhere.com>
Re: Investigating perl compilers. Any help appreciated! <tk@WINDOZEdigiserv.net>
Re: Keyboard mapping <ian_chapman@junk.net>
Re: Keyboard mapping <mgjv@tradingpost.com.au>
menu ? <mail@eircom.net>
Re: menu ? <tk@WINDOZEdigiserv.net>
Re: menu ? <wksmith@optonline.net>
Re: menu ? <wksmith@optonline.net>
Re: menu ? <usenet@dwall.fastmail.fm>
Net::FTP - configure ftp proxy <steven.anderson@oracle.com>
Re: Newbie with Perl <mjwilusz@acsu.buffalo.edu>
Re: Newbie with Perl (Tad McClellan)
Re: Newbie with Perl <flavell@mail.cern.ch>
Re: Newbie with Perl <djhagen@acsu.buffalo.edu>
Re: Newbie with Perl <flavell@mail.cern.ch>
Perl CGI/DB advice. (sh)
Re: perl daemon in windows memory hog ? <nospam@nospam.com>
Re: Perl: string vs. numeric <occitan@esperanto.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 12 Nov 2002 15:35:57 -0500
From: ETAN WEINTRAUB <eweintra@jhmi.edu>
Subject: Help with https and lwp
Message-Id: <Pine.GSO.4.44.0211121529400.11903-100000@pine>
I have a script as follows:
----------------------------------------------------------------
#!/usr/local/bin/perl
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
print "File: ";
$infilename = <STDIN>;
chomp $infilename;
$infile = `cat $infilename`;
my $req = POST 'https://localhost/cgi-bin/checkpost.pl',
[ match => 'www', errors => 0, etan => 'great', infile =>
$infilename, file => $infile ];
print $ua->request($req)->as_string;
----------------------------------------------------------------
It works if I use http:// instead of https://, however I need it to work
with https://. When I switch it to https://, I get the following message:
----------------------------------------------------------------
File: local.cshrc
500 (Internal Server Error) Can't connect to localhost:443 ()
Client-Date: Tue, 12 Nov 2002 20:32:21 GMT
----------------------------------------------------------------
Any ideas???
-Etan Weintraub
------------------------------
Date: Wed, 13 Nov 2002 09:29:45 +1300
From: Jim Williams <not.me@nowhere.com>
Subject: Re: How to call C routines from perl?
Message-Id: <d3p2tuci6mc0v9oesdg0othq6efee25v1j@4ax.com>
**** Post for FREE via your newsreader at post.usenet.com ****
Thanks to everyone for their help with this.
Jim Williams
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.usenet.com
Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
------------------------------
Date: Tue, 12 Nov 2002 13:40:23 -0700
From: "David" <perl-dvd@ldschat.com>
Subject: Re: how to debug anonymous functions
Message-Id: <gAdA9.27106$46.7073@fe01>
"Raj" <raj@tao.ca> wrote in message
news:feea11ef.0211121053.196e2dfc@posting.google.com...
> Hi all!
>
> does anyone know if this is possible? If yes, do you know how
> I would go about setting a breakpoint and step through the code?
> I believe I tried it in the past and it didn't work. But I have
> not definitively verified this.
Well, this is probably not the official answer, but you can print to
STDERR in the places you want to see what is going on, and watch your
error logs. Generally when I use this method, I print each variable
I'm wondering about, as well as printing before and after lines I
think it may be breaking on. This generally works well for
discovering where your variables value went a skew. If you at some
point want your program to stop, exit(0); works well.
Regards,
David
------------------------------
Date: Wed, 13 Nov 2002 10:58:37 +1300
From: Jim Williams <not.me@nowhere.com>
Subject: Investigating perl compilers. Any help appreciated!
Message-Id: <cst2tu41utimfcfrelg2m2digl03te8b2s@4ax.com>
**** Post for FREE via your newsreader at post.usenet.com ****
I'm investigating perl compilers, running on a Windows platform.
The reason I want a perl compiler is this:
I'm happy to develop and use perl programs on machines where I work.
However, When I distribute programs outside work, people are
unable/unwilling/incapable of installing a perl interpreter on their
machines. Hence interpreted languages like perl are problematic.
But Perl is great and fast to work in, esp for file parsing.
So I'm looking for a compiler.
I'm using activesate perl on Windows XP.
This comes with perlcc, but perlcc seldom succeeds in compiling
(usually I get the error message "Test.pl did not compile, which can't
happen" ! ), and when it does the executable won't run!
From what I've read, perlcc is still in the experimental stage, is
this true?
Are their any decent perl compilers available?
How do other people solve the "users incapable of installing a perl
interpreter" problem?
Thanks,
Jim Williams
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.usenet.com
Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
------------------------------
Date: Tue, 12 Nov 2002 22:05:30 GMT
From: tk <tk@WINDOZEdigiserv.net>
Subject: Re: Investigating perl compilers. Any help appreciated!
Message-Id: <6pu2tukm24ei901qgjsrhs93r7lknsgni9@4ax.com>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In a fit of excitement on Wed, 13 Nov 2002 10:58:37 +1300, Jim Williams
<not.me@nowhere.com> managed to scribble:
| **** Post for FREE via your newsreader at post.usenet.com ****
|
| I'm investigating perl compilers, running on a Windows platform.
|
| The reason I want a perl compiler is this:
| I'm happy to develop and use perl programs on machines where I work.
| However, When I distribute programs outside work, people are
| unable/unwilling/incapable of installing a perl interpreter on their
| machines. Hence interpreted languages like perl are problematic.
| But Perl is great and fast to work in, esp for file parsing.
| So I'm looking for a compiler.
|
| I'm using activesate perl on Windows XP.
| This comes with perlcc, but perlcc seldom succeeds in compiling
| (usually I get the error message "Test.pl did not compile, which
| can't happen" ! ), and when it does the executable won't run!
| From what I've read, perlcc is still in the experimental stage, is
| this true?
|
| Are their any decent perl compilers available?
| How do other people solve the "users incapable of installing a perl
| interpreter" problem?
|
Jim,
I've personally used Perl2Exe with good results, but unless I did
somethign wrong, had issues, much like perlcc with compiling modules
into the .exe file, but might be worth checking out, depends on the
types of scripts you're writing.
Regards,
tk
-----BEGIN xxx SIGNATURE-----
Version: PGP Personal Privacy 6.5.3
iQA/AwUBPdF7aijNZg8h4REKEQKwAwCg4MopC7VDD9uONvCEvOlyVRtvg1IAnRas
P4Nq/1YpL8hOv+ezPtqzZOkp
=GGTS
-----END PGP SIGNATURE-----
--
+--------------------------+
| digiServ Network |
| Web solutions | Remove WINDOZE to reply.
| http://www.digiserv.net/ |
+--------------------------+
------------------------------
Date: Tue, 12 Nov 2002 16:10:20 -0500
From: Ian Chapman <ian_chapman@junk.net>
Subject: Re: Keyboard mapping
Message-Id: <3DD16E3C.6EA1A53C@junk.net>
I'm at sympatico dot ca not junk.net
Hi Martien,
Thank you for taking the time to respond to my question. I'm running perl
5.6.1 ported to djgpp, my system is win98 and I have the same result under
both DOS and the Bash shell. The problem manifested itself with code like
this:-
@xxx = <STDIN>;
I should be able to terminate my input into array @xxx with ctl D. I do
not care if I have a local change to ctl Z which is the DOS eof. Right now I
give a ctl C followed by CR and I exit perl to the shell command line. The
djgpp news group do not have a good explanation. They suggest possibly:-
[If Perl uses termios, it might be a bug in our termios emulation, or it
might be that you need to tell termios to treat Ctrl-D as EOF (I don't
remember if that is the default).]
In any case I'm getting out of my depth even though I'm willing to eye
ball the code. So any suggestion would be more than welcome.
Regards Ian.
Martien Verbruggen wrote:
> On Mon, 11 Nov 2002 22:22:09 -0500,
> Ian Chapman <ian_chapman@junk.net> wrote:
> > I'm at sympatico dot ca not junk.net
> > Hi
> > I have a problem with ctl D, in fact all ctl characters in that they
> > print on the screen as ^D or ^Z etc. I should be able to hit ctl D to
> > terminate keyboard input into an array.
>
> How do you mean? What your terminal uses to generate an end-of-file
> signal is up to your terminal's settings, but it has nothing at all
> to do with arrays, or even Perl.
>
> On unices, it tends to be ctrl-d, while on windows it is (can that be
> changed?) ctrl-z.
>
> On unix, the stty command can tell you more about what it is for your
> tty.
>
> I must say that I really don't know what you mean by "terminate
> keyboard input into an array"...
>
> > My question is where in perl's
> > many source files do I find keyboard mapping?
>
> There is no such thing as a keyboard mapping in perl's source code. If
> perl is reading input from your terminal, it will stop when it
> encounters an end-of-file condition (or error), and how your terminal
> signals that is up to it, not to perl.
>
> What is the code you are running, on which platform, and how are you
> running it?
>
> Martien
> --
> |
> Martien Verbruggen |
> Trading Post Australia | "Mr Kaplan. Paging Mr Kaplan..."
> |
------------------------------
Date: Tue, 12 Nov 2002 22:47:54 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Keyboard mapping
Message-Id: <slrnat31da.2kt.mgjv@verbruggen.comdyn.com.au>
[Please do not send stealth Cc's. If you send email as well as post,
please state so in the message body]
[Please do not top-post. Put your response after the suitably trimmed
quoted text you respond to. THis is the generally accepted quoting
style on this newsgroup, and Usenet in general.]
On Tue, 12 Nov 2002 16:10:20 -0500,
Ian Chapman <ian_chapman@junk.net> wrote:
> Martien Verbruggen wrote:
>
>> On Mon, 11 Nov 2002 22:22:09 -0500,
>> Ian Chapman <ian_chapman@junk.net> wrote:
>> > I'm at sympatico dot ca not junk.net
>> > Hi
>> > I have a problem with ctl D, in fact all ctl characters in that they
>> > print on the screen as ^D or ^Z etc. I should be able to hit ctl D to
>> > terminate keyboard input into an array.
>>
>> How do you mean? What your terminal uses to generate an end-of-file
>> signal is up to your terminal's settings, but it has nothing at all
>> to do with arrays, or even Perl.
>>
>> On unices, it tends to be ctrl-d, while on windows it is (can that be
>> changed?) ctrl-z.
> Thank you for taking the time to respond to my question. I'm running perl
> 5.6.1 ported to djgpp, my system is win98 and I have the same result under
> both DOS and the Bash shell. The problem manifested itself with code like
> this:-
> @xxx = <STDIN>;
> I should be able to terminate my input into array @xxx with ctl D. I do
> not care if I have a local change to ctl Z which is the DOS eof. Right now I
> give a ctl C followed by CR and I exit perl to the shell command line. The
> djgpp news group do not have a good explanation. They suggest possibly:-
I doubt very much that perl uses any terminal control stuff. It used
to use standard C stream functionality to implement readline() (which
is what gets called by the <> operator. As of 5.8.0 there is an extra
PerlIO layer in there, but I would be extremely surprised if that
fiddled with terminal settings.
There is no reason for perl to fiddle with terminal settings, so my
guess would be that it doesn't.
You could consider reporting this as a bug (use the perlbug tool) to
the p5p. Make sure to include the versions of your djgpp environment
as well. It might be an issue that people know about.
> [If Perl uses termios, it might be a bug in our termios emulation, or it
> might be that you need to tell termios to treat Ctrl-D as EOF (I don't
> remember if that is the default).]
I don't know about the environment you use, but have you tried looking
at the stty command?
In DOS you should be able to use ctrl-Z. if that doesn't work, then I
suspect there is something more fundamental wrong.
Have you tried getting the input from files? Have you tried (in bash)
to do something like:
$ perl myprogram <<EOF
> line 1
> line 2
> EOF
? Does that work?
Martien
--
|
Martien Verbruggen | We are born naked, wet and hungry. Then
Trading Post Australia | things get worse.
|
------------------------------
Date: Tue, 12 Nov 2002 20:26:31 -0800
From: "Linux.ie" <mail@eircom.net>
Subject: menu ?
Message-Id: <aqrkei$jco$1@dorito.esatclear.ie>
Hi all.
I want help with a script.ITS NOT HOMEWORK !!!!
I want to have a menu in my program.With then parts to it each part numbered
and with a name to it.
i want to be able to enter a number and select a option and when i select
that option it will show info for that option and also be given a option to
back to the main menu.
please someone help
------------------------------
Date: Tue, 12 Nov 2002 21:31:05 GMT
From: tk <tk@WINDOZEdigiserv.net>
Subject: Re: menu ?
Message-Id: <fms2tuong6d62sgi5d8sfb99uv0kr85uk1@4ax.com>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In a fit of excitement on Tue, 12 Nov 2002 20:26:31 -0800, "Linux.ie"
<mail@eircom.net> managed to scribble:
| Hi all.
| I want help with a script.ITS NOT HOMEWORK !!!!
|
| I want to have a menu in my program.With then parts to it each part
| numbered and with a name to it.
| i want to be able to enter a number and select a option and when i
| select that option it will show info for that option and also be
| given a option to back to the main menu.
|
| please someone help
|
print
"1> Item 1\n" .
"2> Item 2\n" .
"3> Quit\n\n";
my $item = <STDIN>;
chomp($item);
$item will hold the users selection. I'll let you figure out how to
deal with the options you select.
Regards,
tk
-----BEGIN xxx SIGNATURE-----
Version: PGP Personal Privacy 6.5.3
iQA/AwUBPdFzRSjNZg8h4REKEQIxpACfbTB7nePTDCV51mGW5lPYoz4UGmUAnRP3
7m4Dess5a4pA21DijAfqm8e+
=9nWM
-----END PGP SIGNATURE-----
--
+--------------------------+
| digiServ Network |
| Web solutions | Remove WINDOZE to reply.
| http://www.digiserv.net/ |
+--------------------------+
------------------------------
Date: Tue, 12 Nov 2002 21:58:07 GMT
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: menu ?
Message-Id: <PPeA9.3441$Vy4.637@news4.srv.hcvlny.cv.net>
"Linux.ie" <mail@eircom.net> wrote in message
news:aqrkei$jco$1@dorito.esatclear.ie...
> Hi all.
> I want help with a script.ITS NOT HOMEWORK !!!!
>
> I want to have a menu in my program.With then parts to it each part
numbered
> and with a name to it.
> i want to be able to enter a number and select a option and when i select
> that option it will show info for that option and also be given a option
to
> back to the main menu.
>
> please someone help
>
>
Why not always return to the menu with one menu option to exit?
use strict;
use warnings;
my @opts = (undef, \&opt1, \&opt2, \&opt3);
my $opt;
do{
print <<'MENU';
Please type option number and <Enter>
1: Option_1
2: Option_2
3: Option_3
0: Exituse strict;
use warnings;
my @opts = (undef, \&opt1, \&opt2, \&opt3);
my $opt;
do{
print <<'MENU';
1: Option_1
2: Option_2
3: Option_3
0: Exit
MENU
$opt = <>;
if ($opt > 3) {print "Invalid option\n";}
if ($opt == 0) {exit;}
$opts[$opt]->();
}while $opt;
sub opt1{ print "option_1 data\n"; }
sub opt2{ print "option_2 data\n"; }
sub opt3{ print "option_3 data\n"; }
MENU
$opt = <>;
if ($opt < 3) {
if ($opt == 0) {exit;}
$opts[$opt]->();
}else { print "Invalid option\n";}
}while $opt;
sub opt1{ print "option_1 data\n"; }
sub opt2{ print "option_2 data\n"; }
sub opt3{ print "option_3 data\n"; }
------------------------------
Date: Tue, 12 Nov 2002 22:03:29 GMT
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: menu ?
Message-Id: <RUeA9.3522$Vy4.2976@news4.srv.hcvlny.cv.net>
"Bill Smith" <wksmith@optonline.net> wrote in message
news:PPeA9.3441$Vy4.637@news4.srv.hcvlny.cv.net...
--snip--
> Why not always return to the menu with one menu option to exit?
>
> use strict;
> use warnings;
>
> my @opts = (undef, \&opt1, \&opt2, \&opt3);
> my $opt;
> do{
> print <<'MENU';
> Please type option number and <Enter>
>
> 1: Option_1
> 2: Option_2
> 3: Option_3
> 0: Exituse strict;
> use warnings;
>
> my @opts = (undef, \&opt1, \&opt2, \&opt3);
> my $opt;
> do{
> print <<'MENU';
> 1: Option_1
> 2: Option_2
> 3: Option_3
> 0: Exit
> MENU
>
> $opt = <>;
> if ($opt > 3) {print "Invalid option\n";}
> if ($opt == 0) {exit;}
> $opts[$opt]->();
> }while $opt;
>
> sub opt1{ print "option_1 data\n"; }
>
> sub opt2{ print "option_2 data\n"; }
>
> sub opt3{ print "option_3 data\n";}
--snip--
Sorry about the editing error.
Bill
------------------------------
Date: Tue, 12 Nov 2002 22:40:30 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: menu ?
Message-Id: <Xns92C4B3CD0E02dkwwashere@216.168.3.30>
Linux.ie <mail@eircom.net> wrote on 12 Nov 2002:
> Hi all.
> I want help with a script.ITS NOT HOMEWORK !!!!
Well, I did think your question of a few days ago looked like homework.
:-)
> I want to have a menu in my program.With then parts to it each part
> numbered and with a name to it.
> i want to be able to enter a number and select a option and when i
> select that option it will show info for that option and also be given a
> option to back to the main menu.
>
> please someone help
Here's a simple-minded little menu system (just a quick hack) that can be
extended easily. It uses two 'global' variables (global is used loosely
here) to keep track of the current menu and menu choice. If an invalid
choice is entered then it just goes back to the main menu -- that's
something I'd change if I were really going to use this.
#!/usr/bin/perl
use strict;
use warnings;
my %Dispatch = (
main => { 1 => \&menu_Homer, 2 => \&menu_Marge, },
Homer => { 1 => \&menu_Marge, 2 => \&Homer_doh, },
Marge => { 1 => \&menu_Homer, 2 => \&Marge_grumble, },
# and so on
);
# allow a 'main' and 'quit' option on each menu
foreach my $menu (keys %Dispatch) {
$Dispatch{$menu}{m} = \&menu_main;
$Dispatch{$menu}{q} = sub { exit };
}
my $MENU = 'main';
my $CHOICE = 0;
while (1) {
if ( exists $Dispatch{$MENU}{$CHOICE} ) {
$Dispatch{$MENU}{$CHOICE}->();
}
else {
menu_main();
}
print qq{\n m. Main} unless $MENU eq 'main';
print qq{
q. Quit
=> };
$CHOICE = <STDIN>;
chomp $CHOICE;
}
sub menu_main {
$MENU = 'main';
print qq{
1. Homer
2. Marge};
}
sub menu_Homer {
$MENU = 'Homer';
print qq{
1. Go to Marge
2. Say "D'oh!"};
}
sub Homer_doh {
print qq{
DO'H!!!
};
menu_Homer();
}
sub menu_Marge {
$MENU = 'Marge';
print qq{
1. Go to Homer
2. Grumble at Homer};
}
sub Marge_grumble {
print qq{
<Marge> Grrrr.
};
menu_Marge();
}
--
David K. Wall - usenet@dwall.fastmail.fm
"Oook."
------------------------------
Date: 12 Nov 2002 12:58:07 -0800
From: Steven Anderson <steven.anderson@oracle.com>
Subject: Net::FTP - configure ftp proxy
Message-Id: <ur8dqcxpc.fsf@oracle.com>
I need a bit of help trying to configure my ftp proxy to work with
Net::FTP. I'm doing this on a Linux box, running perl 5.6.0, and
trying to install and configure libnet 1.12.
My proxy works the following way:
FTP to proxy
At Name: prompt, enter
remote_user@remote_ftp_host <special account name>
At Password: prompt, enter
remote_password
At Account: prompt, enter
<special account password>
For example, see below
steander@jtdevua-pc1:~/ > ftp ftp-proxy.xxx.com
Connected to inet-bip2v-3.xxx.com.
220 Secure Gateway FTP server ready.
Name (ftp-proxy.xxx.com:root): anonymous@ftp.perl.org optiplex
331 Password required for destination user 'anonymous'.
Password: steander@pacbell.net
332 Enter Password
Account: ********
You'll notice that it's very close to case 7 in the configuration
choices in libnet
USER user@remote.host
PASS pass
AUTH fwuser
RESP fwpass
but that doesn't quite work (the second AUTH needs to be sent as part
of USER).
I'm guessing I need to do some work in the FTP.pm file, but I don't
even know where to start. Any ideas would be appreciated.
Thanks,
Steve
------------------------------
Date: Tue, 12 Nov 2002 14:05:28 -0500
From: Michael J Wilusz <mjwilusz@acsu.buffalo.edu>
Subject: Re: Newbie with Perl
Message-Id: <aqrjd3$3mr$1@prometheus.acsu.buffalo.edu>
Hey,
I'm sorry if anyone assumed for someone to do my assignment for me.
Please don't, just wanted to see if my current Java knowledge could help me
leap into Perl. Our goal is to fulfill certain tasks by using our resources
to seek out answers. Sure, I can pick up a Perl book and thumb through 700
pages... and then when I'm done reading it, I can be all set to retire.
Judging from the example code, there are certain parallels with Java, but
there's many hurdles to still jump over. Expect to hear from me further as
I sit down and begin to bang this out. See my notes below.
Regards,
Mike
"ebchang" <echang@netstorm.net> wrote in message
news:Xns92C479BC28C75echangnetstormnet@207.106.92.86...
> Michael J Wilusz <mjwilusz@acsu.buffalo.edu> wrote in
> <aqpsff$5ff$1@prometheus.acsu.buffalo.edu>:
>
> > Hey All!
> > Great newgroup! It's hard to find one where everyone is down to
> > Earth
> > and not lookin to hurt eachother. Anyways... onto Perl. Never touched
> > it, but must say I've heard a lot with Perl scripts and such. Here's
> > what I need to do:
>
> [snip]
>
> >And here's a hint I was given:
> > Hint: the first line of your script should be:
> > #! /util/bin/perl -w>
> >
> > Any help would be awesome. I'm recently came out of emergency surgery
> > and have work piled on me, and had a gentle reminder today that the
> > deadline for this is upcoming. I have some minor Java knowledge, so
> > basic programming is fresh in this young mind. Thanks for any and all
> > help everyone! Good evening all.
>
> Given the specificity of the problem description, the origin of your
> article, and the terseness of the hint, I detect a homework assignment.
I'll
> offer some more hints.
Good, hints are what I'm looking for. As I start the coding I'll throw my
code up and see if I'm doing it right at all
>
> First, read your Perl textbook and get copies of the class notes if you
were
> absent.
This is not for class, this is for my job. I have no textbook or notes.
>
> Second, do the following: print the heading; open the file (look up open
in
> the the text and also read the perlopentut documentation); read the lines
> from the file (probably the same chapter in the text); split each line
into
> a list of the separate fields (did your instructor *really* say
> "seperated?"); print out the designated fields, making the necessary
> adjustment to the phone number; close the file.
Just the hints I'm looking for, thanks! And yes, the task does say
seperated. Why is that a problem?
>
> Third, hope your instructor didn't read your attempt to get someone to
write
> your assignment for you.
The goal of the task is to complete the given problem using whatever
resources we have. I never asked someone how to do my assignment. To quote
myself, "Thanks for any and all help everyone!" I'm just aiming for some
help. Just thought I'd point that out so no one is under the assumption I
wanna kick back and have someone write this for me. Thanks for all the help
and I'll report back with Beta v.0001 of my script. Good day all!
>
> --
> EBC
------------------------------
Date: Tue, 12 Nov 2002 13:29:43 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Newbie with Perl
Message-Id: <slrnat2ll7.47r.tadmc@magna.augustmail.com>
Michael J Wilusz <mjwilusz@acsu.buffalo.edu> wrote:
> "ebchang" <echang@netstorm.net> wrote in message
> news:Xns92C479BC28C75echangnetstormnet@207.106.92.86...
>> a list of the separate fields (did your instructor *really* say
>> "seperated?")
> And yes, the task does say
> seperated. Why is that a problem?
^
^
Because it is misspelled, we don't inspect instructors to do that.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 12 Nov 2002 20:41:13 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Newbie with Perl
Message-Id: <Pine.LNX.4.40.0211122040090.23063-100000@lxplus074.cern.ch>
On Nov 12, Tad McClellan inscribed on the eternal scroll:
> > And yes, the task does say
> > seperated. Why is that a problem?
> ^
> ^
>
> Because it is misspelled, we don't inspect instructors to do that.
You detected a perity error ;-)
But then you seem to have mis-spelled extructors :-))
atb.
------------------------------
Date: Tue, 12 Nov 2002 15:47:14 -0500
From: Douglas J Hagen <djhagen@acsu.buffalo.edu>
Subject: Re: Newbie with Perl
Message-Id: <Pine.GSO.4.44.0211121543160.19178-100000@hercules.acsu.buffalo.edu>
Hey Mike!
How's that perl task goin'? Don't forget there's lots of good information
that you can find at http://hlpdsk14.cit.buffalo.edu/perl/ (I think you
have a username/password for that page laying around somewhere).
Let me know if you need any pointers!
--
Doug Hagen
ASCIT Help Desk Supervisor
Michael J Wilusz sent the following on Nov 11, 2002:
> From: Michael J Wilusz <mjwilusz@acsu.buffalo.edu>
> Newsgroups: comp.lang.perl.misc
> Date: Mon, 11 Nov 2002 22:28:05 -0500
> Subject: Newbie with Perl
>
> Hey All!
> Great newgroup! It's hard to find one where everyone is down to Earth
> and not lookin to hurt eachother. Anyways... onto Perl. Never touched it,
> but must say I've heard a lot with Perl scripts and such. Here's what I
> need to do:
>
> -Take a filename as a command line argument.
> -The file will contain lines which are either a comment,
> beginning with the character #, or records of
> white-space-seperated fields of the format:
>
>
> -I will be using a remote file called names.dat as my input.
> -This file is a list of names (makes sense, right?)
> -The line's look like the following
> tldona TLD Tony
> L Danza 523-8426 Junior_Designer RO
> Here's what each means: Unix-username Initials Firstname MI Lastname
> Phone Site Attributes
>
>
> The output should l ook like this:
>
> Phone Book
>
> Name Telephone
> =============================
> Tony Danza 584 523 8426
>
> And here's a hint I was given:
> Hint: the first line of your script should be:
> #! /util/bin/perl -w
>
>
> Any help would be awesome. I'm recently came out of emergency surgery and
> have work piled on me, and had a gentle reminder today that the deadline for
> this is upcoming. I have some minor Java knowledge, so basic programming is
> fresh in this young mind. Thanks for any and all help everyone! Good
> evening all.
>
> -Mike W.
>
>
>
------------------------------
Date: Tue, 12 Nov 2002 22:26:41 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Newbie with Perl
Message-Id: <Pine.LNX.4.40.0211122225270.10266-100000@lxplus074.cern.ch>
On Nov 12, Douglas J Hagen TOFU'd:
> How's that perl task goin'? Don't forget there's lots of good information
> that you can find at http://hlpdsk14.cit.buffalo.edu/perl/ (I think you
> have a username/password for that page laying around somewhere).
I don't think "laying" is considered on-topic for this group.
SCNR
------------------------------
Date: 12 Nov 2002 11:06:16 -0800
From: phase2@phase2.net (sh)
Subject: Perl CGI/DB advice.
Message-Id: <2ec67b0f.0211121106.5f1d71a1@posting.google.com>
Hi,
I wanted to get some people's opinions on this authentication method
and how 'secure' you think it is. Bare in mind that this solution
does not need to be foolproof, but at least provide a decent sense of
security.
Because of a certain higher up person, they don't want the basic httpd
authentication box coming up. Therefore, I was tasked with writing
our own authentication method.
We have a database with a table called 'users'. The important rows
for this post are 'user_name','passwd', and 'auth_num'. The user_name
is a regular varchar, the passwd is a MD5 encrypted string. ( I'll get
to auth_num in a second. )
The user comes to the home page, and may enter his username/password
in a form, then submit. The form's method is post, the action is
'https://www.yourdomain.com/login.cgi'.
So thus, I pose my first question: Does the user have to be on an SSL
encrypted page BEFORE they submit the form or will the post data be
encrypted to the login.cgi?
The username and password are compared to the database record for that
username ( which resides on the same box as the httpd, so it's via
UNIX sockets. ), if he checks out ok, an 'auth_num' ( 128 bit ) random
string is generated and stored in the user's record in the database.
They are then returned a cookie in the form of "username:auth_num";.
The cookie expires upon the closing of browsers.
On each page, the cookie is read in and compared to what is currently
in the database. If the auth_nums do not match, they are considered
'logged out' and aren't allowed to view the page and are presented
with the login form again. If they do match, the script gets their
permissions and spits out a response, basically giving them access to
the functions that their permissions allowed.
Does this sound like a valid type of authentication?
I realize that by using cookies, we take some risks anyways ( not
closing the browser and another user using the computer ). Does
anyone have any suggestions for improvement or points of failure that
I haven't noticed? ( Like encrypting the username and the auth_num in
the cookie? )
Anyways, any help would be appreciated.
Thanks,
sh
------------------------------
Date: Tue, 12 Nov 2002 13:08:18 -0800
From: "Tan D Nguyen" <nospam@nospam.com>
Subject: Re: perl daemon in windows memory hog ?
Message-Id: <aqrqic$ceubm$1@ID-161864.news.dfncis.de>
"James Q.L" <flying_dragon@china.com> wrote in message
news:KmbA9.45479$oRV.42866@news04.bloor.is.net.cable.rogers.com...
>
> "Tan Nguyen" <nospam@nospam.com> wrote in message
> news:3dd0bbfb$1_4@nopics.sjc...
> what's the HEAD requests to IIS you refer to?..
> here i post the code using Win32::Daemon.
It's a HTTP "head" request as opposed to "get", "post" ones. You can't
simply rely on SCManager to correctly report the state of IIS. Once in a
while, you can find that an IIS is still up, but not responding. If you
query SCmanager for the state of the IIS, you'll get back an OK even though
the IIS server cannot serve any requests. To be safe, you might want to send
a http "head" request to the IIS servers and see if you can get any
responses. If not, shut them down if they're still up before restart them.
------------------------------
Date: Tue, 12 Nov 2002 21:47:31 +0100
From: Daniel Pfeiffer <occitan@esperanto.org>
Subject: Re: Perl: string vs. numeric
Message-Id: <20021112214731.6d8b24cc.occitan@esperanto.org>
Derek Thomson <derek@wedgetail.com> skribis:
> If you want the subroutine to try to detect if the argument is not a
> number, and then quote it, you'll find ways to do this in the Perl
> documentation that you already have.
Does it? I've looked, and I've also looked at the way Data::Dumper does it: When it uses the extension it get's it right, but when doing it in Perl it gets it wrong! It seems absolutely impossible to distinguish numbers from number-like strings.
That Perl can handle numbers as strings and inversely is almost always convenient. But at times one would want to know what kind of argument one got.
One case I stumbled across is that Perl stupidly uses a different parser for transforming a string to a number than when compiling. This is a catastrophe if you want to handle octal values and '0123' != 0123. So the caller of such a function has to do extra things, like not just conveniently pass qw/0123 .../, or call oct when reading from some source.
coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer
--
-- http://dapfy.bei.t-online.de/make.pl/
--
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 4107
***************************************