[10905] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4506 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 28 13:07:19 1998

Date: Mon, 28 Dec 98 10:00:20 -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           Mon, 28 Dec 1998     Volume: 8 Number: 4506

Today's topics:
        A big problem an Medium sized one and an Ickle one. <niall_wallace@yahoo.com>
        C wrappers g00f@mjollnir.org
        Checking for existance of a file (Stephen Benjamin)
    Re: Do I need a web server to practice Perl in my compu <off-duty@entheosengineering.com>
    Re: Equivilent of C's is_alpha() function? <uri@sysarch.com>
        Fixed length Database bug? (Slick!)
    Re: GUI Perl Debugger (Clay Irving)
    Re: How do I...... (Tad McClellan)
    Re: How do I...... (Andrew M. Langmead)
    Re: How to get start ? <gellyfish@btinternet.com>
    Re: Improve speed of a perl-script <uri@sysarch.com>
    Re: Installing modules without PPM (Randy Kobes)
    Re: Installing modules without PPM dturley@pobox.com
    Re: Installing modules without PPM kate_stafford@my-dejanews.com
    Re: Need good, simple regex help/tutorial (Tad McClellan)
    Re: New module Net::RawIP <tripp.lilley@perspex.com>
    Re: Perl on NT - How to run as a daemon process <gellyfish@btinternet.com>
    Re: problem with specific language characters ("v, 	d,| <uri@sysarch.com>
    Re: Retrospective on comp.lang.perl.moderated? (Leslie Mikesell)
    Re: running a perlscript (Tad McClellan)
    Re: Splitting multiple |'s <mcwebber@my-dejanews.com>
    Re: Syntactical weirdness? Or is it just me? <uri@sysarch.com>
    Re: Syntactical weirdness? Or is it just me? (Mark-Jason Dominus)
    Re: Syntactical weirdness? Or is it just me? <dgris@moiraine.dimensional.com>
    Re: Uninitialized value error <tim.hicks@iname.com>
        Using the PGPsdk from within PERL - anybody with experi <peter.strickler@ubs.com>
        When hashing won't work... (Rick Freeman)
    Re: Windows NT Installation problem (Randy Kobes)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 28 Dec 1998 17:50:43 -0000
From: "Wallace" <niall_wallace@yahoo.com>
Subject: A big problem an Medium sized one and an Ickle one.
Message-Id: <768ghg$n4s$1@newnews.global.net.uk>

Hi,

I was wondering if anybody could help me with a problem,

BIG Problem...

I have in 2 strings the values [12/DEC/1998 and +0000].

The first is the date and the second a time zone.

Although the time zone is not needed
I need to remove the [ and ] from both of them for part of my Web Log
Analyser.

I have been un able to think of a way that will work.

The Medium Sized problem

I have a percentage of 1.45343729537057439579749735
But I only want it to store 1.453 in $Percentage.

I know how to print it using Printf but it has to be stored rounded as well.

This then leads on to the ickle problem


The Ickle problem sized problem...

I need to Round a percentage up or down
i.e. 0.5 goes to 1    0.4 goes to 0.

I have tried using Int but that only rounds down.

I need this so that my graphs are more accurate as I want to base them on
one block for 5%.
So far i onlt have it for 1 block = 10%

Tia

Wallace






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

Date: Mon, 28 Dec 1998 17:09:27 GMT
From: g00f@mjollnir.org
Subject: C wrappers
Message-Id: <768e05$q5u$1@nnrp1.dejanews.com>

Greetings Perl People:

Question - if I create a C wrapper for a perl script does this C binary
suck in the perl script before compile so that I can distribute only
the C binary, or do I still need to send out the perl script with it?

Thanks

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


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

Date: Mon, 28 Dec 1998 12:41:23 -0500
From: steve.benjamin@juno.com (Stephen Benjamin)
Subject: Checking for existance of a file
Message-Id: <19981228.124342.-24831.2.Steve.Benjamin@juno.com>

I am writing a program which generates a fairly random number and then
writes to a file by that name.   How can I check to see if that file
already exists or not? Also, how can I delete a file from within perl?


Stephen Benjamin
Steve.Benjamin@juno.com


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

Date: Mon, 28 Dec 1998 10:40:38 -0600
From: Rich Grise <off-duty@entheosengineering.com>
To: Groovy94 <groovy94@aol.com>
Subject: Re: Do I need a web server to practice Perl in my computer?
Message-Id: <3687B486.3AAD@entheosengineering.com>

Groovy94 wrote:
> 
> If you do decide to get a web server, I reccomend Website Pro, from The
[...]
> Gil Hildebrand, Jr.

Depending on how into computers you are, you can get a shrink-wrapped
distribution of Linux that's fairly easy to set up, if you're fairly
computer-literate. It should come with perl and apache. A little 
configuration, and boom! It's a webserver. Like, all the time.

but, like the other guys said, to just learn perl, you don't
need a server. And it's probably best to start out just with
the command line and files and stuff.

Cheers!
-- 
Rich Grise
off-duty@entheosengineering.com
(No need to putz around with my e-mail - I have a "DELETE" button!)


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

Date: 28 Dec 1998 11:41:10 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Equivilent of C's is_alpha() function?
Message-Id: <x7soe0gqxl.fsf@sysarch.com>

>>>>> "GB" == Greg Bacon <gbacon@cs.uah.edu> writes:

  GB> In article <39vhj23ed9.fsf@ibnets.com>, Uri Guttman  <uri@ibnets.com> wrote:

  GB> : why should it? perl has regexes which can do all of the is_*
  GB> functions : and more. see perlre or go to www.perl.com and rtfm.

  GB> Not strictly true.  What is the regular expression equivalent to
  GB> ispunct()?  How about isprint()?

ispunct (may not be accurate but i am asleep) (and non-locale) (is _
punct or word?):

	$char =~ /^[][\-!@#$%^&*()+|~=\\`,.<>/?;:'"{}]+\Z/

or a negative space (us ascii)

	$char !~ /^[^\s\w\x00-\x3f\x7f-\xff]+\Z/
	

isprint (ditto) (this should work for all locales as it uses a negative
space)

	$char !~ /^[^\s\x00-\x3f\x7f-\xff]+\Z/

ok?

all the is* functions are is fast bit mapped char classes so they are
easy to do in regexes. in fact you could write a script to parse ctype.h
and generate the proper char classes for you.

and regexes has a speed advantage as the is* macros/func only work on 
a char at a time while the regexes can do whole strings.

uri

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


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

Date: Mon, 28 Dec 1998 17:46:31 GMT
From: slick@dick.com (Slick!)
Subject: Fixed length Database bug?
Message-Id: <3687c2a1.4068740@news.shreve.net>

When running the following script, the read bombs on "Amy" when trying
to print her age.  It gives the following output:

Use of uninitialized value at G:\DEVSTUFF\perl\learn\fixedb\dbtest.pl
line 44.
FIRST:  Richard 
MIDDLE: W
LAST:   Rowell
AGE:    24

FIRST:  Richard 
MIDDLE: D
LAST:   Rowell
AGE:    51

FIRST:  Amy 
MIDDLE: M
LAST:   Rowell
AGE:    

This is only when Amy's age is set to 26, if I change it to 25, or 27
all works just fine.  I can look at the file created in my hex-editor
and I can see the value 1A (26) in the correct spot.  Is this a perl
bug, or am I missing something?  I'm using Active Perl build 508 under
Win32 (NT4 SP4).  It's not just Amy either, it seems I can't assign a
26 to the database for any of them without the same result....  The
following is the simple script:

open(A,"+>d");

$first="Richard";
$middle="W";
$last="Rowell";
$age=24;
print A pack("A40 A A40 s",$first,$middle,$last,$age);

$first="Richard";
$middle="D";
$last="Rowell";
$age=51;
print A pack("A40 A A40 s",$first,$middle,$last,$age);

$first="Amy";
$middle="M";
$last="Rowell";
$age=26;
print A pack("A40 A A40 s",$first,$middle,$last,$age);

$first="Dozell";
$middle="W";
$last="Rowell";
$age=75;
print A pack("A40 A A40 s",$first,$middle,$last,$age);

$first="Claudy";
$middle="M";
$last="Rowell";
$age=73;
print A pack("A40 A A40 s",$first,$middle,$last,$age);

close(A);

open(A,"+<d");

while(read(A,$buf,83))
{

  ($first,$middle,$last,$age) = unpack("A40 A A40 s",$buf);
  
  print "FIRST:  $first \nMIDDLE: $middle\nLAST:   $last\nAGE:
$age\n\n";
}

close(A);


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

Date: 28 Dec 1998 11:18:47 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: GUI Perl Debugger
Message-Id: <768b17$fjv@panix.com>

In <3686BEF1.48A3C878@gatewest.net> Andrew Johnson <ajohnson@gatewest.net> writes:

>Paul Davies wrote:
>!
>! Does anyone know if there is a windows based perl debugger for Linux?
>! I know Activestate have released one for Microsoft Windows.

>you might want to try out DDD (Data Display Debugger), a graphical
>front end for a few debuggers, perl support is now included:

>    ftp://ftp.ips.cs.tu-bs.de/pub/local/softech/ddd/

>you'll need motif, or LessTif (0.87 or higher). I built it
>using lesstif on my linux box ... looks ok, but I haven't
>done any serious playing with it yet.

Also check:

    http://reference.perl.com/query.cgi?debug

-- 
Clay Irving
clay@panix.com


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

Date: Mon, 28 Dec 1998 08:19:10 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How do I......
Message-Id: <u04867.hqm.ln@magna.metronet.com>

Cool (dusty@hofffmain.com) wrote:

: I have text sitting in file.


   Is it in the Flat Butt font?  ;-)


: What I need to do is delete everything before a certain word. i.e


   See this from Perl FAQ, part 5:

      "How do I change one line in a file/
       delete a line in a file/
       insert a line in the middle of a file/
       append to the beginning of a file?"


: The world is a happening place.

: and I needed to delete everything before "place", how would I go about this.


   Here are two ways:

      $_ = 'The world is a happening place.';
      substr($_, 0, index($_, 'place')) = '';    # substr() as lvalue
      print "$_\n";

      $_ = 'The world is a happening place.';
      s/.*?place/place/;
      print "$_\n";


   But neither of those will work very well if 'place' happens to
   be part of a larger word. For that situation, you could do:

      $_ = 'complacency is a placebo for the placental place.';
      s/.*?\bplace\b/place/;
      print "$_\n";


: I've looked in the FAQ, but either Im dumb or stupid because I am sure there
                                        ^^^^^^^^^^^^^^

   Those are roughly synonymous, so you have kinda painted yourself
   into a corner there...       ;-)


: is a simple solution to it.

: Also could someone tell me if there is a good place on the web that tells
: you about things like

: $name =~ s/something/somethingelse/g;
: $name =~ tr/something/somethingelse;

: and similar things as above. I know the FAQ has some stuff, just wondering
: if there were other places that might have info on it.


   I don't know of a web site that explains Regular Expressions.

   But you keep mentioning the FAQs to the exclusion of other
   resources available to you.

   My distribution of perl came with 50 *.pod files. Only 9 of them are
   FAQs, the other 41 contain valuable information also.

   For Regular Expressions, you might want to have a look at
   'perlre.pod' and 'perlop.pod'.

   "Mastering Regular Expressions", published by O'Reilly is a 
   wonderful book for getting some understanding of how those
   things work.



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


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

Date: Mon, 28 Dec 1998 15:47:08 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: How do I......
Message-Id: <F4oMIL.9uL@world.std.com>

"Cool" <dusty@hofffmain.com> writes:

>What I need to do is delete everything before a certain word. i.e

>The world is a happening place.

>and I needed to delete everything before "place", how would I go about this.

There are a couple of ways of going about this. One would be to use
index() to find the string, and substr() to remove everything before it.

$findme = 'place';
$string = 'The world is a happening place.';

if(($pos = index($string, $findme)) >= 0 ) {
   substr($string, 0, $pos) = '';
}

Another would be to use some of the "x or more of the previous
pattern" features of regular expressions to ignore the parts before the
string you are interested in. (Take a look at the perlre man page for
a description of all of the features in the regular expression
language. It fits your description of "information on the web" because
it is at:
<URL:http://www.perl.com/CPAN/doc/manual/html/pod/perlre.html> but
it is also very likely on your own machine. The book "Mastering
Regular Expressions" is absolutely great too, but some of the later
chapters might be more than you need.)

$findme = 'place';
$name = 'The world is a happening place.';
$name =~ s/.*($findme.*)/$1/;
# or $name =~ s/(.*)(?=$findme)//;
print "$name\n";

Of course, this find the _last_ occurrence of the target string, not
the first. The match anything part of the regular expression ".*" If
thats a problem, use the non-greedy form ".*?".

You say the search term keeps changing. Does it change between
invocations of your program or during the course of the program? If it
is set during the life of the script, you might want to take a look at
the /o modifier. If it changes during the course of the script, you
might want to take a look at the new qr// operator (if you have perl
5.005) or the FAQ entry "how do I match many regular expressions at
once."

-- 
Andrew Langmead


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

Date: 28 Dec 1998 15:06:25 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: How to get start ?
Message-Id: <7686ph$qc$1@gellyfish.btinternet.com>

On Mon, 28 Dec 1998 22:16:21 +0800 Free Stuff <ex5316@netvigator.com> wrote:
> I'm a begainner.
> I go to the http://www.perl.com/pace/pub, wishing to download a perl
> software so that I can learn, test and run the perl lang. on my
> computer(window 95).
> But I don't know which one should be downloaded ? Also do I need to
> download the complier too ?

For Windows 95 you will need to download the ActivePerl distribution at

<URL:http://www.activestate.com/ActivePerl/>

You will be downloading an self installing executable (probably APi508e.exe)
- for Windows 95 you will also need to install the dcom95 package from
microsoft but I think that this is fully documented in the installation
notes.

/J\
-- 
Jonathan Stowe <jns@btinternet.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: 28 Dec 1998 11:19:08 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Improve speed of a perl-script
Message-Id: <x7zp88gryb.fsf@sysarch.com>

>>>>> "MB" == Marcel Beekmans <beekmans@iae.nl> writes:

  MB> I'm building an application for the web. It is a very big
  MB> appliction, it is about 10,000 code-lines. The speed of the
  MB> appliction is really bad.  What can I do?  (It is not impossible
  MB> to cut the file into 2 or more separate files).


cutting a perl program into multiple files won't speed anything
up, unless you only load the parts that are needed for each invocation
of the script. but that can be complex unless your program is highly
modularized to begin with.

check out fastcgi (www.fastserv.com or www.fastcgi.com) for ways to
speed up perl 5-20 times in web applications.

uri

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


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

Date: 28 Dec 1998 15:00:47 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: Installing modules without PPM
Message-Id: <slrn78f7ql.rs9.randy@theory.uwinnipeg.ca>

On Mon, 28 Dec 1998 14:26:33 GMT, 
	kate_stafford@my-dejanews.com <kate_stafford@my-dejanews.com> wrote:
>I need to install a couple of packages on my ActivePerl build 508. However,
>PPM is not working on any of my machines. Is there a way to install packages
>by hand?
>
>Any help you could provide will be appreciated.

Hi,
   Do you know why ppm isn't working? Are you behind a firewall?
For that, you need to 
	set HTTP_PROXY=http://your_proxy:8088
If that still doesn't work, you can install modules by hand - grab
whatever package you want from CPAN (http://www.cpan.com/CPAN/),
then unpack the distribution. One of the created files is usually
README (and sometimes INSTALL) which tells you how to go about 
installing it. For these you need a make utility (nmake, or dmake),
and then you just type
	perl Makefile.PL
	nmake
	nmake test
	nmake install
Alternatively, you can automate this to a great extent by using
the CPAN module (eg: perl -MCPAN -e shell; install Net::FTP).
For XS-based modules you'll also need a C compiler (VC++, or Borland).
Using ActiveState's build, I believe nmake and VC++ are the
defaults - if you change these, or need to set the right lib or
include paths, you have to edit perl's Config.pm.

-- 
		Best regards,
		Randy Kobes

Physics Department		Phone: 	   (204) 786-9399
University of Winnipeg		Fax: 	   (204) 774-4134
Winnipeg, Manitoba R3B 2E9	e-mail:	   randy@theory.uwinnipeg.ca
Canada				http://theory.uwinnipeg.ca/


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

Date: Mon, 28 Dec 1998 15:59:29 GMT
From: dturley@pobox.com
Subject: Re: Installing modules without PPM
Message-Id: <7689t0$mk3$1@nnrp1.dejanews.com>

In article <7684em$i4d$1@nnrp1.dejanews.com>,
  kate_stafford@my-dejanews.com wrote:
> Hello
>
> I need to install a couple of packages on my ActivePerl build 508. However,
> PPM is not working on any of my machines. Is there a way to install packages
> by hand?

For non-XS modules you can download them from CPAN and use dmake or nmake to
install them. The URLs to get dmake and nmake of been posted recently, seach
dejanews.

You should probably try and find out why PPM is not working for you. Are you
behind a firewall. Instructions for getting around that are included with the
AS Perl dist.

> Kate Stafford, MCSE
Trouble shooting windows should be easy for you.
____________________________________
David Turley
dturley@pobox.com
http://www.binary.net/dturley/

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


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

Date: Mon, 28 Dec 1998 17:19:55 GMT
From: kate_stafford@my-dejanews.com
Subject: Re: Installing modules without PPM
Message-Id: <768ejp$qm1$1@nnrp1.dejanews.com>

In article <7689t0$mk3$1@nnrp1.dejanews.com>,
  dturley@pobox.com wrote:
>
> You should probably try and find out why PPM is not working for you. Are you
> behind a firewall. Instructions for getting around that are included with the
> AS Perl dist.

I would really love to figure this out. Its not a firewall issue, though,
because I get the same errors when I try to install locally. I posted the
error last week, but noone has responded, so I'll stick it out here again:

no element found at line 1, column 0, byte -1 at
D:\PERL\site\lib/XML/Parser.pm line 117

I get this error when I try to verify or install something in PPM, but I can
still search OK. I have received this error on several different machines, all
running NT sp3. The strange thing is that it was working fine. No changes in
configuration had been made, nothing new was added to these machines. Then one
day, it just stopped working. I've gotten the same error with AS builds 506,
507, & 508.

Any suggestions would be greatly appreciated!

Thanks,

Kate


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


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

Date: Mon, 28 Dec 1998 09:02:42 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Need good, simple regex help/tutorial
Message-Id: <ii6867.hqm.ln@magna.metronet.com>

Kim Saunders (kims@tip.net.au) wrote:

: I am some advice on how to learn about using regular expressions. I know
: what they do, and I know how useful and powerful they must be. I have read
: all the docs on them I can find, I have read the relevant bits in my copy of
: Programming Perl, but I just don't get it! Everything I read skips over the
: simple, basic stuff really quickly, and goes on to demonstrate how to
: recognise an email adress, or a duplicated word, with a bewildering series
: of characters!


   Power has its price.

   Regexen are hard to read and write because of their power.

   It is the nature of the beast...



   "Mastering Regular Expressions", published by O'Reilly, is the way
   to go if you really want to make regexen sing.


   I found it helpful (for me) to understand the fundamental theory
   underlying regular expressions.

   See if you can find a textbook about Formal Methods, language
   implementation, machine grammars, or parsing/compiling, and
   look for the part about Finite State Machines/Automata (FSA).

   FSA can be translated into regular expressions, and regular
   expressions can be translated into FSAs (the later is roughly
   what perl does in order to perform the pattern match for you).

   Some of the mystery fell away once I understood the basics of
   the machine that implements a pattern match.



: I would _really_ appreciate it if someone can give me a basic, thorough
                                                ^^^^^^^

   I don't know of any resource that meets that requirement. If you
   can scare up some cash, get the book mentioned above  ;-)


: tutorial to read, so that I can finally exploit the potiential of regexes.


: A few examples of things I would like to be able to to for a current
: project:

: Check to see if a variable is an integer 0<$x<1000 I could do this another
: way, using plain old maths, but can it be done better? 


   Regular expressions operate on strings. If you want to operate on
   some other data type (eg. numbers), then regexen are very likely
   not the Right Tool For The Job.


      if ($x > 0 && $x < 1000) {  # this is best for most values of "best"


: Isn't a string (ie,
: letters) greater than 0 anyway?


   It depends, and you can find this out yourself anyway:


--------------------------
#!/usr/bin/perl -w

$str = 'hello world';                       # string equals zero
if ($str > 0)
   { print "$str is greater than zero\n" }
else
   { print "$str is less than or equal to zero\n" }


$str = '1999 will be a good year';          # string equals the number 1999
if ($str > 0)
   { print "$str is greater than zero\n" }
else
   { print "$str is less than or equal to zero\n" }
--------------------------


: Check to see if a variable is a valid 24 bit number (a colour)


   This depends on the representation used in the "variable", which
   you haven't shared with us.

   I will rephrase your question into something that can I can answer  ;-)

      "Check to see if a variable contains a string representation, in
       hexidecimal, of a 24 bit number"


   This reduces to:

      Check to see if the variable has exactly 6 hexidecimal chars:

   die "'$color' is a Bad Value" unless $color =~ /^[a-fA-F0-9]{6}$/;


: I have a string $str = 'hello i am a string'; how do I get each word into a
: variable (or array element) of its own?


   @words = split /\s/, $str;


: How would one go about extracting the data after each header in a email
: message?


   I'll rephrase that question too:

      "How do you extract all of the data following the first
       blank line?"


      # UNTESTED
      while (<>) { next unless /^$/ }   # skip until blank line

      while (<>) { 
         $info .= $_;
      }



   Perl FAQ, part 9 describes a way to recognize email headers:

      "How do I parse a mail header?"


: These are just a few examples. All of them I could (and have) done in other,
: messier ways. I would love to be able to compress a 5 or 10 line while loop
: into a single line!


   There is not a direct correspondence between 
   elegant/maintainable/good code and the number of lines of code.

   If there was, then:

      while (<>) {
         print;
      }

   could be "improved" into:

      while(<>){print}

   ;-)



: PS pls respond via email.


   But then the dozens or hundreds of other folks that have the same
   question will be denied the answer.

   That's rather selfish.

   Ask it here, get the answer here.


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


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

Date: Mon, 28 Dec 1998 12:06:00 -0500
From: Tripp Lilley <tripp.lilley@perspex.com>
Subject: Re: New module Net::RawIP
Message-Id: <3687BA78.48316273@perspex.com>

"Sergey V. Kolychev" wrote:

> On Tue, 22 Dec 1998, Tripp Lilley wrote:
>
> > "William R. Ward" wrote:
> >
> > > Why not just Net::IP?
> >
> > Or, better yet, Net::IPv4.
> >
>
> Sorry ,but my module related only for _raw_ IP packets
> Look at Net::TCP ,Net::Inet from Net-ext at CPAN created by
> Spider Boardman.

I think you've misunderstood our point. 'IP' is, by definition, 'raw IP'. TCP
and UDP are layered on top of IP. The various INET services and protocols
(HTTP, NNTP, SMTP, etc.) are in turn layered on top of TCP and/or UDP. Thus,
the package name 'Net::IPv4' is perfectly accurate for your module. It is, as
you say, for raw access to IP packets (presumably IPv4 and not IPv6, or you
would've said otherwise).

The suggestion stands.




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

Date: 28 Dec 1998 15:01:44 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Perl on NT - How to run as a daemon process
Message-Id: <7686go$q9$1@gellyfish.btinternet.com>

On Mon, 28 Dec 1998 08:50:37 -0500 Adrian G. Klingel <klingela@nt.com> wrote:
> Happy Holidays to all of you,
> 

And to you !

>   I've written a program which checks for the existence of a file, and
> if it finds the file, that file is loaded into an Oracle database. 
> Right now we have an unreliable scheduler for Windows NT, so I don't
> really want my job to kick off at a certain time every day, I would
> rather my Perl program always run, polling this directory during certain
> hours.  Does anyone out there know how to set up a Perl program as a
> task which occurs on startup and runs in the background?  I know I could
> run the command from a batch file and add that to the Startup program
> group, but that runs in the foreground with the DOS window, which anyone
> playing around on the server can close.  Please help if you can.
> 

You need to run the program as a service - You will need the NT resource kit
to do this.  An article that fully describes how to achieve this can be seen
on DejaNews at:

<URL:http://www.dejanews.com/getdoc.xp?AN=381273730>

Hope that helps.

/J\
-- 
Jonathan Stowe <jns@btinternet.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: 28 Dec 1998 11:15:17 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: problem with specific language characters ("v, 	d,|,_")
Message-Id: <x73e60i6p6.fsf@sysarch.com>

>>>>> "RG" == Rich Grise <off-duty@entheosengineering.com> writes:

  >> If someone submits information via a form, that contains
  >> =F6,=E4,=FC,=DF=

  RG> , I get strange %something instead of these characters, when I
  RG> process the form= =2E

  RG> @INPUT =3D split(/&/,$input);
  RG> foreach $namevalue (@INPUT) {
  RG>     ($name, $value) =3D split(/=3D/, $namevalue);
  RG>     $name =3D~ tr/+/ /;
  RG>     $value =3D~ tr/+/ /;
  RG>     $name =3D~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  RG>     $value =3D~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  RG>     $FORM{$name} =3D $value;
  RG> }

looks like you have the same problem with your code. this won't compile
in perl. what operator is =3D~ ?

  RG> Thanks to Matt for that one. (I think it's also in cgilib.pl).

poor thanx and advice. stay away from matt's scripts if you value your
life and/or career.

the FAQ answer is use CGI.pm

uri

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


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

Date: 28 Dec 1998 10:28:55 -0600
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <768bk7$2m8q$1@Venus.mcs.net>

In article <mn1767.etk.ln@magna.metronet.com>,
Tad McClellan <tadmc@metronet.com> wrote:
>
>: After a few months I tried to answer something
>: and was put off by the automated rejection.
>
>comp.lang.perl.moderated doesn't _have_ automated rejections.
>
>If you got a rejection, it was written by a human.
>
>
>There is an automated registration process however.
>
>It that what put you off?

Yes, I thought the object of usenet was to exchange questions and
answers easily.  I tried to answer a question and the answer bounced
back to me instead of getting posted.  You can call that something
other than a rejection if you like but the result is the same -
the person who asked didn't get their answer.  If the object of
the other group is to make it difficult instead of easy, then I'm
just too lazy to participate.  I feel the same about people who
use unusable email reply addresses when they are asking for a
response.

  Les Mikesell
    les@mcs.com


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

Date: Mon, 28 Dec 1998 08:29:41 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: running a perlscript
Message-Id: <lk4867.hqm.ln@magna.metronet.com>

Reine Ahlgren (reine.ahlgren@home.se) wrote:

: Subject: running a perlscript


   That subject header suggests that maybe the documentation that
   came with your perl distribution with the below title could
   be of help:

      perlrun - how to execute the Perl interpreter


: Im an absolute beginner to perl and have just bougt a book "Learning perl".
: My problem is that when i've written a script and want to execute it says
: "command not found". 


   How did you execute it?

   There are several different ways. Knowing which you used would
   help us to help you.


: When i put the script in the /usr/bin catalogue it
: works just fine. 


   Sounds like the current directory is not on your path.

   In that case you could:

      ./my_script       # relative path to perl program

   or

      /home/reine/perl_progs/my_script   # absolute path to perl program

   or

      add the current directory to your path  ;-)


: I've put the right permissions on the file also. So my
: question is how do i get the perlscript to run from another catalogue on my
: Linux-machine than /usr/bin?

: I would be very happy if someone could help me.


   here is another way:

      /usr/bin/perl -w my_script


   See the 'perlrun.pod' doc for more information.


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


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

Date: Mon, 28 Dec 1998 16:19:31 GMT
From: "McWebber" <mcwebber@my-dejanews.com>
Subject: Re: Splitting multiple |'s
Message-Id: <ncOh2.419$k67.290@news.rdc1.fl.home.com>

There's a script that reads from a database just like you're talking about.
Fairly easy to reconfigure to more fields.
http://www.technotrade.com/
It's the "URL Search Engine" in their CGI Scripts section.

--
McWebber
Help on your web page | http://mcwebber.com/mcwebber/
Newsgroup postings are not an invitation for mail - Post publicly to reply
Under no circumstances will I ever purchase anything offered to me as the
result of an unsolicited e-mail message

Groovy94 wrote in message <19981227192849.08200.00002458@ng-fb1.aol.com>...
>I am trying to split multiple "|" characters into seperate variables. I
have
>one line in a database for a person, containing all their information, and
I am
>trying to sort it into variables, so I can work with it. Here is the code I
>have, but it only split's the first "|".
>
>$id,$first_name,$last_name,$address,$city,$state,$postal_code,$country,$em
>ail,$url,$password) = split('|', $reseller);
>
>an example of what a line I am trying to work with would look like is
below:
>
>12|Bob|Smith|2738 Bob Lane|New
>Orleans|LA|70554|US|bob@bobsite.com|http://www.bobsite.com|sdsdskldhs(encr
>ypted)
>
>Regards,
>GIl Hildebrand, Jr.
>Email: groovy94@aol.com
>ICQ UIN: 16678754




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

Date: 28 Dec 1998 11:22:54 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Syntactical weirdness? Or is it just me?
Message-Id: <x7vhiwgrs1.fsf@sysarch.com>

>>>>> "F" == Fluffy  <meowing@banet.net> writes:


  F> What you're missing is that print interpreted the result of
  F> reverse() as a list rather than a scalar.  Print thinks that
  F> everything is a list unless you tell it otherwise. Since your list
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

how untrue. perl doesn't think about your code at all. context is
provided by the operator(s) next to the the given op and by their
precedence and syntax. you can always predict the context by looking at
the code. there is NO default context.

IMO that was a foolish thing to tell a newbie.

uri


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


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

Date: 28 Dec 1998 12:18:43 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Syntactical weirdness? Or is it just me?
Message-Id: <768ehj$adh$1@monet.op.net>

In article <767ln4$fpt$1@news.xmission.com>,
Brandon Burt <bb@jesusfish.xmission.com> wrote:
>I'm trying to find the deep, inner meaning in this weirdness. 

An explanation of the deep inner meaning, in connection with exactly
this example, is at <http://www.plover.com/~mjd/perl/context.html>.


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

Date: 28 Dec 1998 11:01:09 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Syntactical weirdness? Or is it just me?
Message-Id: <m3af08qh7e.fsf@moiraine.dimensional.com>

Uri Guttman <uri@sysarch.com> writes:

> >>>>> "F" == Fluffy  <meowing@banet.net> writes:
>   F>                                            Print thinks that
>   F> everything is a list unless you tell it otherwise. Since your list
>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> how untrue. perl doesn't think about your code at all. context is
> provided by the operator(s) next to the the given op and by their
> precedence and syntax. you can always predict the context by looking at
> the code. there is NO default context.

Perhaps you misread.  The poster was right in that C<print> is
always a listop unless one takes steps to force scalar context
(in which case, print is still a listop, but it's arguments may
be evaluated otherwise).

> IMO that was a foolish thing to tell a newbie.

*Boggle*  I don't understand this comment at all.  Are you saying
that the right way to communicate perl's crypto-context games
isn't by explicitly identifying whether something is a listop?

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Mon, 28 Dec 1998 15:02:32 +0000
From: Tim Hicks <tim.hicks@iname.com>
Subject: Re: Uninitialized value error
Message-Id: <36879D88.1171666@iname.com>

Thanks very much, that has fixed everything.  It was a problem with my text
file.  Appreciate the help.

Tim



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

Date: Mon, 28 Dec 1998 17:26:48 +0100
From: Peter Strickler <peter.strickler@ubs.com>
Subject: Using the PGPsdk from within PERL - anybody with experience?
Message-Id: <3687B148.DFF167CD@ubs.com>

This is a multi-part message in MIME format.
--------------C86167ADCF85BEF251606FD5
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello ...

Basically my problem is the integration of  the PGPsdk libraries (C)
into a Perl script.

Although I have seen the references to perlxstut, perlxs, perlcall,
perlguts and perlembed (which I fear I'll have to work through sooner or
later), I was wondering if somebody 'out there' has already gathered
some experience in this field and would be willing to help me avoid the
most basic errors, or perhaps even share his/her wisdom with me.

The application I'm working on is running (well, at least parts of it
are already running) under Unix (Sun System V Release 4.0) with Perl
5.005_02 and a variety of modules installed.

I'd greatly appreciate any feedback, comments, help, hints, tools or
whatever you think might make the task easier!

Thanks a lot,

Peter Strickler


--
Peter Strickler                          peter.strickler@ubs.com


--------------C86167ADCF85BEF251606FD5
Content-Type: text/x-vcard; charset=us-ascii;
 name="peter.strickler.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Peter Strickler
Content-Disposition: attachment;
 filename="peter.strickler.vcf"

begin:vcard 
n:Strickler;Peter
tel;fax:++41 1 236 78 98
tel;work:++41 1 234 63 16
x-mozilla-html:TRUE
org:<a href="http://www.ubs.com" ><img src="http://www.ubs.com/imgs/logo.gif" border=0 alt=UBS AG></a>
adr:;;PO Box;Zurich;;8098;Switzerland
version:2.1
email;internet:peter.strickler@ubs.com
title:Project manager 'Secure Customer EMail'
x-mozilla-cpt:;-2272
fn:Strickler, Peter
end:vcard

--------------C86167ADCF85BEF251606FD5--



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

Date: Mon, 28 Dec 1998 17:53:54 GMT
From: rick@marinweb.com (Rick Freeman)
Subject: When hashing won't work...
Message-Id: <3687c3b8.3167392@nntp2.ba.best.com>

I'm relatively new to Perl and there's a problem that's been bothering
me for a while.  I wondered if there is a solution that I'm just not
aware of...

Being a good, perlish programmer, I use hashes for all kinds of cool
things, like to keep track of items which I've seen, to see if a
specific item is in a list, and so forth.

Sometimes, though, when I want to do something like that, I can't
because hash keys can only consist of certain characters.  For
instance, I can't use a hash to do the above mentioned sorts of things
with a list of email addresses... foo@bar.com will not work as a hash
key.

Is there a way around this kind of situation?

Or do I have to skip the shortcut and just write the code?

Just wondering...
Rick


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

Date: 28 Dec 1998 14:50:29 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: Windows NT Installation problem
Message-Id: <slrn78f77d.rs9.randy@theory.uwinnipeg.ca>

On Mon, 28 Dec 1998 15:10:13 +0100, 
	Michael Garstenauer <michael@mechatronik.uni-linz.ac.at> wrote:
>today i tried to set up perl on a windows nt server. i downloaded
>cygwin32 ver 20.1 and perl 5.005. cygwin works (i compiled the usual
>"hello.c" stuff, and it does what one expects, writing "Hello World!"),
>but perl refuses to work. after some hacking with the hints/cygwin32.sh
>i finally got the Configure script to recognise where the include files
>are (it did not find them with the default setup), but now i got a
>makefile that seems to be buggy. when i type "make" (step 3 out of the
>install file) i get the following response:
>
>bash-2.02$ make
>make depend MAKEDEPEND=
>/c: Can't open /c
>make: *** [GNUmakefile] Error 2

Hi,
   It sounds like you need to set the environment variable
MAKE_MODE to UNIX. You might also want to search dejanews 
for an article posted a week or two ago by Steven Morlock
on how to compile perl with cygwin - there were a few additional
things that needed to be done (subject: HOWTO: Building perl
under Win95). In particular, at a first pass, dynamic loading
seems not to work, at least with the latest cygwin tools.

-- 
		Best regards,
		Randy Kobes

Physics Department		Phone: 	   (204) 786-9399
University of Winnipeg		Fax: 	   (204) 774-4134
Winnipeg, Manitoba R3B 2E9	e-mail:	   randy@theory.uwinnipeg.ca
Canada				http://theory.uwinnipeg.ca/


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

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

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