Re: getting values from a called subroutine

2001-05-09 Thread Adam Theo

to mr meltzer, mr cline, and mr mccoy of the [EMAIL PROTECTED] list:

Thank You!!! that was it! i remember looking at return function
before, briefly, but for some reason had thought it was only for
working within control loops... please, don't ask me why, it seems
stupid to me, too, now...

but yep, that was it. in fact, that was the final piece of the
puzzle... thanks to you you guys, my program is now running with all
the basic functions i wanted in it (more will come in later releases,
i'm sure), and without any errors. it isn't pretty. in fact, it could
be called down right ugly (both the interface and the code), but after
a couple of months pulling my hair out over a problem, solving it,
then only to come accross another, it can wait a little while...

woo-hoo! break out the champaigne, slice up the tallcake, and watch the
female dancers pop out of it (maybe not in that order, though).

-- 
   /\--- Adam Theo ---
  //\\   Theoretic Solutions (www.Theoretic.com)
 /\ Software, Politics, and Advocacy
/--||--\ email: [EMAIL PROTECTED]   AIM: Adam Theo 2000
   ||jabber: [EMAIL PROTECTED]   ICQ: 3617306
   ||  Did you ever get the feeling the world was a tuxedo,
   || and you were a pair of brown shoes?



Re: beginner here - with basic cgi trouble

2001-05-09 Thread Brett W. McCoy

On Tue, 8 May 2001, Chip Wiegand wrote:

 - server log -
 [error](2)No such file or directory. exec of /usr/local/apache/cgi-bin/
   formparser.cgi failed
 [error][192.168.1.8] Premature end of script headers: /usr/local/apache/
   cgi-bin/formparser.cgi
 - I see the file DOES exist as formparser.cgi in the directory path shown
 in the errors.
 - I run perl -c formparser.cgi and get the response Syntax OK

It seems to me that the problem isn't that it can't find formparser.cgi,
but there is some other file that formparser.cgi depends on to run that
can't be found (the perl executable perhaps?).  Checking the syntax isn't
enough -- you need to see if the program will *run*.  If it's executable,
you should be able to at least do ./formparser.cgi and see where it's
failing.

-- Brett
   http://www.chapelperilous.net/btfwk/

Gibble, Gobble, we ACCEPT YOU ...




Re: Regexp: Grouping and replacing with an unknown number of groups

2001-05-09 Thread Craig Moynes/Markham/IBM

Thanks,
I know there are plenty of wonderful Date manipulators (Date::Calc would
simply my life unimaginably) but I am still waiting to hear back from our
Legal Dept. regarding the use of the modules.  I know that I should be
allowed to use them considering the modules found as part of perl often
come from CPAN anyways yet I am stuck in the mud of bureaucracy. :)


-
Craig Moynes
Internship Student
netCC Development
IBM Global Services, Canada
Tel: (905) 316-3486
[EMAIL PROTECTED]



   

Matt Cauthorn  

mattcauth@yah   To: [EMAIL PROTECTED]

oo.com  cc:   

 Subject: Re: Regexp: Grouping and 
replacing with an unknown number of 
05/08/01 09:38groups   

PM 

   

   




Not sure if this will help you at this point, but I strongly recommend the
Date::Manip module for anything involving parsing dates. It does everything
you can
imagine with dates and more. Tell it to parse your dates, and boom you can
print
them however you want, get differences, etc. There are plenty of other date
mods on
CPAN as well, but I've used Date::Manip and can say that it is awesome.
Check it
out.


--- Craig Moynes/Markham/IBM [EMAIL PROTECTED] wrote:
 Continuing with the problems for my 'date formatting' script.

 I am reading in a complete record from a logfile.  I check to see if the
 regexp matches to something inside the record.
 Then I want to find the what each grouped mini-regexp matched up with in
 the monster one at the bottom of the email.

 The number of mini-regexp differs depending on the date format line the
 user enters.  So i find out how make keys there are (thus the number of
 mini-regexps)
 and try to construct a string that will print out whatever the
mini-regexp
 matched up with.  But of course it doesn't work ;)

 snip
 $completeRec = [Wed Aug  2 16:00:02 2000] [notice] caught SIGTERM,
 shutting down;
  my $numOfKeys = keys %{$self-{DF_TOKENS}};
 for ( $counter = 1; $counter  $numOfKeys; $counter++)
 {
  $replaceString.=\$$counter ;
 }
 my $values = $completeRec;

 $values =~ s/.*$self-{DF_REGEXP}.*/$replaceString/g;
 print $values\n;

 code done

 Where $self-{DF_REGEXP} = something like :
 (?-xism:((?-xism:Mon|Tue|Wed|Thu|Fri|Sat|Sun))) (?-xism:((?
 -xism:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))) (?-xism:((?
-xism:
 [ ][1-9]|[1-2][0-9]|3[0-1]))) (?-xism:((?-xism:[01][0-9]|2[0-3]))):(?
-xism:
 ((?-xism:[0-5][0-9]))):(?-xism:((?-xism:[0-5][0-9]))) (?-xism:((?
 -xism:[0-9]{4})))


 This prints out something like:
 $1 $2 $3 $4 $5

 for each record.  Which is not to useful ;)

 However if I change the $replaceString to $1 $2 $3 etc it works
 perfectly.
 So what are my options guys and gals ?


 -
 Craig Moynes
 Internship Student
 netCC Development
 IBM Global Services, Canada
 Tel: (905) 316-3486
 [EMAIL PROTECTED]




__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/







Re: beginner here - with basic cgi trouble

2001-05-09 Thread Phillip Bruce

Brett W. McCoy wrote:
 
 On Tue, 8 May 2001, Chip Wiegand wrote:
 
  - server log -
  [error](2)No such file or directory. exec of /usr/local/apache/cgi-bin/
formparser.cgi failed
  [error][192.168.1.8] Premature end of script headers: /usr/local/apache/
cgi-bin/formparser.cgi
  - I see the file DOES exist as formparser.cgi in the directory path shown
  in the errors.
  - I run perl -c formparser.cgi and get the response Syntax OK
 
 It seems to me that the problem isn't that it can't find formparser.cgi,
 but there is some other file that formparser.cgi depends on to run that
 can't be found (the perl executable perhaps?).  Checking the syntax isn't
 enough -- you need to see if the program will *run*.  If it's executable,
 you should be able to at least do ./formparser.cgi and see where it's
 failing.
 
 -- Brett
http://www.chapelperilous.net/btfwk/
 
 Gibble, Gobble, we ACCEPT YOU ...
Chip,

  Briet is right. But also do perl -d ./formpargser.cgi  that
will put you in
  debug state and should bring up a prompt. See below:


Loading DB routines from perl5db.pl version 1.0402
Emacs support available.

Enter h or `h h' for help.

main::(suggestion.cgi:6):   $mailprog =
'/usr/lib/sendmail';
  DB1 

The DB1 is a prompt and by type and N means to step thru the
code watch it execute.
That may also help trouble shoot the problem further.

-- 

*** Phillip B. Bruce ***
*** http://pbbruce.home.mindspring.com   ***
*** [EMAIL PROTECTED]   ***
***  ***
*** Have you ever noticed? Anybody going slower than***
*** you is an idiot, and anyone going faster than you*** 
*** is a maniac. - George Carlin***




IDE for perl?

2001-05-09 Thread Rod Suter

I'm using perl through emacs, but I want to bring along some people on NT4.0.  They're 
accustomed to Visual Studio, and want IDE features, such as project directories, 
global search and replace, debugger linking, source code error hilighting, etc. Can 
anyone suggest a good group environment for developing perl? My first urge is to set 
up Ultra-Edit with some appropriate customization.



Re: IDE for perl?

2001-05-09 Thread Joe Yates

At 10:19 AM 09-05-01 -0400, Rod Suter wrote:
I'm using perl through emacs, but I want to bring along some people on 
NT4.0.  They're accustomed to Visual Studio, and want IDE features, such 
as project directories, global search and replace, debugger linking, 
source code error hilighting, etc. Can anyone suggest a good group 
environment for developing perl? My first urge is to set up Ultra-Edit 
with some appropriate customization.

EditPlus is very good.

Joe Yates




RE: IDE for perl?

2001-05-09 Thread Gilger.John

ActiveState Komodo is nice for those needing an IDE -
http://www.ActiveState.com. 
I prefer Emacs and use it at home, but I work in a M$ shop. 

John Gilger
Technical Writer
Acres Gaming, Inc.
702.914.5585



-Original Message-
From: Rod Suter [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 07:19 AM
To: [EMAIL PROTECTED]
Subject: IDE for perl?


I'm using perl through emacs, but I want to bring along some people on
NT4.0.  They're accustomed to Visual Studio, and want IDE features, such as
project directories, global search and replace, debugger linking, source
code error hilighting, etc. Can anyone suggest a good group environment for
developing perl? My first urge is to set up Ultra-Edit with some appropriate
customization.



gzip or Compress::Zlib

2001-05-09 Thread Kailash . Subramanian




Hello,
 Can somebody advice on whether to use UNIX gzip or the perl Compress::Zlib
for compressing a tar file. If it is going to be Compress::Zlib, I would
appreciate if somebody can give me a basic syntax.

Thx
Kailash





Re: gzip or Compress::Zlib

2001-05-09 Thread Kevin Meltzer

Hi Kailash,

If you are doing the compression from with a Perl script, use Archive::Tar
(which uses Compress::Zlib in the background). After installing the modules,
use the following commands to see their documentation (which will give you the
basic syntax):

perldoc Archive::Tar
perldoc Compress::Zlib

Cheers,
Kevin

On Wed, May 09, 2001 at 12:23:16PM -0400, [EMAIL PROTECTED] 
([EMAIL PROTECTED]) spew-ed forth:
 
 
 
 Hello,
  Can somebody advice on whether to use UNIX gzip or the perl Compress::Zlib
 for compressing a tar file. If it is going to be Compress::Zlib, I would
 appreciate if somebody can give me a basic syntax.
 
 Thx
 Kailash
 
 

-- 
[Writing CGI Applications with Perl - http://perlcgi-book.com]
Never laugh at a live dragon.
-- The Hobbit



Re: gzip or Compress::Zlib

2001-05-09 Thread Kailash Subramanian




Hi Kevin,
  Thanks for your info. Somebody in this mailing list
previously told me to use UNIX tar utility rather than Archive::Tar.
So, I decided to use UNIX tar. But now I want to compress the tar file
and that's the reason for this question. But it looks like you are
suggesting to use perl Archive::Tar utility to tar the files. Can I
not just use the Compress utility of perl without Archive::Tar if it
is better that UNIX gzip ?

Thx
Kailash



From: [EMAIL PROTECTED] AT INTERNET on 05/09/2001 12:23 PM

To:   Kailash Subramanian/ATL/ALLTELCORP
cc:   [EMAIL PROTECTED] AT INTERNET@CCMAIL

Subject:  Re: gzip or Compress::Zlib


Hi Kailash,

If you are doing the compression from with a Perl script, use
Archive::Tar
(which uses Compress::Zlib in the background). After installing the
modules,
use the following commands to see their documentation (which will give
you the
basic syntax):

perldoc Archive::Tar
perldoc Compress::Zlib

Cheers,
Kevin

On Wed, May 09, 2001 at 12:23:16PM -0400,
[EMAIL PROTECTED] (Kailas
[EMAIL PROTECTED]) spew-ed forth:



 Hello,
  Can somebody advice on whether to use UNIX gzip or the perl
Compress::Zli
b
 for compressing a tar file. If it is going to be Compress::Zlib, I
would
 appreciate if somebody can give me a basic syntax.

 Thx
 Kailash



--
[Writing CGI Applications with Perl - http://perlcgi-book.com]
Never laugh at a live dragon.
 -- The Hobbit








Re: Process a single field file

2001-05-09 Thread Peter Scott

At 05:49 PM 5/9/01 +1000, you wrote:
Hi very new to perl... am getting some books asap.

Looks like Lincoln Stein's Network Programming with Perl would be apposite...

I am writing a script to create named.conf records from  a single field 
text file

eg, domain.fle
domain1.com
domain2.net
domain3.org

and then create a named.conf entry from;

$namedconf=/etc/namedb/named.conf ;
$namednow=/etc/namedb/named.conf.$now ;
$namedtmp=/etc/namedb/named.conf.tmp ;

unless (-e $namedconf) { die $namedconf does not exist! }

You'll probably want to put a \n in that die.

open (NAMEDNOW,  $namednow) || die Cannot open $namedtmp for 
writing\n\n ;

Er, the file in the die is not the same as the one in the open...

open (NAMED, $namedconf) || die Cannot open $namedconf for reading\n\n ;
Lock::wlock(NAMED);

while (NAMED) {
if ((/nextprimary/)  ($domaintype eq primary)) {
print NAMEDNOW ENUF;

zone $domainname {
 type master;
 allow-query { any; } ;
 file zones/$domainname;
};

ENUF

Newbie please be gentle...

You're asking for a critique?  The above code is incomplete, so that's hard 
to do.  I don't see a -w/use warnings or use strict in there, so those 
would be essential to add.  Also, the script at least as it appeared to me 
didn't have indentation inside blocks; pretty code layout is far more 
important than most people think.

Otherwise, style and usage are fine.  I'm not familiar with the Lock module 
you appear to be using, and I don't see it on CPAN.

--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com




Re: gzip or Compress::Zlib

2001-05-09 Thread [EMAIL PROTECTED]

I won't comment on what is 'better'. I like using the Perl modules, that is
what they are there for (and I have never had any problems). If you want to
know if you can use Compress::Zlib, please read the documentation which comes
with it and see if it fits your needs. I suggest you do that with all your
options, see how they fit into what you wish to do.. benchmark if you need to,
and form your own educated opinion to what way is 'better' for your project.

Cheers,
Kevin

On Wed, May 09, 2001 at 11:38:00AM -0500, Kailash Subramanian 
([EMAIL PROTECTED]) spew-ed forth:
 
 
 
 Hi Kevin,
   Thanks for your info. Somebody in this mailing list
 previously told me to use UNIX tar utility rather than Archive::Tar.
 So, I decided to use UNIX tar. But now I want to compress the tar file
 and that's the reason for this question. But it looks like you are
 suggesting to use perl Archive::Tar utility to tar the files. Can I
 not just use the Compress utility of perl without Archive::Tar if it
 is better that UNIX gzip ?
 
 Thx
 Kailash
 
 
 
 From: [EMAIL PROTECTED] AT INTERNET on 05/09/2001 12:23 PM
 
 To:   Kailash Subramanian/ATL/ALLTELCORP
 cc:   [EMAIL PROTECTED] AT INTERNET@CCMAIL
 
 Subject:  Re: gzip or Compress::Zlib
 
 
 Hi Kailash,
 
 If you are doing the compression from with a Perl script, use
 Archive::Tar
 (which uses Compress::Zlib in the background). After installing the
 modules,
 use the following commands to see their documentation (which will give
 you the
 basic syntax):
 
 perldoc Archive::Tar
 perldoc Compress::Zlib
 
 Cheers,
 Kevin
 
 On Wed, May 09, 2001 at 12:23:16PM -0400,
 [EMAIL PROTECTED] (Kailas
 [EMAIL PROTECTED]) spew-ed forth:
 
 
 
  Hello,
   Can somebody advice on whether to use UNIX gzip or the perl
 Compress::Zli
 b
  for compressing a tar file. If it is going to be Compress::Zlib, I
 would
  appreciate if somebody can give me a basic syntax.
 
  Thx
  Kailash
 
 
 
 --
 [Writing CGI Applications with Perl - http://perlcgi-book.com]
 Never laugh at a live dragon.
  -- The Hobbit
 
 
 
 
 

-- 
[Writing CGI Applications with Perl - http://perlcgi-book.com]
Number one ain't you... You ain't even number two.
-- Frank Zappa



RE: IDE for perl?

2001-05-09 Thread Peter Scott

At 10:41 AM 5/9/01 -0600, blowther wrote:
I recommend wscite when I teach perl classes.  The code highlighting is
pretty good.  No inline debugger tho.  We use ptkdb for graphical debugging.
--all of these are free.--

I think it's pretty clear, given the requirement for project directories, 
and group environment, that the poster should take a look at  Activestate 
Visual Perl (http://aspn.activestate.com/ASPN/Downloads/VisualPerl/), since 
it allows Visual Studio to provide those features.  Since it sounds as 
though money's available, they may want to check out their ASPN Perl 
package also (http://www.activestate.com/Products/Productivity/ASPN_Perl/).

Disclaimer: I don't work for ActiveState.

-Original Message-
From: Rod Suter [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 8:19 AM
To: [EMAIL PROTECTED]
Subject: IDE for perl?


I'm using perl through emacs, but I want to bring along some people on
NT4.0.  They're accustomed to Visual Studio, and want IDE features, such as
project directories, global search and replace, debugger linking, source
code error hilighting, etc. Can anyone suggest a good group environment for
developing perl? My first urge is to set up Ultra-Edit with some appropriate
customization.

--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com




mv'ing a file from within perl (w/out /bin/mv)

2001-05-09 Thread Shawn

I just want an efficient mv subroutine or module which has such a thing,
but none of the File::* things seem to have mv.

I would rather not shell out 1 times just to, in the vast majority
of cases, move a file from on dir to another in the same fs.

Can someone help?

--
Hob Goblin
[EMAIL PROTECTED]

... the establishment defends itself by complicating everything to the point of 
incomprehensibility.
- Sir Fred Hoyle 



RE: IDE for perl?

2001-05-09 Thread blowther

I think it's pretty clear, given that the poster is asking for feedback that
they are looking for options.

Disclaimer: I don't work for free.

-Original Message-
From: Peter Scott [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 10:53 AM
To: [EMAIL PROTECTED]
Subject: RE: IDE for perl?


At 10:41 AM 5/9/01 -0600, blowther wrote:
I recommend wscite when I teach perl classes.  The code highlighting is
pretty good.  No inline debugger tho.  We use ptkdb for graphical
debugging.
--all of these are free.--

I think it's pretty clear, given the requirement for project directories, 
and group environment, that the poster should take a look at  Activestate 
Visual Perl (http://aspn.activestate.com/ASPN/Downloads/VisualPerl/), since 
it allows Visual Studio to provide those features.  Since it sounds as 
though money's available, they may want to check out their ASPN Perl 
package also (http://www.activestate.com/Products/Productivity/ASPN_Perl/).

Disclaimer: I don't work for ActiveState.

-Original Message-
From: Rod Suter [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 8:19 AM
To: [EMAIL PROTECTED]
Subject: IDE for perl?


I'm using perl through emacs, but I want to bring along some people on
NT4.0.  They're accustomed to Visual Studio, and want IDE features, such as
project directories, global search and replace, debugger linking, source
code error hilighting, etc. Can anyone suggest a good group environment for
developing perl? My first urge is to set up Ultra-Edit with some
appropriate
customization.

--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com



Loading extra modules.

2001-05-09 Thread Tirthankar C.P



Folks, how do I load extra modules? I got Date::Manip today, and I know I
should be putting it in the search-path of perl (@INC ?), but how do I do
it? Can I get a small code snippet? 

I do not have su privileges on the machine I work, and would like the
search-path to have my modules dir, $HOME/perlmodules in it. 

TIA, 
-tir




Re: mv'ing a file from within perl (w/out /bin/mv)

2001-05-09 Thread Timothy Kimball


: I just want an efficient mv subroutine or module which has such a thing,
: but none of the File::* things seem to have mv.

perldoc -f rename

-- tdk



Re: mv'ing a file from within perl (w/out /bin/mv)

2001-05-09 Thread Peter Scott

At 12:13 PM 5/9/01 -0500, Shawn wrote:
I just want an efficient mv subroutine or module which has such a thing,
but none of the File::* things seem to have mv.

I would rather not shell out 1 times just to, in the vast majority
of cases, move a file from on dir to another in the same fs.

Can someone help?

% perldoc -f rename

rename OLDNAME,NEWNAME
Changes the name of a file; an existing file
NEWNAME will be clobbered.  Returns true for
success, false otherwise.

Behavior of this function varies wildly depending
on your system implementation.  For example, it
will usually not work across file system
boundaries, even though the system mv command
sometimes compensates for this.  Other
restrictions include whether it works on
directories, open files, or pre-existing files.
Check the perlport manpage and either the
rename(2) manpage or equivalent system
documentation for details.

--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com




RE: Loading extra modules.

2001-05-09 Thread blowther

If you got it in a tar'ed package, it will come with a Makefile.PL script.
The general procedure is:

perl Makefile.PL
make test
make install {su'ed to root}


If you didn't get the tar'ed package, and just have .pm, then I would
recommend getting the tar'ed package instead.  This would vary somewhat if
you're on a Windows NT box.

-Original Message-
From: Tirthankar C.P [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 11:44 AM
To: [EMAIL PROTECTED]
Subject: Loading extra modules.




Folks, how do I load extra modules? I got Date::Manip today, and I know I
should be putting it in the search-path of perl (@INC ?), but how do I do
it? Can I get a small code snippet? 

I do not have su privileges on the machine I work, and would like the
search-path to have my modules dir, $HOME/perlmodules in it. 

TIA, 
-tir



Re: Loading extra modules.

2001-05-09 Thread Brett W. McCoy

On Wed, 9 May 2001, Tirthankar C.P wrote:

 Folks, how do I load extra modules? I got Date::Manip today, and I know I
 should be putting it in the search-path of perl (@INC ?), but how do I do
 it? Can I get a small code snippet?

 I do not have su privileges on the machine I work, and would like the
 search-path to have my modules dir, $HOME/perlmodules in it.

Be careful -- you can't just move modules into a directory and expect them
to work, since some depend on loading native code shared libraries.

If you have a module you want to use, you can do something like:

use lib '/path/to/modules'; #MyModule.pm is in this directory

use MyModule;

-- Brett
   http://www.chapelperilous.net/btfwk/

Before destruction a man's heart is haughty, but humility goes before honour.
-- Psalms 18:12





Very beginner question

2001-05-09 Thread ODoisnea

I feel strange putting such a simple question on this list, but then
again, that is why I did not join the experts list.

Any how, if I have a file called try.txt with the following line:

(name = john)

if I am trying to just extract john for the value $b, why would the
following script not work.  I thought it would take bothIt returns the
full (name=john)

#!user/local/bin/perl -w

open TRY , try.txt;

while (TRY) {
(my $b=$_) =~ s/^(\() (\w+)/$2/;
print $b;
}


Thank you for humiliating me with this simple question.

Olivier
The one who still has a long way to go with Perl



Re: Very beginner question

2001-05-09 Thread Jeff Pinyan

On May 9, [EMAIL PROTECTED] said:

(name = john)

if I am trying to just extract john for the value $b, why would the
following script not work.  I thought it would take bothIt returns the
full (name=john)

Let's run your regex through the regex explainer:

   (my $b=$_) =~ s/^(\() (\w+)/$2/;

NODE EXPLANATION
--
(?-imsx: group, but do not capture (case-sensitive)
 (with ^ and $ matching normally) (with . not
 matching \n) (matching whitespace and #
 normally):
--
  ^the beginning of the string
--
  (group and capture to \1:
--
\(   '('
--
  )end of \1
--
   ' '
--
  (group and capture to \2:
--
\w+  word characters (a-z, A-Z, 0-9, _) (1 or
 more times (matching the most amount
 possible))
--
  )end of \2
--
)end of grouping
--

You can see that it's matching a '(', and then a ' '.  You don't have a
space after the ( though. :(

Perhaps you want to use:

  while (TRY) {
my ($name) = /^\(\w+ = (\w+)\)$/;
print got: $name\n;
  }

That regex matches the (, and then some word, then  = , and then saves
the next word it finds.

-- 
Jeff japhy Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
Are you a Monk?  http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734




newbie: CPAN module usage.

2001-05-09 Thread SS HK

Hi,

I would like to install some of the CPAN modules. How
can I do that. I am using ActivePerl on Windows.

Any pointers would be greatly helpful. 

regards,
inssic.

__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



Re: Loading extra modules.

2001-05-09 Thread Tirthankar C.P



 
 Be careful -- you can't just move modules into a directory and expect them
 to work, since some depend on loading native code shared libraries.

Brett was right. I tried installing it, but wasn't successful. I then got
the Sys Admin folks to install it, and it went just fine!! 

Apparently, even if I give PREFIX= as a command line param, you get the
following errors: 



Manifying blib/man3/Date::Manip.3 Skipping
/home/tir/COMP/perl/modules/lib/site_perl/5.005/Date/Manip.pm (unchanged)
Skipping /home/tir/COMP/perl/modules/lib/site_perl/5.005/Date/Manip.pod
(unchanged) Installing
/home/tir/COMP/perl/modules/lib/site_perl/5.005/Date/lib/perl5/site_perl/5.005/Date/Manip.pm

Installing
/home/tir/COMP/perl/modules/lib/site_perl/5.005/Date/lib/perl5/site_perl/5.005/Date/Manip.pod
Installing


/home/tir/COMP/perl/modules/lib/site_perl/5.005/perl5/site_perl/5.005/i386-linux/auto/Date/Manip/.packlist

Skipping /home/tir/COMP/perl/modules/lib/perl5/man/man3/Date::Manip.3
(unchanged) Installing
/home/tir/COMP/perl/modules/lib/perl5/man/man3/lib/perl5/man/man3/Date::Manip.3
Writing
/home/tir/COMP/perl/modules//lib/site_perl/5.005/i386-linux/auto/Date/Manip/.packlist
/bin/sh:
/home/tir/COMP/perl/modules//lib/5.00503/i386-linux/perllocal.pod: No such
file or directory make: [doc_site_install] Error 1 (ignored)
Appending installation info to
/home/tir/COMP/perl/modules//lib/5.00503/i386-linux/perllocal.pod   


I don't know what to make of this!!
Thanks anyway, 
-tir




Re: newbie: CPAN module usage.

2001-05-09 Thread Steve Neu

Brett...

Try 'ppm' at the command line.
___
C:\WINNT\Profiles\sneu\Desktopppm
PPM interactive shell (2.1.2) - type 'help' for available commands.
PPM
Commands:
exit  - leave the program.
help [command]- prints this screen, or help on 'command'.
install PACKAGES  - installs specified PACKAGES.
quit  - leave the program.
query [options]   - query information about installed packages.
remove PACKAGES   - removes the specified PACKAGES from the system.
search [options]  - search information about available packages.
set [options] - set/display current options.
verify [options]  - verifies current install is up to date.
version   - displays PPM version number

PPM


Stephen Neu
Internet Development
Characterlink.net
(630) 323-9800 ext. 235

The camel was not designed to smell good. Neither was Perl.
 --Larry Wall

- Original Message - 
From: SS HK [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 09, 2001 12:09 PM
Subject: newbie: CPAN module usage.


 Hi,
 
 I would like to install some of the CPAN modules. How
 can I do that. I am using ActivePerl on Windows.
 
 Any pointers would be greatly helpful. 
 
 regards,
 inssic.
 
 __
 Do You Yahoo!?
 Yahoo! Auctions - buy the things you want at great prices
 http://auctions.yahoo.com/
 




Re: newbie: CPAN module usage.

2001-05-09 Thread Brett W. McCoy

On Wed, 9 May 2001, SS HK wrote:

 I would like to install some of the CPAN modules. How
 can I do that. I am using ActivePerl on Windows.

You will need a C compiler in most cases.  However, ActiveState has a lot
of CPAN modules packaged via their PPM facility.  You should consult their
documentation on how to use it.

-- Brett
   http://www.chapelperilous.net/btfwk/

Calm down, it's *only* ones and zeroes.




Re: newbie: CPAN module usage.

2001-05-09 Thread Steve Neu

Brett...

Try 'ppm' at the command line.
___
C:\WINNT\Profiles\sneu\Desktopppm
PPM interactive shell (2.1.2) - type 'help' for available commands.
PPM
Commands:
exit  - leave the program.
help [command]- prints this screen, or help on 'command'.
install PACKAGES  - installs specified PACKAGES.
quit  - leave the program.
query [options]   - query information about installed packages.
remove PACKAGES   - removes the specified PACKAGES from the system.
search [options]  - search information about available packages.
set [options] - set/display current options.
verify [options]  - verifies current install is up to date.
version   - displays PPM version number

PPM


Stephen Neu
Internet Development
Characterlink.net
(630) 323-9800 ext. 235

The camel was not designed to smell good. Neither was Perl.
 --Larry Wall

- Original Message - 
From: SS HK [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 09, 2001 12:09 PM
Subject: newbie: CPAN module usage.


 Hi,
 
 I would like to install some of the CPAN modules. How
 can I do that. I am using ActivePerl on Windows.
 
 Any pointers would be greatly helpful. 
 
 regards,
 inssic.
 
 __
 Do You Yahoo!?
 Yahoo! Auctions - buy the things you want at great prices
 http://auctions.yahoo.com/
 




Re: newbie: CPAN module usage.

2001-05-09 Thread Steve Neu

Brett...

Try 'ppm' at the command line.
___
C:\WINNT\Profiles\sneu\Desktopppm
PPM interactive shell (2.1.2) - type 'help' for available commands.
PPM
Commands:
exit  - leave the program.
help [command]- prints this screen, or help on 'command'.
install PACKAGES  - installs specified PACKAGES.
quit  - leave the program.
query [options]   - query information about installed packages.
remove PACKAGES   - removes the specified PACKAGES from the system.
search [options]  - search information about available packages.
set [options] - set/display current options.
verify [options]  - verifies current install is up to date.
version   - displays PPM version number

PPM


Stephen Neu
Internet Development
Characterlink.net
(630) 323-9800 ext. 235

The camel was not designed to smell good. Neither was Perl.
 --Larry Wall

- Original Message - 
From: SS HK [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 09, 2001 12:09 PM
Subject: newbie: CPAN module usage.


 Hi,
 
 I would like to install some of the CPAN modules. How
 can I do that. I am using ActivePerl on Windows.
 
 Any pointers would be greatly helpful. 
 
 regards,
 inssic.
 
 __
 Do You Yahoo!?
 Yahoo! Auctions - buy the things you want at great prices
 http://auctions.yahoo.com/
 




RE: Loading extra modules.

2001-05-09 Thread Timothy Kimball


:  perl Makefile.PL
: 
:   make
: 
:  make test
:  make install {su'ed to root}

When you do make test and you haven't done make,
make will be done automatically.

-- tdk



RE: RE: Help with Perl (fwd)

2001-05-09 Thread cbourne

Somebody please help me uderstand the deal with qq. I have run tests on all three 
lines of code below and it turns out that #1 and #3 work but #2 does not. I am under 
the impression that qq acts as double quotes. So why doesn't #2 work isn't it the 
same as #1? NO COMPRENDE!!! Thanks, [EMAIL PROTECTED]


 1.  print qq/I said Help me!!.\n/;

 2.  print I said Help me!!.\n;

 3.  print I said /Help me!!/.\n;




RE: RE: Help with Perl (fwd)

2001-05-09 Thread Jeff Pinyan

On May 9, [EMAIL PROTECTED] said:

Somebody please help me uderstand the deal with qq. I have run tests
on all three lines of code below and it turns out that #1 and #3 work
but #2 does not. I am under the impression that qq acts as double
quotes. So why doesn't #2 work isn't it the same as #1? NO COMPRENDE!!!

 1.  print qq/I said Help me!!.\n/;

 2.  print I said Help me!!.\n;

 3.  print I said /Help me!!/.\n;

#1 works, but #2 and #3 do not.  I think you meant to use \ instead of
/ in #3.

qq() is double-quoted context, but it is a replacement for physical
double-quotes.  By using qq//, it's like / is now your quote.

Just like

  he said hi to me

is invalid, so is

  qq/he said /hi/ to me/

To get that to work, you'd need to backslash the quoting character:

  he said \hi\ to me
  qq/he said \/hi\/ to me/

but that should be a sign that you should've chosen a different character.

Using qq(), qq[], qq{}, or qq allows you to nest the quotes:

  qq(I think (since I'm ill) I won't go to class today.)

-- 
Jeff japhy Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
Are you a Monk?  http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734




Re: Cookies

2001-05-09 Thread Casey West

On Wed, May 09, 2001 at 02:48:54PM -0400, Casey West wrote:
: On Wed, May 09, 2001 at 03:45:40PM -0400, Brian Shoemaker wrote:
: : I'm having trouble getting a script to set a cookie.
: : 
: : It works when I type the URL of the script into the browser and press
: : enter.. it works that's way and a cookie is set.
: : 
: : But when I place that script in a HTML page like this
: : !--#exec cgi=/cgi-bin/test/cookie_get.pl--
: : the cookie won't set.
: : 
: : Is there something special you are supposed to do to set the cookie when
: : executing the script like that?
: 
: You must set the Cookie in the HTTP Headers that get sent first with a
: web page, by using SSI to include your cookie_get.pl, you're too late
: to get the cookies.  If you don't want to write a CGI program for the
: page, you could use JavaScript to handle the Cookies but then you
: limit yourself on usefullness, since you don't really have much access
: to the server side.

I really should try to post to the list. :)

:   Casey West
: 
: -- 
: Shooting yourself in the foot with Internet 
: You put your foot in your mouth, shoot it, then spam the bullet so
: that everybody gets shot in the foot. 

  Casey West

-- 
If unix is the face of the future I wanna go back to quill pens. 
 -- Joseph Snipp



RE: newbie: CPAN module usage.

2001-05-09 Thread King, Jason

SS HK writes ..

I would like to install some of the CPAN modules. How
can I do that. I am using ActivePerl on Windows.

Any pointers would be greatly helpful. 


while others have mentioned 'ppm' which should be your first port of call ..
there are only a limited number of modules (albeit the commonly used ones)
that have been made available via ppm

so .. if you need to grab a module from CPAN then you will need nmake.exe
for building the modules .. in some instances you will also need a C
compiler

nmake comes with Microsoft Visual C++ .. which also has nmake .. so if you
have access to that then install it

otherwise .. you can get a free version of nmake from Microsoft .. which
will mean that you will not be able to install any modules that require
compilation .. but you can install pure Perl modules (which accounts for a
fairly high proportion)

I'm not going to tell you where the free nmake is because you'll learn a lot
more than I'm telling you here by reading the ActivePerl documentation -
which also tells you where to find nmake

get to the ActivePerl documentation on your Start  Programs menu .. read
the section of the ActivePerl FAQ entitled Modules  Samples .. and then
read all the rest of the FAQ .. it has all the information you need (one
hint: where it talks about gzip and tar - you can use WinZip for both
untarring and ungzipping the archives)

-- 
  jason king

  In Denmark, if a horse carriage is trying to pass a car and the horse
  gets uneasy, the car is required to pull over and stop. If necessary
  to ease the horse down, you are required to cover the car up. -
  http://dumblaws.com/



RE: Very beginner question

2001-05-09 Thread King, Jason

[EMAIL PROTECTED] writes ..

(name = john)
-
if I am trying to just extract john for the value $b, why would the
following script not work.  I thought it would take bothIt returns the
full (name=john)

#!user/local/bin/perl -w

open TRY , try.txt;

while (TRY) {
   (my $b=$_) =~ s/^(\() (\w+)/$2/;
   print $b;
}


in the name of TMTOWTDI

  while(TRY)
  {
chop( my $name = substr $_, rindex( $_, ' ')+1);
print $name, \n;
  }

but I suspect (from the statement about the output being '(name=john)') that
those spaces might not always be there .. in which case

  while(TRY)
  {
/=\s*(.*)\)/  print $1, \n;
  }

-- 
  jason king

  In Denmark, if a horse carriage is trying to pass a car and the horse
  gets uneasy, the car is required to pull over and stop. If necessary
  to ease the horse down, you are required to cover the car up. -
  http://dumblaws.com/



@INC

2001-05-09 Thread Stephen E. Hargrove

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

how do i add new directories to @INC?  i've managed to bungle one of my
debian systems, and apt-get relies pretty heavily on some .pm's that
aren't in the stock @INC locations.
- -- 
 ) ,_)
(-(__ -|- __
 ) | (/_\/(/_
(
 ___
| mailto : [EMAIL PROTECTED]  |
| linux  : http://exitwound.org |
| mozart : http://mozart.sourceforge.net|
| buck   : http://www.BuckOwensFan.com  |
 ___
| Nothing increases your golf score like|
| witnesses.|
 ___
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6+eynr9c0KwefYXMRAg9LAKCJJErE+lxc5WTVvy/jfZMHzJ4xIACfUIB/
rmG3quvJ/83+UMrp8pFesS8=
=87LP
-END PGP SIGNATURE-




RE: @INC

2001-05-09 Thread Stephen E. Hargrove

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 10 May 2001, King, Jason wrote:

 Stephen E. Hargrove writes ..

 how do i add new directories to @INC?  i've managed to bungle one of my
 debian systems, and apt-get relies pretty heavily on some .pm's that
 aren't in the stock @INC locations.

 there's a hand module called 'lib' that's part of the CORE distribution ..
 it basically just unshifts your list onto the @INC array in a BEGIN block

   use lib qw'/dirs/for /inclusion /in/INC';


doesn't this just make the adjustment at compile time?  what i'm really
needing is something that will modify @INC for all time.  can that be
done?
- -- 
 ) ,_)
(-(__ -|- __
 ) | (/_\/(/_
(
 ___
| mailto : [EMAIL PROTECTED]  |
| linux  : http://exitwound.org |
| mozart : http://mozart.sourceforge.net|
| buck   : http://www.BuckOwensFan.com  |
 ___
| I go on working for the same reason a hen |
| goes on laying eggs. -- H.L. Mencken  |
 ___
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6+fSNr9c0KwefYXMRAjAtAKCEp3TrDOcWtaNyMu8AYaOrxozDWwCePChM
I1/wWd7XBwa+9JpwIDY6Bhg=
=dGAV
-END PGP SIGNATURE-




RE: @INC

2001-05-09 Thread King, Jason

Stephen E. Hargrove writes ..

On Thu, 10 May 2001, King, Jason wrote:

 Stephen E. Hargrove writes ..

 how do i add new directories to @INC?  i've managed to 
bungle one of my
 debian systems, and apt-get relies pretty heavily on some .pm's that
 aren't in the stock @INC locations.

 there's a hand module called 'lib' that's part of the CORE 
distribution ..
 it basically just unshifts your list onto the @INC array in 
a BEGIN block

   use lib qw'/dirs/for /inclusion /in/INC';


doesn't this just make the adjustment at compile time?  what i'm really
needing is something that will modify @INC for all time.  can that be
done?


you need to recompile Perl then .. the directories included in the @INC
array are stored in the perl binary when Perl was originally built .. you
can't change them without rebuilding Perl

if you wanted to avoid hardcoding the @INC directories in every script you
write you could put your own module into one of the @INC directories to be
called by all your programs - and it would - in turn - load the other @INC
directories .. ie. your module might be as follows

  package my_lib;
  use lib qw'/dirs/for /inclusion /in/INC';
  1;

then in all your programs you'd have

  #!perl -w
  use strict;
  use my_lib;

  # .. code ..

  __END__

-- 
  jason king

  In Denmark, if a horse carriage is trying to pass a car and the horse
  gets uneasy, the car is required to pull over and stop. If necessary
  to ease the horse down, you are required to cover the car up. -
  http://dumblaws.com/



RE: @INC

2001-05-09 Thread Jeff Pinyan

On May 9, Stephen E. Hargrove said:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 10 May 2001, King, Jason wrote:

 Stephen E. Hargrove writes ..

 how do i add new directories to @INC?  i've managed to bungle one of my
 debian systems, and apt-get relies pretty heavily on some .pm's that
 aren't in the stock @INC locations.

 there's a hand module called 'lib' that's part of the CORE distribution ..
 it basically just unshifts your list onto the @INC array in a BEGIN block

   use lib qw'/dirs/for /inclusion /in/INC';


doesn't this just make the adjustment at compile time?  what i'm really
needing is something that will modify @INC for all time.  can that be
done?

You can't do it for EVERYTHING unless you recompile Perl.  You can do it
for yourself all the time by setting the PERL5LIB environment variable to
a colon-separated list of directories to add to @INC automatically.

-- 
Jeff japhy Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
Are you a Monk?  http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734




Re: beginner here - with basic cgi trouble

2001-05-09 Thread Brett W. McCoy

On Thu, 10 May 2001, lemoninsz wrote:

 hi,i have the same problem,when i do ./emailupload.cgi,error like this:
 bash: ./emailupload.cgi: No such file or directory

 the other cgi scripts work well,but emailupload.cgi.the following is the 
emailupload.cgi:
 #!/usr/bin/perl
^
Is this the correct path to Perl?

-- Brett
   http://www.chapelperilous.net/btfwk/

Lewis's Law of Travel:
The first piece of luggage out of the chute doesn't belong to anyone,
ever.




Apache

2001-05-09 Thread perl . mail

Hello,

I installed a webserver Apache on my Workstation, the OS is Windows NT4.0
and have a Perl version
5.0.3

My problem is, that I can not execute CGI - SCRIPTS.

I get the error message:

Forbidden
You don't have permission to access /cgi-bin/1st-cgi.pl on this server.

Apache/1.3.12 Server at fn0676.zff.zf-group.de Port 3000

I edit the http.conf file, you can see it:



ThankĀ“s a lot..

Hasan

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See URL:http://www.apache.org/docs/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# After this file is processed, the server will look for and process
# C:/Programme/Apache Group/Apache/conf/srm.conf and then C:/Programme/Apache 
Group/Apache/conf/access.conf
# unless you have overridden these with ResourceConfig and/or
# AccessConfig directives here.
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
# whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with / (or drive:/ for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with /, the value of ServerRoot is prepended -- so logs/foo.log
# with ServerRoot set to /usr/local/apache will be interpreted by the
# server as /usr/local/apache/logs/foo.log.
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., c:/apache instead of c:\apache).
# If a drive letter is omitted, the drive on which Apache.exe is located
# will be used by default.  It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerType is either inetd, or standalone.  Inetd mode is only supported on
# Unix platforms.
#
ServerType standalone

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot C:/Programme/Apache Group/Apache

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile logs/httpd.pid

#
# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this.  But if yours does (you'll know because
# this file will be  created when you run Apache) then you *must* ensure that
# no two invocations of Apache share the same scoreboard file.
#
ScoreBoardFile logs/apache_status

#
# In the standard configuration, the server will process httpd.conf,
# srm.conf, and access.conf in that order.  The latter two files are
# now distributed empty, as it is recommended that all directives
# be kept in a single file for simplicity.  The commented-out values
# below are the built-in defaults.  You can have the server ignore
# these files altogether by using /dev/null (for Unix) or
# nul (for Win32) for the arguments to the directives.
#
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to Off to deactivate.
#
KeepAlive OFF

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We reccomend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# Apache on Win32 always creates one child process to handle requests.  If it
# dies, another child