[11986] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5586 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 6 18:07:08 1999

Date: Thu, 6 May 99 15:00:30 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 6 May 1999     Volume: 8 Number: 5586

Today's topics:
    Re: a tail of two hashes (Tad McClellan)
    Re: anyone want to shoot uncle bill for me? <cassell@mail.cor.epa.gov>
    Re: Can a DNS lookup be performed from within perl ? (Larry Rosler)
    Re: Can a DNS lookup be performed from within perl ? <cassell@mail.cor.epa.gov>
    Re: cheap perl scripts latsharj@my-dejanews.com
        Creating MS Exchange Server Accounts in Batch dbaldwin@my-dejanews.com
    Re: Dumb Question <gellyfish@gellyfish.com>
    Re: END block and backtick command (Steve Linberg)
        Experience sought w/rdist & perl <chris.ice@cisco.com>
    Re: Extracting Emails from TXT #2 (Larry Rosler)
    Re: Extracting Emails from TXT #2 <cassell@mail.cor.epa.gov>
    Re: Extracting Emails from TXT <gellyfish@gellyfish.com>
    Re: FAQ 1.1: What is Perl? <cassell@mail.cor.epa.gov>
    Re: Get ID of who has file open? (Steve Linberg)
        Help w/ unique script!! <bruce@liquidblue.com>
    Re: Help w/ unique script!! (Steve Linberg)
    Re: Help w/ unique script!! <emschwar@rmi.net>
    Re: How do I practice scripts? (Robert Watkins)
    Re: How do I practice scripts? (Steve Linberg)
    Re: how to round off numbers? <uri@sysarch.com>
    Re: how to round off numbers? <emschwar@rmi.net>
    Re: how to round off numbers? <cassell@mail.cor.epa.gov>
    Re: how to round off numbers? <gellyfish@gellyfish.com>
        How to use multi dimensional array in Perl <jhaveri_nitesh@jpmorgan.com>
    Re: How to use multi dimensional array in Perl (Robert Watkins)
    Re: Making executables from .pl files? (Bob Trieger)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 6 May 1999 11:27:06 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: a tail of two hashes
Message-Id: <accsg7.e87.ln@magna.metronet.com>

rjreilly@my-dejanews.com wrote:
: sorry, my data follows: %dmn  = (  1 => 'east.foo.com',  2 => 'west.foo.com',
:  3 => 'south.foo.com',	4 => 'north.foo.com'  ); %dmnid = (3345 => '1', 3346
: => '1', 3347 => '4' , 3349 => '2', 3398=> '3', 23399 => '2');

: %dmn   key is the domainname id and value is the domain name.
: %dmnid key is a unique database id and value is domainname id.

: what i would like to do is print  the key from %dmnid and the value from %dmn
: where the domainid is the same..If i was using SQL i would do a join.


: #$dmn{$id}   = domainnameID{domainname}
: #$dmnid{$id} = databaseid{domainnameID}
: > :
: > : by binding the two hashes on the common domainnameID.
: > : I have just ventured into the world of hashes and appreciate any help.
: >
: > I find your question a little confusing.  Maybe it would help if you
: > gave us a small example to illustrate what you're trying to do.


-----------------
#!/usr/bin/perl -w
use strict;

my %dmn = ( 1 => 'east.foo.com',   2 => 'west.foo.com',
            3 => 'south.foo.com',  4 => 'north.foo.com'  ); 

my %dmnid = (3345 => '1',   3346 => '1',   3347  => '4' , 
             3349 => '2',   3398 => '3',   23399 => '2');

# output a DB-ID to Domain name cross-reference
foreach ( sort {$a <=> $b} keys %dmnid ) {
   print "$_  ==>  $dmn{$dmnid{$_}}\n" if exists $dmn{$dmnid{$_}};
}
-----------------


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 06 May 1999 13:16:46 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: anyone want to shoot uncle bill for me?
Message-Id: <3731F8AE.D031D65D@mail.cor.epa.gov>

Uri Guttman wrote:
> 
> >>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:
> 
>   BL> Uri Guttman wrote:
>   >> my boss knows what i did and is ok with it.
> 
>   BL> You're boss knows you asked us to kill "bill"?
> 
> that was regarding the hack with the system call to perl. he is only my
> boss on that contract.

Wait, now you're taking a *contract* out on bill?  Don't you think
that a *little* extreme?  [i won't ask if TomC thinks that's extreme.]
:-)
 
> but otherwise, i am my own boss!

Other than regular work, I am too.  :-)

David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


------------------------------

Date: Thu, 6 May 1999 13:04:25 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Can a DNS lookup be performed from within perl ?
Message-Id: <MPG.119b95a7441376209899e5@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed -- NOT!]

In article <7gsou2$pja$1@news.inet.tele.dk> on Thu, 6 May 1999 20:56:37 
+0200, John Doe <johndoe@this.is.a.bogus.address.com> says...
> This doesn't work for winnt, though, since gethostbyaddr isn's supported.

I'll tell that to all my programs.  I use it all the time.  ActiveState 
5.005_03 or MKS 5.003.

Try this:

print scalar gethostbyaddr pack('C4' => 192, 151, 11, 32), 2;

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Thu, 06 May 1999 13:58:32 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Can a DNS lookup be performed from within perl ?
Message-Id: <37320278.FEA76F56@mail.cor.epa.gov>

Larry Rosler wrote:
> 
> [Posted and a courtesy copy mailed -- NOT!]
> 
> In article <7gsou2$pja$1@news.inet.tele.dk> on Thu, 6 May 1999 20:56:37
> +0200, John Doe <johndoe@this.is.a.bogus.address.com> says...
> > This doesn't work for winnt, though, since gethostbyaddr isn's supported.
> 
> I'll tell that to all my programs.  I use it all the time.  ActiveState
> 5.005_03 or MKS 5.003.
> 
> Try this:
> 
> print scalar gethostbyaddr pack('C4' => 192, 151, 11, 32), 2;

And it works on win98 or win95 also [ActiveState 5.005_03 also],
so maybe you should just get out there and give it a try.

HTH,
David 
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


------------------------------

Date: Thu, 06 May 1999 20:40:40 GMT
From: latsharj@my-dejanews.com
Subject: Re: cheap perl scripts
Message-Id: <7gsuo7$j5m$1@nnrp1.deja.com>

In article <3731D204.2A1538D6@mail.cor.epa.gov>,
  David Cassell <cassell@mail.cor.epa.gov> wrote:
> David Cantrell wrote:
> >
> > On Thu, 22 Apr 1999 15:31:37 GMT, pejman@pejman.com enlightened us
> > thusly:
> >
> > >I am looking for somebody, who can write me some small perl scripts
> > >for small amount of money. Please let me know if you are interested
> > >or if you know somebody who is willing to do that.
> >
> > Let me know what you want done then.  And also let me know how small a
> > 'small amount of money' is.  Gotta make it worth my while ;-)
>
> And be sure not to tell him that he can use one of the many web
> search engines and find thousands upon thousands of Perl scripts
> of one sort or another, because he might not realize he doesn't have
> to pay for...
>
> Oops, I just blew your consulting fee, didn't I?  Sorry...
>
> :-)

That's OK - he can team up with cindycrawford and go work for the guy with the
XXX Adult web site.  ;-)

--
Regards,
Dick

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Thu, 06 May 1999 21:07:44 GMT
From: dbaldwin@my-dejanews.com
Subject: Creating MS Exchange Server Accounts in Batch
Message-Id: <7gt0at$kku$1@nnrp1.deja.com>

Hi,

Given a list of usernames and passwords, we need to create NT accounts for
each user, and at the same time create a MS Exchange user account or mailbox.
Through the NT User Manager, on a server running Exchange, this happens more
or less automatically.

Creating the NT account with Perl is a snap; so far I have not been able to
find out if it is possible to create an MS Exchange mailbox from a Perl
script.

Does anyone know how to create an account in MS Exchange from Perl? Many
thanks if you do!

David Baldwin

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: 6 May 1999 20:54:51 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Dumb Question
Message-Id: <7gsvir$4m0$1@gellyfish.btinternet.com>

On Thu, 6 May 1999 00:38:07 -0400 Jody Fedor wrote:
> 
> Jonathan Stowe wrote in message <7gq7qf$3ja$1@gellyfish.btinternet.com>...
>>use CGI qw(:standard);
>>
>>my @words = split / /,param('s');
>>
>>;-}
> 
> 
> Everyone suggests using modules but I think the overhead for CGI would be
> alot where just a few lines of matching code would do the trick.  Is my
> thinking wrong here?
> 

Except of course the module does it right, is based on an understanding
of the whole deal and not just on a little casual observation of what
appears to happening.  This may sound harsh but there's good reason
for it.

> Also, It's not really good to use a calculator (K-3) if you don't understand
> the basics.  Using the simple s/// I'm learning the basics so when I see all
> this fancy code you guys are dishing out, I might be able to understand how
> they work.  I'm working on becoming a mechanic not just the driver of the
> car!
> 

OK.  But if you want to do that you're going to have to do some homework:
there's not much point at just guessing whats happening under the hood
and fiddling with some bits to see what will result.  At best it just
wont work; at worst it could be plain dangerous.

You will want to read:

rfc1738 - Specification for URLS
rfc1945 - Specification for HTTP

Both from <http://www.rfc-editor.org>

And the CGI specification at <http://hoohoo.ncsa.uiuc.edu>.

You will also probably look at the code of CGI.pm and possibly cgi-lib.pl
(the basic things they do are done in much the same way ) avoid any books
that purport to teach you Perl *and* CGI in some unfeasible period of
time (infact possibly any book that purports to teach both).

And of course read the excellent documentation set that comes with Perl:
again and again and again and again.

> I appreciate everyones help on this and am learning alot from all the
> bantering.  About * being greedy, I read that in the book!  Now I know what
> it means! LOL.
> 

Hang around. Read stuff in this group.  You'll soon discover who knows
what they are talking about and who doesnt (and of course who knows
about what - we all talk about Perl here but come from a wide variety
of computing backgrounds).

Have fun.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Thu, 06 May 1999 17:55:14 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: END block and backtick command
Message-Id: <linberg-0605991755140001@ltl1.literacy.upenn.edu>

In article <7gshnj$6fh$1@nnrp1.deja.com>, dave_ll_chen@my-dejanews.com wrote:

> Why doesn't this work as expected?

It does work as expected.  At least, it works as I expected it to.

> > perl -e 'exit 20; END { `false` }'; echo $?;
> > echo $?
> 0
> 
> It's making me lose my exit codes.

Why did you post this twice?

It does exactly what you tell it to do.  The exit code for your one-liner
is 20, then you call `false` in the END block which overwrites your 20
with 0.  Replace the END block with something else and watch your result
change.

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


------------------------------

Date: Thu, 06 May 1999 14:48:12 -0700
From: Chris Ice <chris.ice@cisco.com>
Subject: Experience sought w/rdist & perl
Message-Id: <37320E1C.38DE6F9@cisco.com>

I've got a situation where I need to rdist a perl installation to
several OS versions (ie. Solaris 2.5.1, 2.6, and 2.7).

I'm looking for thoughts or experiences others have had in doing this?

Did you compile totally separate perl installations for each OS version?

Possible to share a common bin/, lib/, man/ structure?  If so, how did
you do it?

Is 5.005 better suited to this than 5.004?

Thanx
Chris
-- 
                               --------
 +----------------------------| _   /| |-----------------------------+
 | Chris Ice, Web Programmer  | \`o_O' | Cisco Systems, Inc.         |
 | http://www.trub.com/       |   ( )  | http://www.cisco.com/       |
 | mailto:chris.ice@cisco.com |    U   | 170 W. Tasman Dr., SJ-05/1  |
 | 408.525.7373               |  Syn,  | San Jose, CA 95134-1706 USA |
 +----------------------------|  Ack!  |-----------------------------+
  My opinions may not reflect  --------  the views of my employer.


------------------------------

Date: Thu, 6 May 1999 13:12:17 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Extracting Emails from TXT #2
Message-Id: <MPG.119b977bbac299659899e6@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7gsnbi$5k$1@nntp6.atl.mindspring.net> on Thu, 6 May 1999 
14:26:45 -0400, joeyandsherry@mindspring.com 
<joeyandsherry@mindspring.com> says...
> I have a txt file which let's say is a large letter. In it are Email
> addresses along with hundreds of other words. I'd like to write a script
> that would read this file and everytime it recoginized an "@" it would look
> for the beginning and the end, blank spaces...and write it to a separate
> file...I can handle the writing it's just the reading and recognition.

No matter how you intend to use the results, this is a very basic Perl 
question, which either doesn't deserve an answer here (on one level) or 
which can't be solved easily (perlfaq9 has a lot about this).
 
> --
> Joey Cutchins
> President
> Trading Post.Com, L.L.C.
> http://internettradingpost.com
> ceo@internettradingpost.com

As you are the CEO, perhaps you should hire a Perl programmer to manage 
the spamming for you.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Thu, 06 May 1999 13:51:11 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Extracting Emails from TXT #2
Message-Id: <373200BF.1AA2DFF4@mail.cor.epa.gov>

joeyandsherry@mindspring.com wrote:
> 
> I have a txt file which let's say is a large letter. In it are Email
> addresses along with hundreds of other words. I'd like to write a script
> that would read this file and everytime it recoginized an "@" it would look
> for the beginning and the end, blank spaces...and write it to a separate
> file...I can handle the writing it's just the reading and recognition.

Joey, this is why the previous responder asked why you wanted to know
how.  You see, this is also what spammers want to know.  And if we 
tell you in an open newsgroup, then they will either read DejaNews
to find it, or feel that they can ask the same question with impunity.
So unless you cna really justify why you want to be albe to do this
in a canned Perl script instead of doing it by hand for a small number
of letters, most readers here are going to feel uncomfortable about
providing this sort of assistance.

I hope you understand why so many of us are taking this position, 
and don't take it the wrong way.
 
> Thanks!

You may not feel that way upon reading this, but just in case,
You're welcome.
David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


------------------------------

Date: 6 May 1999 19:47:37 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Extracting Emails from TXT
Message-Id: <7gsrkp$4ll$1@gellyfish.btinternet.com>

On Thu, 6 May 1999 14:25:58 -0400 joeyandsherry@mindspring.com wrote:
> I have a txt file which let's say is a large letter. In it are Email
> addresses along with hundreds of other words. I'd like to write a script
> that would read this file and everytime it recoginized an "@" it would look
> for the beginning and the end, blank spaces...and write it to a separate
> file...I can handle the writing it's just the reading and recognition.
> 

I feel a preemptive Net Abuse Complaint coming on ...

I would suggest that you read the perlre manpage and then if you are
having any further difficulty I'm going to want to see a note from
your mother saying that this is not going to be used for purposes of
unsolicited mail.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Thu, 06 May 1999 13:43:58 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 1.1: What is Perl?
Message-Id: <3731FF0E.54BF09C6@mail.cor.epa.gov>

Uri Guttman wrote:
> 
> >>>>> "DC" == David Cassell <cassell@mail.cor.epa.gov> writes:
> 
>   DC> Tom Christiansen wrote:
>   >> Perl is a high-level programming language with an eclectic heritage
>   >> written by Larry Wall and a cast of thousands. It derives from the
>   >> ubiquitous C programming language and to a lesser extent from sed,
>   >> awk, the Unix shell, and at least a dozen other tools and
>   >> languages
> 
>   DC> At least.  Is there any language Perl hasn't derived *something*
>   DC> from?  I see BASIC in the formats, so that's out.  COBOL?  Forth?
>   DC> Eiffel?  Pearl?
> 
>   DC> This is a semi-serious question.  Have other posters thought about
>   DC> the etymology and philology of some of the interesting corners of
>   DC> Perl?
> 
> check back a few months for a thread i started on the origins of perl
> features. it got pretty hot and heavy and was fairly educational. i
> don't recall the title but search for origin and some of the language
> names like basic, lisp, etc and you should find it.

Uri,

Thanks for the heads-up.  I wonder how I could have missed it.  Must
have been one of those spells when I was out of town or something.

So, hopefully, that ends this thread now.

David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


------------------------------

Date: Thu, 06 May 1999 17:42:58 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Get ID of who has file open?
Message-Id: <linberg-0605991742580001@ltl1.literacy.upenn.edu>

In article <3731E2A1.25B4C93E@boeing.com>, Ken Ralph
<kenneth.r.ralph@boeing.com> wrote:

> Any suggestions on how to ID who has a file opened for write on an NT
> server?

I'd suggest asking in an NT newsgroup.

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


------------------------------

Date: Thu, 06 May 1999 17:14:29 -0400
From: Bruce <bruce@liquidblue.com>
Subject: Help w/ unique script!!
Message-Id: <3732062E.CD5D67AF@liquidblue.com>

Hiya,
I am in need of a script that we can use to run a contest, ask a survey,
and have an E-mail entry box. The script also needs to only allow 1 vote
per IP address. It seems this is a mish-mash of several scripts I have
seen. What we are going to do is give away a prize. After the visitor
has answered a question specific to our products, we want the ability to
have his E-mail written to a text file via a text box, and then also
grab the IP address so they can only enter once.
Seems like it is a combination of a "Quiz" or "Survey" script with a
"Form" script for the E-mail address.
Anyone have ANY ideas??



------------------------------

Date: Thu, 06 May 1999 17:41:54 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Help w/ unique script!!
Message-Id: <linberg-0605991741540001@ltl1.literacy.upenn.edu>

In article <3732062E.CD5D67AF@liquidblue.com>, bruce@liquidblue.com wrote:

> Hiya,
> I am in need of a script that we can use to run a contest, ask a survey,
> and have an E-mail entry box. The script also needs to only allow 1 vote
> per IP address. It seems this is a mish-mash of several scripts I have
> seen. What we are going to do is give away a prize. After the visitor
> has answered a question specific to our products, we want the ability to
> have his E-mail written to a text file via a text box, and then also
> grab the IP address so they can only enter once.
> Seems like it is a combination of a "Quiz" or "Survey" script with a
> "Form" script for the E-mail address.
> Anyone have ANY ideas??

What's your question?  Are you asking for someone to write this for you? 
Or are you asking if such a script already exists?

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


------------------------------

Date: 06 May 1999 15:47:41 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Help w/ unique script!!
Message-Id: <xkf3e19na4i.fsf@valdemar.col.hp.com>

Bruce <bruce@liquidblue.com> writes:
> I am in need of a script that we can use to run a contest, ask a survey,
> and have an E-mail entry box. The script also needs to only allow 1 vote
> per IP address.

This is dumb.  Everybody visiting your site over a corporate firewall is
going to appear to have the same IP address.  If you want to restrict
yourself to only getting one answer from any given corporate site, then
go ahead.  Somehow, I don't think that's what you want.

> It seems this is a mish-mash of several scripts I have seen.

It seems this post isn't going to contain any Perl questions at all.

> What we are going to do is give away a prize.

Good for you!  More people should give away prizes.

> After the visitor has answered a question specific to our products, we
> want the ability to have his E-mail written to a text file via a text
> box

Sorry, that's just not possible.  Perl doesn't *have* text boxes, so it
can't very well write to a file through one.

> and then also grab the IP address so they can only enter once.

See above for why this is a bad idea.

> Seems like it is a combination of a "Quiz" or "Survey" script with a
> "Form" script for the E-mail address.

So... what's your Perl question?

> Anyone have ANY ideas??

Yes... I have many ideas.  I have this great idea on how to achieve world 
peace through the liberal application of foot massages and potato
latkes to key USENET posters, such as myself.  I also have a neat idea
involving the entire cheerleading squad of the Lakers, a hot tub, and
large ammounts of Jell-O.  And just now, I had an idea about how to
achieve FTL travel using only a shoestring, three rubber bands, a
peripatetic hamster, and Don King, but it disappeared before I could
write it down.

-=Eric


------------------------------

Date: Thu, 06 May 1999 21:18:23 GMT
From: r-watkins@worldnet.att.net (Robert Watkins)
Subject: Re: How do I practice scripts?
Message-Id: <7gt0v8$s00$1@bgtnsc03.worldnet.att.net>

In article <7gspgm$ks3$1@gxsn.com>, "Laurie Dunn" <lauriedu@globalnet.co.uk> wrote:
>
>I am new to perl and want to practice scripts.
>My ISP will not let me store scripts.=20
>I have a windows PC and a standard dial up connection.
>How does anybody suggest I can write, send and call my scripts=20
>so that I can practice?
>Thanks in advance for your comments
>Laurie
>

By far the best way to test your scripts is to simulate the real environment 
as much as possible. I would recommend two things which, taken together, will 
make your testing environment very realistic and will allow you to learn more 
than just Perl CGI.

1] Install Perl on your PC. You can either install ActiveState's version 
(http://www.ativestate.com/) or the standard Win32 port from CPAN 
(http://language.perl.com/CPAN/ports/), both are free, of course. I would 
recommend the ActiveState version as it is optimized for Win32.

2] Install a web server on your PC. There are a number of freeware http 
servers available, but far and above all, I would recommend Apache. The 
(fairly new) Win32 version is not as stable or secure as the UNIX version, but 
for a testing environment it will be more than adequate. Even downloading and 
installing the binary version does require that you learn a little something 
about servers, but if you want to write good scripts, this is a good thing! 
The included documentation may even be enough to get you started. If, on the 
other hand, you are intent upon developing for a Windows environment, 
Microsoft does have a Personal Web Server which is also free and which is in 
many ways similar to IIS 4.0. I can't remember a more specific URL than 
http://www.microsoft.com/, but this will get you there.

Enjoy!


--------------------------------
Robert Watkins
r-watkinsNO@SPAMworldnet.att.net
--------------------------------



------------------------------

Date: Thu, 06 May 1999 17:48:54 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: How do I practice scripts?
Message-Id: <linberg-0605991748540001@ltl1.literacy.upenn.edu>

In article <7gspgm$ks3$1@gxsn.com>, "Laurie Dunn"
<lauriedu@globalnet.co.uk> wrote:

> This is a multi-part message in MIME format.

Please don't post MIME to newsgroups.  Please, please, please.

> I am new to perl and want to practice scripts.
> My ISP will not let me store scripts.=20
> I have a windows PC and a standard dial up connection.
> How does anybody suggest I can write, send and call my scripts=20
> so that I can practice?

You could get a new ISP.  I would.

Meanwhile, you can run Perl just fine on your PC.  If you want to write
CGI scripts, and get practice with that, study the CGI.pm module, which
allows you to simulate it.

Good luck and have fun!

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


------------------------------

Date: 06 May 1999 16:02:44 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: how to round off numbers?
Message-Id: <x7d80evue3.fsf@home.sysarch.com>

>>>>> "K" == KC  <hunt@queen.es.hac.com> writes:

  K> Tom Christiansen wrote:
  >> A newsgroup is not a manpage server.  man perlfunc, search for
  >> sprintf.

  K> Isn't it? People have questions. They post questions on the ng. Other
  K> people answer those questions.

  K> Oh...you must be one of those all-knowing geniuses that only uses the ng
  K> to post examples of their brilliance.

and you are? 

maybe someone who knows netiquette?

maybe someone who knows that answering each silly little question will
swamp this group?

maybe someone who wants to keep propogating bad answers?

maybe someone who hasn't read the faq?

oe maybe someone who posts incorrect answers?

  K> $num = int($num * 1000 + .5) / 1000

  K> will turn $num=3.45238576

  K> into $num=3.452

perl -e '$n=3.95638576;$n=int($n*1000 + .5)/1000;printf "%.20f\n", $n'
3.95599999999999996092

looks accurate to me!

so is your round expression better then the sprintf function? when you
print any float it gets rounded anyhow by the same function. so wouldn't
it make sense to use it for explicit rounding? and sprintf is probably
faster since it stays in c while you have a perl expression. and your
precision is duplicated making it harder to use elsewhere.

i would think twice (in your case 2.228383 times) before crossing tom c.
your contribution here amounts to a tiny pile of fly poop so far. so
your opinion of what he says amounts to the same.

if i plonked, you would plonked, so consider yourself plonked
symbolically. 

i bet you use symbolic refs too! (that is an insult if you don't get it)

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


------------------------------

Date: 06 May 1999 14:03:34 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: how to round off numbers?
Message-Id: <xkf6766m0dl.fsf@valdemar.col.hp.com>

KC <hunt@queen.es.hac.com> writes:
> Isn't it? People have questions. They post questions on the ng. Other
> people answer those questions.

And then other people ask those questions.  And then still other people
ask the same questions.  And then you have hundreds of people asking the
same questions.  Questions that have been answered definitively in the
FAQs and manpages.

Question: What value is it to a newsgroup to be answering the same
questions over and over again, especially given that much of the time,
the answers will not be of as high quality as the already existing
documentation?

> Oh...you must be one of those all-knowing geniuses that only uses the ng
> to post examples of their brilliance.

Haven't been around here long, have you?  Look up his posting profile on
DejaNews.

-=Eric


------------------------------

Date: Thu, 06 May 1999 13:34:40 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: hunt@queen.es.hac.com
Subject: Re: how to round off numbers?
Message-Id: <3731FCE0.6005ACEA@mail.cor.epa.gov>

[courtesy cc sent to poster]

KC wrote:
> 
> Tom Christiansen wrote:
> > A newsgroup is not a manpage server.  man perlfunc, search for
> > sprintf.
> >
> > Bye.
> 
> Isn't it? People have questions. They post questions on the ng. Other
> people answer those questions.
> 
> Oh...you must be one of those all-knowing geniuses that only uses the ng
> to post examples of their brilliance.

Umm, KC, I don't know how to tell you this, but you really put your
foot in your mouth on this one.  As a matter of fact, TomC *is*
one of those all-knowing geniuses who only use the ng to answer
questions and post examples of his brilliance.

He is co-author of 4 of the most important Perl books you can buy.
He is the primary `caretaker' of the Perl documentation, which is
free and on-line.  His graduate work in computer science specialized
in operating systems design and computational linguistics.

He has been fundamentally involved with Perl development for over
a decade.  Yet he still finds time to answer questions in a *.misc
newsgroup.  Does Soustroup answer questions in comp.lang.c++ ?
After years of this, he is somewhat impatient with people who can't
be bothered to read a book, or to look up the documentation he has
labored over for so long.

So, please, next time count to ten before pressing that `send now'
button.  Okay?  

HAND,
David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


------------------------------

Date: 6 May 1999 19:41:32 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to round off numbers?
Message-Id: <7gsr9c$4lh$1@gellyfish.btinternet.com>

On Thu, 06 May 1999 16:47:03 GMT Cim wrote:
> On 6 May 1999 16:19:07 +0100, Jonathan Stowe <gellyfish@gellyfish.com>
> wrote:
> 
> 
>>Sorry which part of that FAQ or the functions it describes dont you 
>>understand ?
>>
>>What happens if you do this:
>>
>>    printf("%.0f %.0f\n",$number1,$number2);
>>
>>With your example numbers for instance ?
>>
> 
> mhm, yea but that will print. what if I have to use those numbers in
> other functions etc. IS there a function that rounds numbers normally
> or is there not?
> 

Yes.  

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Thu, 06 May 1999 16:50:03 -0400
From: Nitesh Jhaveri <jhaveri_nitesh@jpmorgan.com>
Subject: How to use multi dimensional array in Perl
Message-Id: <3732007B.5867CD5@jpmorgan.com>

Hi:

I need to create a two dimensional array to store a result of the sql
query.

can someone help me with some demo code on how to acomplish this using
Perl Array?
Thanks in Advance...

Nitesh



------------------------------

Date: Thu, 06 May 1999 21:27:31 GMT
From: r-watkins@worldnet.att.net (Robert Watkins)
Subject: Re: How to use multi dimensional array in Perl
Message-Id: <7gt1gc$s00$2@bgtnsc03.worldnet.att.net>

In article <3732007B.5867CD5@jpmorgan.com>, Nitesh Jhaveri <jhaveri_nitesh@jpmorgan.com> wrote:
>Hi:
>
>I need to create a two dimensional array to store a result of the sql
>query.
>
>can someone help me with some demo code on how to acomplish this using
>Perl Array?

>From page 257 of the Camel book:

# assign to an array a list of references
@LoL = (
        [ "fred", "barney" ],
        [ "george", "jane", "elroy" ],
        [ "homer", "marge", "bart" ],
);

print @LoL[2][2];   # prints "bart"

Read on from here and the world becomes multidimensional before your eyes.

--------------------------------
Robert Watkins
r-watkinsNO@SPAMworldnet.att.net
--------------------------------



------------------------------

Date: Thu, 06 May 1999 20:46:51 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Making executables from .pl files?
Message-Id: <7gsubo$77p$1@fir.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
ralawrence@my-dejanews.com wrote:
>In article <ylhfpq1yxy.fsf@windlord.stanford.edu>,
>  Russ Allbery <rra@stanford.edu> wrote:
>>
>> In my experience, people usually try to hide their code and prevent people
>> from modifying it because they're not good enough programmers to write
>> code that's worth sharing.  Take this as you will.
>>
>
>Congratulations on managing to insult all those that have released free
>software without open source code. I assume after that little gem you're going
>to delete every bit of free software that you have that doesn't come with
>source code because after all "it isn't worth sharing"?

As the newsgroup and subject line suggest. He was refering to perl 
source code. I challenge you to show us an example of free perl software 
that did not include its code.




------------------------------

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 5586
**************************************

home help back first fref pref prev next nref lref last post