[11655] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5255 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 30 04:03:42 1999

Date: Tue, 30 Mar 99 01:00:21 -0800
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, 30 Mar 1999     Volume: 8 Number: 5255

Today's topics:
        404 Not Found Check?? <sbott@earthlink.net>
    Re: 404 Not Found Check?? <Tony.Curtis@vcpc.univie.ac.at>
    Re: ANNOUNCE: Champaign-Urbana.pm Meeting Mon Mar 29 (Jim Hill)
    Re: Excel file massimobalestra@my-dejanews.com
    Re: Getting parent process's environment variable to ch (Larry Rosler)
    Re: How to create NT service in Perl? <chirstius@mediaone.net>
    Re: IIS 4,0 and PERL scripts. <ffchopin@worldnet.att.net>
    Re: IIS 4,0 and PERL scripts. <ffchopin@worldnet.att.net>
    Re: Intricacies of using strict? (Chris Tremblay)
    Re: Intricacies of using strict? (Mark-Jason Dominus)
    Re: New to perl, how do I test the installation? <ronald_f@my-dejanews.com>
        NT Kernel in Perl (Christopher Spence)
    Re: NT Kernel in Perl <uri@home.sysarch.com>
        Ok, I got Perl to run but... <bbyrdsong@bnicewd.com>
    Re: Ok, I got Perl to run but... (Jonathan Stowe)
        opinions on buying updated Learning Perl book? <streak@umich.edu>
        Password change cgi script inaignani@my-dejanews.com
    Re: qe:operation on binary files <loulou@ltt.ntua.gr>
    Re: reading from/writing to Usenet w/ Perl (Jonathan Stowe)
    Re: search and replace <chowse@mdcc.edu>
    Re: search and replace <zenin@bawdycaste.org>
    Re: search and replace (Sam Holden)
    Re: Use of uninitialized value at ... why? <rick.delaney@home.com>
    Re: Use of uninitialized value at ... why? <fabascal@gredos.cnb.uam.es>
    Re: Why do we like Perl? ssmieja@execpc.com
        Win32::FileSecurity (Christopher Spence)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 29 Mar 1999 23:19:37 -0800
From: Steven Bott <sbott@earthlink.net>
Subject: 404 Not Found Check??
Message-Id: <37007B07.5913A30B@earthlink.net>

Is there a simple way with Perl to check whether a file exists at all??

I want to do something like this:

if (I get a 404 Response Header) {
print "Location: www......\n\n";
}

or

if (a file exists) {
print "Location: www......\n\n";
}
else {
print "Location: www......\n\n";
}

Is something like that possible?  If it is, what do I put in the ( )??

Any help would be greatly appreciated!

Thank You,

Steven Bott
sbott@earthlink.net






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

Date: 30 Mar 1999 10:08:27 +0200
From: Tony Curtis <Tony.Curtis@vcpc.univie.ac.at>
Subject: Re: 404 Not Found Check??
Message-Id: <83677jiemc.fsf@vcpc.univie.ac.at>

Re: 404 Not Found Check??, Steven
<sbott@earthlink.net> said:

Steven> Is there a simple way with Perl to check
Steven> whether a file exists at all??  I want to do

Yes, but that has nothing to do with your question!

Steven> something like this:

Steven> if (I get a 404 Response Header) { print
Steven> "Location: www......\n\n"; }

perldoc LWP
perldoc HTTP::Request
perldoc HTTP::Response
perldoc CGI                     (for the `redirect' method)

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: 30 Mar 1999 02:27:43 GMT
From: jimhill@meldrick.swcp.com (Jim Hill)
Subject: Re: ANNOUNCE: Champaign-Urbana.pm Meeting Mon Mar 29
Message-Id: <slrn7g0d8f.4vd.jimhill@meldrick.swcp.com>

In <7doond$k1a$2@info2.uah.edu>,
Greg Bacon <gbacon@itsc.uah.edu> wrote:

>: Champaign-Urbana Perl Mongers,
>
><FLAME Level="0%">
>    [14:38] ettsn% perl
>    package Champaign-Urbana.pm;
>    syntax error at - line 1, near "package Champaign-"
>    Execution of - aborted due to compilation errors.
>
>But seriously.. I've always seen the name of your area permuted the
>other way, as in uiuc.edu.  Are you just being contrary, or is there
>something that we non-locals don't know?

It's UIUC because the administrative offices and much of campus is
located in Urbana.  Since Champaign is larger, cooler, and home of
crucial locations like Papa Del's Pizza, La Bamba, and the Greek Table,
it is rightfully mentioned first in all other contexts.


Jim, who thinks he can smell Papa Del's all the way out here in NM
-- 
jimhill@swcp.com                      http://www.swcp.com/~jimhill/

                  "Visualize world peace...good.
                Now wake up and smell the coffee."


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

Date: Tue, 30 Mar 1999 07:23:53 GMT
From: massimobalestra@my-dejanews.com
Subject: Re: Excel file
Message-Id: <7dpu63$rrt$1@nnrp1.dejanews.com>

In article <36FF8DDF.4DC8@groton.pfizer.com>,
  Petet Yang <peter_yang@groton.pfizer.com> wrote:
> Hi.
>
> does anyone know how to retrieve data from MS Excel file using Perl? And
> an example too? Thanks in advance.
>
> Peter
>

This is a test I wrote some days ago. I tested it, it works and I never used
it. I am looking also for an example to open an excel file and, without else,
save as CSV file. Does someone has an example?

#!/usr/bin/perl

use Win32::OLE;

eval {$ex = Win32::OLE->GetActiveObject('Excel.Application')};
die "Excel not installed" if $@;
unless (defined $ex) {
    $ex = Win32::OLE->new('Excel.Application', sub {$_[0]->Quit;})
            or die "Oops, cannot start Excel";
}

# open an existing workbook
$Wkbk = 'c:\perl\examples\myfile.xls'
$book = $ex->Workbooks->Open( $Wkbk );
print Win32::OLE->LastError() . "\n";

$sheet = $book->Worksheets(1);
print Win32::OLE->LastError() . "\n";

# write to a particular cell
#$sheet->Cells(1,1)->{Value} = "foo";

$r=1;
$fine = 0;
while (@array = $sheet->Range("A$r:G$r")->{Value} ) {
  print "riga $r: ";
  for $a1 (@array) {
    for $a2 (@$a1) {
      for $a3 (@$a2) {
        $fine = 1 if ($a3 eq "");
        print "$a3;";
      }
    }
  }
  print "\n";
  last if ($fine == 1);
  $r++;
}
# print $array[0][1] . $array[1][1];

print Win32::OLE->LastError() . "\n";
$book->Quit;
print Win32::OLE->LastError() . "\n";
undef $book;
undef $ex;



Bye

 Massimo Balestra
 System Engineer
 Torino Italy

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


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

Date: Tue, 30 Mar 1999 00:34:09 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Getting parent process's environment variable to change when running a   perl script
Message-Id: <MPG.116a2c5d5bdabca59897ed@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <3700277A.8A20BFC3@attws.com> on Mon, 29 Mar 1999 17:23:06 -
0800, Timothy Trinh <timothy.trinh@attws.com >says...
> I am currently running perl5 on WinNT4.0 inside of a Z-Shell.  From what
> I understand, when ever you run a perl script, it is run in a child
> process.  In the child process, you can access all the environment
> variables and make any modification to them within the child process.
> When the script is done executing any modification you have made to the
> environment variable does not affect the parent process.  How can I get
> the modification or creation of environment variables to stick to the
> parent process?

perlfaq8:  "I {changed directory, modified my environment} in a perl 
script.  How come the change disappeared when I exited the script? How
do I get my changes to be visible?"

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


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

Date: Mon, 29 Mar 1999 22:29:06 -0600
From: "Chuck Hirstius" <chirstius@mediaone.net>
Subject: Re: How to create NT service in Perl?
Message-Id: <KpYL2.581$JO4.3563774@rmnws01.ce.mediaone.net>

You need the NT server Resource kit.  On it you will find srvany.exe, and
instsrv.exe,  these are your ticket to making anything an NT service.  If
you look at the notes on the NT CD it explains in detail how to install an
app as a service.  Basically:

at a command prompt, type:    instsrv "What you want your server to be
caled"  (full path to)srvany.exe

you should get a message back saying it was successful.

You then need to go into the registry and go to  hkey_local_machine/current
control set/services/your server name  (I hope this is correct I am going
from memory!!)

You need to make a new key called parameters, under that key make 3 values,
Application, where you put the app you want to call, what I do for perl is
make this (full path to)perl.exe, the next value is AppParameters, this is
where you put arguments to the Application, this is where I put my perl
script name.  the third key is optional and is AppDir (I think)  and is a
working directory for the app.

Look into the docs found on the NT Server CD, but this should give you a
good idea of what it takes to do this.  At work I use Perl services to
perform alot of NT admin for me, you can also disable console on them, so
that means NO DOS BOX!!  the script just runs in the background.  If you
need more help e-mail me and I'll send info from work where I can be more
exact on the steps.  Hope this helps!

Chuck


Doug McBride wrote in message <37002C1E.876CE993@mcbride.net>...
>"David L. Cassell" wrote:
>>
>> Doug McBride wrote:
>> > I see that the Win32::Service module lets me control services, but how
>> > do I create a new service?  I think there's a Win32 API call to do
this,
>> > but has it been exported to Perl already?
>>
>> Check out the Perl for Win32 FAQ that comes with ActiveState Perl.
>> Your question is already answered, in more detail than you're likely to
>> get in a newsgroup posting.
>
>Maybe I'm being dense, but I don't see anything about creating services
>in a Perl script in the FAQ.  So my question still stands.
>
>--
>Doug McBride - doug@mcbride.net - n|c - http://www.nc.com - 650.631.5268




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

Date: Mon, 29 Mar 1999 23:55:28 -0500
From: "Jason Simms" <ffchopin@worldnet.att.net>
Subject: Re: IIS 4,0 and PERL scripts.
Message-Id: <7dplsh$5t5$1@bgtnsc02.worldnet.att.net>

Forgive me for being curious, but what script do you have the requires 20
minutes to execute?  Or, more to the point, what does it do?  As for an
answer to your question, I personally am not aware of a way to easily take
care of that...  You may be able to do something kind of interesting like
the following:

Have a JavaScript event fire when they close the browser (onExit, I think)
that calls a Perl program which kills the process of the original script.
While I am not an expert at Perl by any means, I know you can capture the
process ID of the first script, store it (perhaps in a temp file), and then
recall it if need be to kill it through a system command in the secondary
script.  Of course there may be an infinitely easier way of doing what you
want, but if no other advice is forthcoming, you could probably play around
with this to get it working.

Jason Simms

> As this script runs about 20 minutes before it finishes users can  just
start the script and then log
> off.




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

Date: Tue, 30 Mar 1999 00:18:06 -0500
From: "Jason Simms" <ffchopin@worldnet.att.net>
Subject: Re: IIS 4,0 and PERL scripts.
Message-Id: <7dpn72$b11$1@bgtnsc02.worldnet.att.net>

Of course, I could now say that I am moron for thinking you are on a UNIX
box (should have caught that IIS thing...)..  Sorry about that false advice,
then, but I still think it may be an interesting idea.  There may be ways
for you to somehow strictly limit the amount of CPU time and/or certain
programs get (I know you can do this with CGI stuff, not sure about regular
programs).  This way, your programs won't necessarily shut down your box
when they get out of control.  Otherwise, switch to UNIX, go bonkers over
the control you now have, throw away your NT stuff after laughing
hysterically that you ever thought IIS was a viable Enterprise solution, and
enjoy life more...  :-)

Jason Simms

Jason Simms <ffchopin@worldnet.att.net> wrote in message
news:7dplsh$5t5$1@bgtnsc02.worldnet.att.net...
> Forgive me for being curious, but what script do you have the requires 20
> minutes to execute?  Or, more to the point, what does it do?  As for an
> answer to your question, I personally am not aware of a way to easily take
> care of that...  You may be able to do something kind of interesting like
> the following:
>
> Have a JavaScript event fire when they close the browser (onExit, I think)
> that calls a Perl program which kills the process of the original script.
> While I am not an expert at Perl by any means, I know you can capture the
> process ID of the first script, store it (perhaps in a temp file), and
then
> recall it if need be to kill it through a system command in the secondary
> script.  Of course there may be an infinitely easier way of doing what you
> want, but if no other advice is forthcoming, you could probably play
around
> with this to get it working.
>
> Jason Simms
>
> > As this script runs about 20 minutes before it finishes users can  just
> start the script and then log
> > off.
>
>




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

Date: Tue, 30 Mar 1999 03:14:45 GMT
From: anne@NOstormSPAM.ca (Chris Tremblay)
Subject: Re: Intricacies of using strict?
Message-Id: <3700415b.14051508@news.storm.ca>

Thanks for the response! That clarifies it somewhat. I definitely am
keeping this posting it explains a lot!

On Tue, 30 Mar 1999 01:53:47 GMT, Eric Bohlman <ebohlman@netcom.com>
wrote:

>Chris Tremblay <anne@NOstormSPAM.ca> wrote:
>: I want to start using strict in Perl but when it comes to declaring
>: variables to make it compile, I assume there is more than just
>: throwing "my" in front of it. 
>
>: What I want to know is: Is there anywhere on the web that can explain
>: what and why I woud need to do to make my scripts strict-compliant?
>: I have the faq's but it doesn't explain it thoroughly enough is there
>: anywhere else?
>
>It's best to start of by remembering that 'use strict' is really a 
>combination of three different pragmas (directives):
>
>1) use strict 'refs': This says that symbolic references are not 
>allowed.  IOW, if you have a string variable whose value is the name of 
>another variable, you can't use the first variable to get at the value of 
>the second.
>
>Without this restriction in effect, you can do things like:
>
>$v1='Hello ';
>$v2='world!';
>for ($i=1;$i<2;++$i) {
>  $r="v$i";
>  print $$r;
>}
>
>use strict 'refs' disallows this.  Many people think they want to use 
>symbolic references, but generally what they want to do is better done 
>using arrays or hashes.  Symbolic references make it easy to create 
>hard-to-track down bugs, so they should only be used in special cases.
>
>Note that symbolic or "soft" references are entirely separate from true 
>or "hard" references.
>
>2) use strict 'subs': This says that barewords cannot be used to invoke 
>subroutines that haven't been declared earlier on in the file.  It helps 
>catch bugs where a subroutine's name has been misspelled (without this 
>pragma, you'd get a run-time error rather than a compile-time one).
>
>3) use strict 'vars': This requires that any variable names you use must
>be declared, fully-qualified or imported before they're used.  Variables
>can be *declared* either as lexical variables using 'my' or as global
>variables using 'use vars'.  Variables can be fully qualified by
>prepending their package names followed by '::'.  Variables are imported
>when you use a module that exports them.  This pragma helps catch bugs
>where you inadvertently use two different names (e.g. $count and $counter)
>when you mean the same variable. 
>
>All these pragmas require to think about your code in terms of its 
>overall design rather than on a purely line-by-line basis.  The extra 
>discipline they impose makes it easier to write reliable code.



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

Date: Tue, 30 Mar 1999 07:10:45 GMT
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Intricacies of using strict?
Message-Id: <7dptcd$q0m$1@monet.op.net>

In article <37002810.7576051@news.storm.ca>,
Chris Tremblay <anne@NOSPAMstorm.ca> wrote:
>What I want to know is: Is there anywhere on the web that can explain
>what and why I woud need to do to make my scripts strict-compliant?

`strict' is three things:  `strict vars', `strict subs', and `strict refs'.

There is an extensive discussion of `strict vars' at

	http://www.plover.com/~mjd/perl/FAQs/Namespaces.html



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

Date: Tue, 30 Mar 1999 08:41:49 GMT
From: Ronny <ronald_f@my-dejanews.com>
Subject: Re: New to perl, how do I test the installation?
Message-Id: <7dq2oc$fo$1@nnrp1.dejanews.com>

In article <19990329073609.24374.00001733@ng119.aol.com>,
  lnottingha@aol.com (LNottingha) wrote:
> I just installed perl 5 on an NT server and the script i'm trying to run
> doesn't work.  How do I test the installation?
>

Do something like	perl -e "use strict" to see if it can find the
libraries, and execute a simple script containing just	print "hello
",@INC,"\n" to see if that works.

Ronald
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/

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


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

Date: Tue, 30 Mar 1999 05:24:03 GMT
From: ComputerShoppe@mediaone.net (Christopher Spence)
Subject: NT Kernel in Perl
Message-Id: <37025fc9.1348671@nntp.ne.mediaone.net>

I am trying to rewrite the NT Kernel in Perl hoping i can get some
performance gains.  Anyone want to help?

:)




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

Date: 30 Mar 1999 00:27:56 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: NT Kernel in Perl
Message-Id: <x7yakfwnqb.fsf@home.sysarch.com>

>>>>> "CS" == Christopher Spence <ComputerShoppe@mediaone.net> writes:

  CS> I am trying to rewrite the NT Kernel in Perl hoping i can get some
  CS> performance gains.  Anyone want to help?

  CS> :)

check out larry wall's view on this theme:

http://segfault.org/story.phtml?mode=2&id=36fc3f8c-0138b980

:-)

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: Tue, 30 Mar 1999 00:15:26 -0500
From: "Go Play, BNice" <bbyrdsong@bnicewd.com>
Subject: Ok, I got Perl to run but...
Message-Id: <7dpm0m$gkj$1@camel15.mindspring.com>

Using IIS4,
It seems like I don't need to put commands like print "<HTML>";, blah, blah
because when I execute the script now, it shows all the commands but not the
html code.  I created the famous Hello World and this is what I got when I
ran it:

print; print; print; print;

Hello World

print; print;

Something to that effect.  So I went back to the file and took out all the
Perl commands and just left the html code there.  I resaved the file,
helloworld.pl, launch the browser and executed the script.  This time I got
"Hello World" sitting at the top of the page.  I don't understand.  I used
no Perl command but got Hello World out of it anyway.  Could someone please
explain to me what in the hell is going on?

Thanks,
Brian Byrdsong
BNice Web Designs
www.bnicewd.com





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

Date: Tue, 30 Mar 1999 08:12:00 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: Ok, I got Perl to run but...
Message-Id: <370086cc.794154@news.dircon.co.uk>

On Tue, 30 Mar 1999 00:15:26 -0500, "Go Play, BNice"
<bbyrdsong@bnicewd.com> wrote:

>Using IIS4,

Uh huh.

<snip>
>
>Something to that effect.  So I went back to the file and took out all the
>Perl commands and just left the html code there.  I resaved the file,
>helloworld.pl, launch the browser and executed the script.  This time I got
>"Hello World" sitting at the top of the page.  I don't understand.  I used
>no Perl command but got Hello World out of it anyway.  Could someone please
>explain to me what in the hell is going on?
>

Your server is not configured correctly to run CGI - Please examine
the documentation for your server - if you continue to have problems
you will get a better answer from

comp.infosystems.www.servers.ms-windows

/J\ 


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

Date: Tue, 30 Mar 1999 02:22:18 -0500
From: "Theodore C. Belding" <streak@umich.edu>
Subject: opinions on buying updated Learning Perl book?
Message-Id: <37007BAA.BF93224C@umich.edu>

I have the first edition of the O'Reilly Learning Perl book by
Schwartz.  I was wondering if there was any good reason to buy the
second edition if I'm not interested in CGI programming right now.
Specifically, has the second edition been updated significantly for 5.0,
enough that I should buy it? Thanks!
-Ted

--
Ted Belding                               Ted.Belding@umich.edu 
University of Michigan Program for the Study of Complex Systems
Homepage: http://www-personal.umich.edu/~streak/
PGP key:  http://www-personal.umich.edu/~streak/pgp-key.html


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

Date: Tue, 30 Mar 1999 08:31:23 GMT
From: inaignani@my-dejanews.com
Subject: Password change cgi script
Message-Id: <7dq24r$vvk$1@nnrp1.dejanews.com>

I am trying to write a cgi script for a group of users in my server.  The
script should be able to change the password for the respective user by
calling 'passwd' program.  Is there any script already existing? I am on
Linux.

Thanx in advance.

-gnana

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


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

Date: Tue, 30 Mar 1999 09:20:06 +0300
From: Costis Angelis <loulou@ltt.ntua.gr>
Subject: Re: qe:operation on binary files
Message-Id: <37006D16.6EAD9F24@ltt.ntua.gr>

Larry Rosler wrote:

> [Posted and a courtesy copy mailed.]
>
> In article <36FFB6AC.9A6099DE@ltt.ntua.gr> on Mon, 29 Mar 1999 20:21:48
> +0300, Costis Angelis <loulou@ltt.ntua.gr> says...
> >

[snip quote]

> all
> > wrong of course.
>

[snip quote]

> reverses the
> order of the bytes in a string, not the order of bits.
>
> "In scalar context, concatenates the elements of LIST, and returns a
> string value consisting of those bytes, but in the opposite order."
>
> As Jonathan Feinberg responded, unpack() and pack() have the needed
> capabilities ('b' and 'B' formats).
>

My mistake was not that I did not check the documentation for reverse, which
I did and had done too recently anyway, but not paying too much attention to
the original post about reversing bits and not bytes.
I don't know which is worse, but in either case my apologies to the original
poster for any confusion provoked. (And thank you for correcting me).

Whatever,

Costis.
(And imagine I was just trying to be helpful and was glad to find something I
just might be able to answer).
----
cangelis@hpc.ntua.gr  <-- cangelis@hpc.ntua.gr
loulou@ltt.ntua.gr

>
> --
> Larry Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com



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

Date: Tue, 30 Mar 1999 08:38:37 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: reading from/writing to Usenet w/ Perl
Message-Id: <370089b5.1539397@news.dircon.co.uk>

On Mon, 29 Mar 1999 22:01:42 GMT, 75474.133@compuserve.com (Ray)
wrote:

>Hello again,
>
>Yes, I've searched the FAQ's, but have not found what I'm specifically
>looking for.
>
>I want to learn (in as simple terms as possible) how to:
>
>     1. collect a list of headers from a particular usenet group
>     2. download the bodies for selected headers
>     3. post to a particular group
>
>What I specifically DO NOT WANT is a ready-to-use module --

<snip>
>                                                          . In other words,
>once I have:
>
>	$nntpservername
>	$newsgroup
>	$messageheader
>
>.... where do I go from there?
>

You go straight to :

http://www.rfc-editor.org/rfc/rfc977.txt

And read about the NNTP protocol.  If you cant get your head round
that then I would suggest making your way straight to CPAN.

As it happens NNTP is a relatively simple protocol.  You can try it
out by telnetting to port 119 on your favourite newsserver and typing
LIST^J^J

The RFC has a few example sessions.

/J\


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

Date: Tue, 30 Mar 1999 03:38:31 GMT
From: Charles Howse <chowse@mdcc.edu>
Subject: Re: search and replace
Message-Id: <3700473C.883F95B2@mdcc.edu>

$num="9,876,543";
$num=~s/,//g;
print $num;

cch

Matthew Western wrote:

> I read all that stuff and am even more confused.  I'm a VB programmer not a
> c programmer.
>
> I have "4,654,399,787" in a string.  I want to get rid of the commas so I
> can make it a number and and it together.
>
> Please help?
> Matt



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

Date: 30 Mar 1999 04:10:06 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: search and replace
Message-Id: <922767057.250128@thrush.omix.com>

[posted & mailed]

Matthew Western <matthew_western@hotmail.com> wrote:
: I read all that stuff and am even more confused.  I'm a VB programmer not
: a c programmer.

	Then you'll likely be presently surprised to find Perl a *much* more
	friendly, easier, and downright sane language then VB. :-)

: I have "4,654,399,787" in a string.  I want to get rid of the commas so I
: can make it a number and and it together.

	my $string = "4,654,399,787";  ## Some place to hold our string
	$string =~ s/,//g;             ## Perl's "searchAndReplace()"

	Cutting that "s/,//g" part up a bit, the "s" says "search and
	replace".  The "/"'s are delimit the search and replace patterns, in
	this case the search of "," and the replace of "" (nothing).  the
	"g" is an option that stands for "global", as the default is to only
	find the first match and replace that, not all of them.  This option
	makes it walk the entire line.

	When you get a chance, read over `perldoc perlsyn' and `perldoc
	perlop'.  The book, "Mastering Regular Expressions" will also be of
	great use to you at this stage.

	HTH

-- 
-Zenin (zenin@archive.rhps.org)

        Yah, Emacs is a good OS, but I prefer FreeBSD.


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

Date: 30 Mar 1999 07:06:29 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: search and replace
Message-Id: <slrn7g0tvk.2qt.sholden@pgrad.cs.usyd.edu.au>

Matthew Western <matthew_western@hotmail.com> wrote:
>I read all that stuff and am even more confused.  I'm a VB programmer not a
>c programmer.

Your going to have to learn if you are going to use perl. So spend some
time learning, buy a book, go to a course or whatever. Or use some other
language that you already know. 

This newsgroup doesn't exist to teach you perl. It can help you with 
problems you have learning perl, but you can't ask how to do everything
here...

If you say which bits of the docs confused you someone might be able to help.
>
>I have "4,654,399,787" in a string.  I want to get rid of the commas so I
>can make it a number and and it together.

There are lots of ways to do it, the most obvious is tr - but that's only
obvious if you have a unix background which you don't. 

I have to leave now, so I don't have time to explain tr, but the docs
explain it very well. 

perldoc perlop - skip down to a line containing
tr/SEARCHLIST/REPLACEMENTLIST/cds and go from there...

-- 
Sam

I would like to tell you that Perl is simple in its complexity. But some
people won't understand that. So pretend I didn't say that, unless you
do.   --Larry Wall


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

Date: Tue, 30 Mar 1999 03:49:36 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Use of uninitialized value at ... why?
Message-Id: <37004BCC.4D7AB53D@home.com>

[posted & mailed]

Matthew Amster-Burton wrote:
> 
> On Mon, 29 Mar 1999, Federico Abascal wrote:
> 
> > Hello, Does anybody know why this code
> 
> There's a lot of trouble here.  Let's have a look.
> 
> >     my($buffer) = "";
> 
> my $buffer;
> 
> Putting parentheses around $buffer puts it into array context, which 
                                                  ^^^^^^^^^^^^^
List context.

> is not what you want.  And assigning it the empty string is redundant.

It might be unnecessary in this case but it is not redundant.  There is
a difference between a defined value and an undefined one.

> >     my($someVariable) = "";
> >     my($inputFile)=$ARGV[0];
> 
> The usual way to write this is:
> 
> my $inputFile = shift;

That's OWTDI.  I don't know that it's the _usual_ way, though.

> 
> >     local(*iFhandle);
> 
> Why are you localizing this?  It's probably not what you want.

Perhaps it was an excerpt from a subroutine.  It might be what he wants.

> >     open(iFhandle, $inputFile);
> 
> Test the open and use upper-case names for filehandles.
> 
> open IFHANDLE, $inputFile or die "Couldn't open $inputFile: $!";

The best advice, by far.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Tue, 30 Mar 1999 09:46:10 +0100
From: Federico Abascal <fabascal@gredos.cnb.uam.es>
Subject: Re: Use of uninitialized value at ... why?
Message-Id: <37008F51.A1B97C9E@gredos.cnb.uam.es>

Matthew Amster-Burton wrote:

> On Mon, 29 Mar 1999, Federico Abascal wrote:
>

> >     my($someVariable) = "";
> >     my($inputFile)=$ARGV[0];
>
> The usual way to write this is:
>
> my $inputFile = shift;
>
>

So,
        my($var1, $var2, $var3);
isn't correct?


> > "perl -w" says "Use of uninitialized value at iss.pl line xxxx (the one
> > of eof()), <iFhandle> chunk 2."??
>
> Probably because you didn't test the open.

I have tested the the open, but it I don't know why continues getting me the
warning I talk about.

Thanks,
Federico



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

Date: Mon, 29 Mar 1999 23:46:55 -0500
From: ssmieja@execpc.com
Subject: Re: Why do we like Perl?
Message-Id: <7dpoir$eb2@newsops.execpc.com>

See Article <news:37000F0C.D4048634@mail.cor.epa.gov>,
which "David L. Cassell" wrote

I have been programming for over 25 years (egads!) and Perl is the first in
a long time I have found truly useful.

The appeal for me is the ability to handle unstructured data which I do a
lot of.  Pattern matching is at the core of Perl and it is the most
difficult to master (which is why O'Reilly sells a separate book on regular
expressions).

So to the originator of this thread, the type of personality that Perl
appeals to is one who see the non-obvious patterns in the data.  The type
of pattern that can be elegantly expressed by a single, very cryptic,
regular expression instead of a page or two of if then else combinations.

-Scott Smieja
ssmieja @ execpc.com


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

Date: Tue, 30 Mar 1999 05:18:23 GMT
From: ComputerShoppe@mediaone.net (Christopher Spence)
Subject: Win32::FileSecurity
Message-Id: <37015e95.1040421@nntp.ne.mediaone.net>

Anyone see anything wrong with this?  I cannot get it to add FULL
ACCESS, it seems to want to only add "SPECIAL"
This is in a while loop that parses a userlist

	# Call Win32::FileSecurity Module
	use Win32::FileSecurity qw(Set MakeMask);
	
	# Create Full Access Mask
	$FullAccessMask = MakeMask("FULL");
	
	$hash{Administrator}   = $FullAccessMask;
	$hash{$_} 	       = $FullAccessMask;
	Set($HomeDirectory, \%hash);
	
	# delete user from hash
	delete $hash{$_};


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

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 5255
**************************************

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