[10075] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3668 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 9 11:07:56 1998

Date: Wed, 9 Sep 98 08:00:23 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 9 Sep 1998     Volume: 8 Number: 3668

Today's topics:
    Re: #!/usr/bin/perl not working? (Raul)
        ??? if ($fr "$test" $threshold) ??? jack.haberle@bigfoot.com
    Re: ??? if ($fr "$test" $threshold) ??? <rick.delaney@shaw.wave.ca>
        Another newbie OO question <awrobinson@amoco.com>
        Array References and Function return values (Jari Aalto+maile.perl)
    Re: Bug! in regexp (or me) <aqumsieh@tigre.matrox.com>
        Cache flow <franc@forrest.cz>
        Debugger behaviour <hegel_m@erlf.siemens.de>
        eof check on output stream <Doug_Azzarito@dell.com>
    Re: For Sale: O'Reilly Perl Resource Kit - WIN32 (Greg Bacon)
    Re: how to quote ; (Michael J Gebis)
    Re: how to quote ; (Michael J Gebis)
    Re: how to quote semicolon (Michael J Gebis)
        How to read an UTF-8 encoded string <mortensi@idt.ntnu.no>
        Importing/Reading remote HTML files with perl... <Hawkwynd_remove_this_part@_remove_this_part_adelphia.net>
    Re: Importing/Reading remote HTML files with perl... (Randy Kobes)
        IRR Function needed <bubblesplit@pc.vom>
    Re: Is perl millennium compliant ? (I R A Aggie)
        JAVA+REGEX Regular Expressions in Java - Web Page Updat <meurrens@ulb.ac.be>
        local mail deliviry? (Stephan Jager)
    Re: Looking for a programm in Perl!:=) dave@mag-sol.com
    Re: Looking for a programm in Perl!:=) <plateforme@wanadoo.fr>
        Manpage Wrapper <pstarbard@nrgn.com>
    Re: Manpage Wrapper <ajohnson@gpu.srv.ualberta.ca>
    Re: Perl Programmer Needed (Roberto)
    Re: Perl Programmer Needed <jdw@dev.tivoli.com>
    Re: Perl Programmer Needed (Greg Bacon)
    Re: Perl Source Needed jboes@my-dejanews.com
    Re: Problem installing perl 5.004_04 <debuigny@dallas.net>
    Re: regexp teaser <jdf@pobox.com>
        Soap Series, or is it... <koos_pol@nl.compuware.com>
    Re: String to Binary <jdw@dev.tivoli.com>
    Re: String to Binary (Mike Stok)
    Re: Truncation problem when appending arrays in Perl (Tad McClellan)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 09 Sep 1998 13:29:01 GMT
From: gravels@hunterlink.net.au (Raul)
Subject: Re: #!/usr/bin/perl not working?
Message-Id: <35f8e969.3353260@news.newcastle.edu.au>

On Fri, 04 Sep 1998 20:02:51 +0800, Andrew Mulvey
<triangle@iinet.net.au> wrote:

>I can easily run perl scripts I have written in Linux (RH5.0) by typing
>"perl exename" at the shell prompt but even if i start the script with
>#!/usr/bin/perl my script won't run simply by entering its name at the
>prompt (and yes i have set the file the script is saved in as executable
>by u, g and o). The perl exe is sitting in /usr/bin btw.
>
>Can anyone enlighten me?

Unlike everyone else here, I believe there is something more sinister
at work here.  I have the same problem with both RH 4.2 and 5.0 and it
is not a $PATH problem.

I have tried executing scripts but full and . paths and they never run
themselves.  Every time it seems to ignore the #!/usr/bin/perl shell
and tries to parse it in the current shell.

Now, strangely enough, I have noticed that these scripts will work
when Apache runs them as CGI's (which wont happen if you leave the
#!/usr/bin/perl out!)


Admittedly I have never found out where you actually set PATH in Linux
which causes another problem to test it otherwise.  Only other answer
I can add is that I think there is a file which lists what shells are
available on a system, but I keep forgetting what this file is so I
haven't updated it either!

\------------------------------
Raul (gravels@hunterlink.net.au)


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

Date: Wed, 09 Sep 1998 13:30:16 GMT
From: jack.haberle@bigfoot.com
Subject: ??? if ($fr "$test" $threshold) ???
Message-Id: <6t5vta$3et$1@nnrp1.dejanews.com>

I'm trying to apply a set of tests to some analysis results.  Info about the
tests to be applied is stored in an Oracle DB.	For example, a test of
whether a flowrate is greater than a threshold:  I am getting $test = '>' and
$threshold = 500 correctly from the database, but as I have the brain of a
turnip I can't seem to be able to figure out an if clause that will apply the
test and tell me whether or not I pass.

Is what I'm trying to do even possible?  If so, can anyone point me toward any
relevant documentation and/or give me a hint?

Thanks in advance!

-jack

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 09 Sep 1998 14:26:47 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: ??? if ($fr "$test" $threshold) ???
Message-Id: <35F6919F.5ECE3296@shaw.wave.ca>

[posted & mailed]

jack.haberle@bigfoot.com wrote:
> 
> I'm trying to apply a set of tests to some analysis results.  Info 
> about the tests to be applied is stored in an Oracle DB.  For example, 
> a test of whether a flowrate is greater than a threshold:  I am 
> getting $test = '>' and $threshold = 500 correctly from the database, 
> but as I have the brain of a turnip I can't seem to be able to figure 
> out an if clause that will apply the test and tell me whether or not I 
> pass.

You could wrap the code in an eval statement:

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

$test = '>';
$threshold = 500;
$fr = 100;

if (eval "$fr $test $threshold") {
    print "good\n";
}
elsif($@ eq "") {
    print "bad\n";
}
else {
    die "error in '$fr $test $threshold':\n$@\n";
}
__END__

Or you could use a sub that conditionally determines the, er, condition:

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

$test = '>';
$threshold = 500;
$fr = 1000;

$test_result = test_condition($fr, $test, $threshold);

if ($test_result) {
    print "good\n";
}
elsif(defined $test_result) {
    print "bad\n";
}
else {
    print "error in '$fr $test $threshold'\n";
}

sub test_condition {
    my($left, $op, $right) = @_;
    for ($op) {
        $_ eq '>' and return($left > $right);
        $_ eq '<' and return($left < $right);
	# etc.
        return undef;
    }
}

> Is what I'm trying to do even possible?  If so, can anyone point me 
> toward any relevant documentation and/or give me a hint?

perldoc -f eval
perldoc Benchmark (in case you have performance issues). 


-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Wed, 09 Sep 1998 09:41:49 -0500
From: "Andrew W. Robinson" <awrobinson@amoco.com>
Subject: Another newbie OO question
Message-Id: <35F693AD.5FA79FE@amoco.com>

I want to pass a parameter to the initialization when I create an
object. What is the syntax for doing this? If it is described in
either the perlobj or perltoot pages, it went over my head. I
apologize for that.

I know this is the syntax if I create the object without a
parameter: $o = Stuff->new();


#!/usr/bin/perl 
# File Stuff.pm

package Stuff;

sub new() {
        my $class = shift;
        my $self = {};
        bless $self, $class;
        $self->initialize();
        return $self;
}

sub initialize() {
        my $self = shift;
        $self->{'stufflist'} = $self->setStuff();
}

sub setStuff() {
        return ( 'one', 'two', 'three' );
}

sub getStuff() {
        my $self = shift;
        return $self->{'stufflist'};
}
1;


What does the package syntax look like if I create the object
with a parameter: $o = Stuff->new('hup');


#!/usr/bin/perl 
# File Stuff.pm

package Stuff;

sub new() {
        my $class = shift;
        my $self = {};
        bless $self, $class;
        $self->initialize();
        return $self;
}

sub initialize() {
        my $self = shift;
        # A miracle occurs and $myparm appears...
        $self->{'stufflist'} = $self->setStuff($myparm);
}

sub setStuff() {
        my $myparm = shift;
        return ( 
		"$myparm ".'one', 
		"$myparm ".'two', 
		"$myparm ".'three' 
	);
}

sub getStuff() {
        my $self = shift;
        return $self->{'stufflist'};
}
1;


Thanks!

Andrew Robinson
-- 
Offshore Business Unit           email: awrobinson@amoco.com
Amoco Corporation                      phone: (504) 586-6888
New Orleans, LA                          fax: (504) 586-2637
-----
The events depicted herein are fictional. Any similarity to 
persons living or dead is entirely...oops, wrong disclaimer


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

Date: 09 Sep 1998 17:53:22 +0300
From: <jari.aalto@poboxes.com> (Jari Aalto+maile.perl)
Subject: Array References and Function return values
Message-Id: <ptr3ea149st.fsf@olkikukka.i-have-a-misconfigured-system-so-shoot-me>



	I have assumption that passing references around the code is
	much more efficient than passing copies of arrays. Right?

	Then How do convert function that currenly uses multiple
	arrays and return one big array back

		@array1
		@array2
		..

		return @aray1, @array2 ...


	What I'd like to see is:

		return \@array

	but that means

		push @ret, @array1;
		push @ret, @array2;

	Which seems to be inefficient. Oh well, egg or chicken?

	jari


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

Date: 09 Sep 1998 09:36:00 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: Bug! in regexp (or me)
Message-Id: <x3yk93d5ry7.fsf@tigre.matrox.com>


Joe Marzot <gmarzot@baynetworks.com> writes:

[snip]

> 
> BTW,. does anyone have an example of how to use '\G' in the regexp. I
> was hoping this might give me a hint as to where the previous s///g left
> off.
> 

Get a copy of "Mastering Regular Expressions" by Jeffrey Friedl,
published by O'Reilly. It has a big chapter dedicated to Perl
regexps. I remember seeing some \G stuff in there.

> Thanks, GSM
>     
> -- 
> G.S. Marzot                        email: gmarzot@baynetworks.com
> Bay Networks Inc.                  voice: (978)670-8888 x63990
> 600 Tech Park  M/S BL60-101        pager: (800)409-6080 (4096080@skytel.com)
> Billerica, MA  01821                 fax: (978)670-8145

-- 
Ala Qumsieh             |  No .. not Just Another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)


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

Date: Wed, 09 Sep 1998 15:41:11 +0200
From: Michal Franc <franc@forrest.cz>
Subject: Cache flow
Message-Id: <35F68577.265733D@forrest.cz>

Anyone knows what is CashFlow?
I get this http_user_agent response
Mozilla/3.01 (compatible; CacheFlow-Cache/1.1 - 10887.P)

Thanks


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

Date: Wed, 09 Sep 1998 13:44:50 +0200
From: Hegel Stephan <hegel_m@erlf.siemens.de>
Subject: Debugger behaviour
Message-Id: <35F66A32.C2DA0394@erlf.siemens.de>

Hi all,

I just started using perl-5.004_04 and have got a question to the 
behaviour of the perl debugger. I'am using the following snippet 
of perl code:

--------- cut here --------------------------------
#!/usr/local/bin/perl -dw

$i=0;
while ($i<2) {
   print "First loop i:", $i, "\n";
   $i++;
}

while ($i<3) {
   print "Second loop i:", $i, "\n";
   $i++;
}
exit 0;
--------- cut here --------------------------------


Running the interpreter I get the following (just using the n
command of the debugger to step through the code):


---------------------------------------------------
Loading DB routines from perl5db.pl version 1.01
Emacs support available.

Enter h or `h h' for help.

main::(./debugger.pl:3):        $i=0;
  DB<1> n
main::(./debugger.pl:9):        while ($i<3) {
  DB<1> n
main::(./debugger.pl:5):           print "First loop i:", $i, "\n";
  DB<1> n
First loop i:0
main::(./debugger.pl:6):           $i++;
  DB<1> n
main::(./debugger.pl:4):        while ($i<2) {
  DB<1> n
main::(./debugger.pl:5):           print "First loop i:", $i, "\n";
  DB<1> n
First loop i:1
main::(./debugger.pl:6):           $i++;
  DB<1> n
main::(./debugger.pl:4):        while ($i<2) {
  DB<1> n
main::(./debugger.pl:13):       exit 0;
  DB<1> n
main::(./debugger.pl:10):          print "Second loop i:", $i, "\n";
  DB<1> n
Second loop i:2
main::(./debugger.pl:11):          $i++;
  DB<1> n
main::(./debugger.pl:9):        while ($i<3) {
  DB<1> n
main::(./debugger.pl:13):       exit 0;
  DB<1> n
DB::fake::(/usr/local/lib/perl5/perl5db.pl:2083):
2083:     "Debugged program terminated.  Use `q' to quit or `R' to
restart.";
---------------------------------------------------

Why does the debugger goes from line 3 immediatly to line 9 but executes 
line 4-6. Also the following order of execution looks somehow confusing
to me.
I tried it also with an older version of perl (5.003) and it looks quite
different (line 3, than line 4, etc.)
If this behaviour is documented somewhere please lemme know.

Thanks for any hint,
   Stephan.


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

Date: Wed, 9 Sep 1998 08:55:40 -0500
From: "Doug Azzarito" <Doug_Azzarito@dell.com>
Subject: eof check on output stream
Message-Id: <6t6199$ol3$1@galaxy.us.dell.com>

I am using perl 5.003_07 under Win98.  I have a script that opens a file for
output, and one of my subroutines does an eof check on the filehandle to see
if anything was written.  This puts a garbage character into the output
stream.

Is this a known behavior?  I can probably re-write the sub to use something
besides eof, but it might help me to know why the extra characterl gets
added.  Try this...

open (TEST, '>junk.txt');
print TEST "Start.....";
if (eof(TEST)) {
   print TEST "EOF\n";
}
else {
   print TEST "Not EOF\n";
}





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

Date: 9 Sep 1998 14:45:24 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: For Sale: O'Reilly Perl Resource Kit - WIN32
Message-Id: <6t64a4$ona$3@info.uah.edu>

In article <6t4esf$v73$1@nnrp1.dejanews.com>,
	gregkeene@yahoo.com writes:
: Send mail (REMOVE NOSPAMTODAY) to: gregkeeneNOSPAMTODAY@NOSPAMTODAYyahoo.com
: for information.

Funny, <A Href="MAILTO:gregkeene@yahoo.com">gregkeene@yahoo.com</A>, how
you'd spam us but would be unwilling to receive spam in return.  Go
crawl back into whatever hole you came from.

Greg
-- 
Don't worry about people stealing your ideas. If your ideas are any good,
you'll have to ram them down people's throats. 
    -- Howard Aiken 


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

Date: 9 Sep 1998 05:16:57 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: how to quote ;
Message-Id: <6t5309$3al@mozo.cc.purdue.edu>

zhengyu@lacerta.Berkeley.EDU (Jimmy Zhengyu Zhang) writes:

}    Just wonder how to quote ; in the string?

Just do it.

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: 9 Sep 1998 05:15:56 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: how to quote ;
Message-Id: <6t52uc$3ae@mozo.cc.purdue.edu>

zhengyu@lacerta.Berkeley.EDU (Jimmy Zhengyu Zhang) writes:

}  Could someone tell me how to quote ; in the string?
}  Seems I can find a way of doing so.

What's the problem you're seeing?

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: 9 Sep 1998 05:18:32 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: how to quote semicolon
Message-Id: <6t5338$3as@mozo.cc.purdue.edu>

zhengyu@lacerta.Berkeley.EDU (Jimmy Zhengyu Zhang) writes:

}  Just wondering how to quote ; in a string?

print "this ; is ; how\n"

P.S. Which answer was the best?

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: 9 Sep 1998 12:14:46 GMT
From: Morten Simonsen <mortensi@idt.ntnu.no>
Subject: How to read an UTF-8 encoded string
Message-Id: <6t5rfm$m03$1@due.unit.no>

I am trying to communicate between a Java applet of mine, and a Perl
server. The applet sends a UTF-8 encoded string to my server. The
server receives it, but not in plain text. The result can be viewed in
the jed editor: (and not for example in pico or even emacs, trying to
cat the file, corrupts the keyboardoutput, forcing me to reset the
terminal)

Input: ^@^NActivityKey:A0

Now, how can I read this string properly? (Someone said something
about unpack(), but I don't know..) The point is probably that ^N = 14
= length("ActivityKey:A0"), but so what? Can I just always skip the
first two bytes of the input? Can some please enlighten me?

Thanks in advance.

Morten Simonsen



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

Date: Wed, 9 Sep 1998 08:53:37 -0400
From: "Hawkwynd" <Hawkwynd_remove_this_part@_remove_this_part_adelphia.net>
Subject: Importing/Reading remote HTML files with perl...
Message-Id: <kUuJ1.46$e61.603335@news.axxsys.net>

I've come onto a snag in my programming, one that has me completely stumped.
I am trying to import a file from a web site, (noaa.gov) which has weather
information, in HTML format. Crude, but still has tags. I want to be able to
use the text contained in it, and reformat it for use with my web site.

1. HTTP-lib gives me ability to perform an HTTPget which will acess the
HTML, but I cannot get the script to perform simple changes, or remove
unwanted characters.

2. I want to be able to import the file (nowbufny.html) and remove the HTML
tags, as well as other unwanted characters, and certain portions of the
text.

Any assistance with this would be *greatly* appreciated. I'm new to Perl,
and still green around the guills...


Here's a snippet of my code:

---cut off the top---

# require the http-lib.pl file
require 'c:/httpd/weather/http-lib.pl';

print "Content-type:text/html\n\n";

print"<body BGCOLOR=#000000 TEXT=#FFFFFF>";
print "\n\n"; print "<FONT size=5 COLOR=#FF0000>Buffalo Short Term Weather
Forecast</FONT><BR> ";

################ Initialize Variables #####################
$iwin_url = "iwin.nws.noaa.gov";

#Keywords to highlight, and make yellow

my @excite = ("INCLUDING","BUFFALO","NIAGARA
FALLS","BATAVIA","JAMESTOWN","OLEAN","WELLSVILLE","ROCHESTER","OSWEGO","WATE
RTOWN");
my @replace_word = ("NIAGARA FRONTIER","WESTERN SOUTHERN TIER", "GENESEE
VALLEY AND WESTERN FINGER LAKES", "EASTERN LAKE ONTARIO REGION" );
my @rword =

 "NOWBUF","NYZ","NATIONAL WEATHER SERVICE BUFFALO NY","SHORT TERM
FORECASTS",".NOW...");

# Where the HTML file is, containing the weather data

    $stuff =&HTTPGet ("/iwin/ny/shortterm.html",$iwin_url);

#The following syntax may be incorrect for this code... Not sure...

open STUFF, $stuff or die "Cannot open $stuff for read :$!";

while (<STUFF>)


 foreach $excite
cite){  
  $excite = (lc($excite))
 }   # Make all lowercase in array

 foreach $excite (@excite){  
  $excite = (ucfirst($exci
te))
 }   # Make all first words capitolized.



 # remove unwanted words from the keyword search
 foreach $rword(@rword)

  $stuff = ~s/$rword//ig;
 }

# Search out matches of keywords, and make big, and yellow

 foreach $replace_word (@replace_word)

 $stuff = ~s/$replace_word/<bold><font face=Times Roman color=yellow
size=5>$replace_word<\/b><\/font><BR>/i;
 }

# Search out matches of keywords, and make red, and italic

 foreach $excite (@excite) {
  $stuff = ~s/$excite/<bold><font face=verdana size=4
color=red>$excite<\/b><\/font>/i;
 }

# print the buffer to the screen
print "$_<br>";

}

print "<\/blockquote>";
print "<a href=/weather/localtext.htm><CENTER>Go back</CENTER></a>";


#End of script






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

Date: 9 Sep 1998 14:07:18 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: Importing/Reading remote HTML files with perl...
Message-Id: <slrn6vd3c7.pjo.randy@theory.uwinnipeg.ca>

On Wed, 9 Sep 1998 08:53:37 -0400, 
Hawkwynd <Hawkwynd_remove_this_part@_remove_this_part_adelphia.net> wrote:
>I've come onto a snag in my programming, one that has me completely stumped.
>I am trying to import a file from a web site, (noaa.gov) which has weather
>information, in HTML format. Crude, but still has tags. I want to be able to
>use the text contained in it, and reformat it for use with my web site.

[snip]

Hi,
  You may want to check out the module Geo::WeatherNOAA, available from
http://www.perl.com/CPAN/authors/id/MSOLOMON/Geo-WeatherNOAA-3.09.tar.gz,
which retrieves and organizes exactly this information.

-- 
		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: Wed, 9 Sep 1998 14:50:34 +0200
From: "bubblesplit" <bubblesplit@pc.vom>
Subject: IRR Function needed
Message-Id: <35f6963a.0@news.ip.pt>


bubblesplit wrote in message ...
    From Pedro Cordeiro
    HI , I,m writing a credit simulation script and i need a IRR function.
        Help me please is URGENT.

        Pedro.Cordeiro@publicis.pt






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

Date: Wed, 09 Sep 1998 09:45:27 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Is perl millennium compliant ?
Message-Id: <fl_aggie-0909980945270001@aggie.coaps.fsu.edu>

In article <ejsos6.jk.ln@metronet.com>, tadmc@metronet.com (Tad McClellan)
wrote:

+    Try Visual Basic instead.

You're an evil man, Tad. Not quite Gatesian, but getting there...

James


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

Date: Wed, 09 Sep 1998 15:46:31 +0200
From: "Ir. Marc W.F. Meurrens" <meurrens@ulb.ac.be>
Subject: JAVA+REGEX Regular Expressions in Java - Web Page Updated
Message-Id: <35F686B6.80BD1B92@ulb.ac.be>

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

http://Meurrens.ML.org/ip-Links/java/regex

After our new page on "Java+Regex" (and some Perl flavours...)
was launched yesterday, we received many comments.
Thanks for your inputs.
This page has thus been updated to reflect currently:
--- additional Regular Expressions and Perl references
--- 10 "Java+Regex" packages, with a.o. ...
--- The very last version (1.3.1 - September 1998) of Steven Brandt's
package
      (including also the version for JDK 1.2 beta).
Btw, a powerfull URL-Mind facility has been added to the page.

Enjoy!

http://Meurrens.ML.org/ip-Links/java/regex ("Java+Regex")

Visit also:
http://Meurrens.ML.org/ip-Links/java/joodcs  (coding standards)
http://Meurrens.ML.org/ip-Links/java/codeEngineering (bytecode & reverse
engineering)


--------------5973CC11F4BD150490D3565E
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Marc Meurrens
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Marc Meurrens
n:              Meurrens;Marc
org:            Universiti Libre de Bruxelles
adr:            pl. A. Leemans, 2 / 4;;(+32-2-537.2812);Brussels;;B-1050;BELGIUM
email;internet: meurrens@ulb.ac.be
title:          inginieur civil A.Ir.Br.
tel;work:       +32-2-555.4054
tel;fax:        +32-2-537.7645
tel;home:       +32-75-46.2812
note;quoted-printable:Professor of Computer Sciences @ National School of Architecture (La Camb=
	re)=0D=0A=
	Computer Expert @ Public Health School (ULB)=0D=0A=
	Consultant @ Computer Graphics & Scientific Applications scrl=0D=0A=
	Secretary of BeJUG (Belgian Java User Group)
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------5973CC11F4BD150490D3565E--



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

Date: 9 Sep 1998 13:15:24 GMT
From: stephanj@sci.kun.nl (Stephan Jager)
Subject: local mail deliviry?
Message-Id: <6t5v1c$9qf$1@wnnews.sci.kun.nl>

Hello,

I'm trying to make some kinda filter with perl, but I have some kinda
problem. When I normally try to send an email to an user, I use
open S "/usr/lib/sentmail -t", that generally works perfectly

But now I have a problem, I have a .forward, and what I want to do is send
an email to myself (at the same machine), without the .forward be-ing used.
since I couldn't find out how to do such a thing with sendmail, I made
something that adds the email to my own mailbox (its a good email, since the
perl script -> the forward :).
but catting an email to my /var/spool/mail/username gives problems (mostly
with pine and mh, not with elm)
I do honour the lock file, but still, I get problems. Is there
some more better, "legal" way to save messages to a /var/spool/mail/mailbox
??

Stephan
(right now, I'm using this code fragment to do the job:

sub normalmail {
  while (-e "/var/spool/mail/$username.lock") {};
  open T, ">/var/spool/mail/$username.lock" || die "can't write lock";
  chmod 666, "/var/spool/mail/$username.lock";
  if (-e "/var/spool/mail/$username" && -s "/var/spool/mail/$username") {
    open S,">>/var/spool/mail/$username" || die "no mailbox?";
    print S "\n";
  } else {
    open S,">/var/spool/mail/$username" || die "no mailbox?";
  }  
  print S @lines;
  close S;
  unlink ("/var/spool/mail/$username.lock");
  exit;
}


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

Date: Wed, 09 Sep 1998 13:54:39 GMT
From: dave@mag-sol.com
Subject: Re: Looking for a programm in Perl!:=)
Message-Id: <6t61av$59u$1@nnrp1.dejanews.com>

In article <35F63EAE.5F45E58D@wanadoo.fr>,
  Plate Forme Jeunes Diplomes <plateforme@wanadoo.fr> wrote:
>     Hello,
>
>     I am looking for a script which is very simple :
>
>     - it must extract  two character string which are between two words,
> (the script must scan all the file ( the string are repetited!)
>     - it must put the variables a new file and save this file.
>
>     If you have ever made this soft or know how can I do, can you help
> me please?

I'm sure that most of us here would be very happy to help you write this
script. Why don't you post what you have written already and tell us why it
doesn't do what you want.

Dave...

--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 09 Sep 1998 16:16:56 +0200
From: Plate Forme Jeunes Diplomes <plateforme@wanadoo.fr>
Subject: Re: Looking for a programm in Perl!:=)
Message-Id: <35F68DD8.2F355C2B@wanadoo.fr>

    That is that I have ever wrote, and now, I can't do anything.

    The loop doesn't work.

    The searchnig string doesn't work.

    The print doesn't work...

    I am going to be mad!!!

    Fred

    #!/usr/bin/perl
open (FILE,"/win95/Perl/dr129a.htm") or die ("Impossible de trouver le fichier
: $!");
while (<FILE>) {
chomp;
$offre=$1 if ~m/(Offre.*?X)/s;
$date=$1 if ~m/(Date.*?98)/s;
$Ale=$1 if  ~m/(Ale.*?TD)/s;
$duree=$1 if ~m/(Recherche.*?FONT)/s;
$descriptif= $1 if ~m/(CENTER.*?FONT)/s;
$lieu=$1 if ~m/(Lieu.*?FONT)/s;
$horaires =$1 if ~m/(Horaires.*?FONT)/s
}
 close (FILE)
  print $offre ;
  print $date ;
  print $Ale ;
  print $duree ;
  print $descriptif;
  print $lieu ;

dave@mag-sol.com wrote:

>   Plate Forme Jeunes Diplomes <plateforme@wanadoo.fr> wrote:
> >     Hello,
> >
> >     I am looking for a script which is very simple :
> >
> >     - it must extract  two character string which are between two words,
> > (the script must scan all the file ( the string are repetited!)
> >     - it must put the variables a new file and save this file.
> >
> >     If you have ever made this soft or know how can I do, can you help
> > me please?
>
> I'm sure that most of us here would be very happy to help you write this
> script. Why don't you post what you have written already and tell us why it
> doesn't do what you want.
>
> Dave...
>



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

Date: Wed, 09 Sep 1998 09:02:11 -0400
From: Alan Starbard <pstarbard@nrgn.com>
Subject: Manpage Wrapper
Message-Id: <35F67C53.18B30AEA@nrgn.com>

A few years ago I remember downloading a script that would strip tagged
lines from a perl script and generate a man page automatically.  I think
it was called "wrapman" or something like that.  I have since switched
jobs and the scipt was lost in the process.  If anyone has heard of it
or anything like it please let me know where I can find it.

Any help is greatly appreciated.

--
Alan Starbard
Neurogen Corporation
pstarbard@nrgn.com




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

Date: Wed, 09 Sep 1998 09:09:41 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Manpage Wrapper
Message-Id: <35F68C25.18D73E45@gpu.srv.ualberta.ca>

Alan Starbard wrote:
> 
> A few years ago I remember downloading a script that would strip tagged
> lines from a perl script and generate a man page automatically.  I think
> it was called "wrapman" or something like that.  I have since switched
> jobs and the scipt was lost in the process.  If anyone has heard of it
> or anything like it please let me know where I can find it.
> 

current perls use pod for embedded manpages, but if you need the old
program it was in chapter 6 of the 1st ed. Camel 
wrapman - page 319
wrapinst - page 322

All the chapter 6 scripts are still available on CPAN under:
CPAN//scripts/nutshell/ch6/

hope that helps
regards
andrew


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

Date: 9 Sep 1998 12:00:24 GMT
From: roberto@toutatis.net (Roberto)
Subject: Re: Perl Programmer Needed
Message-Id: <roberto-ya02408000R0909981401230001@news.euronet.nl>

In article <905336720.60737@thrush.omix.com>, Zenin <zenin@bawdycaste.org>
wrote:

>         You could keep on posting job listings all the time, likely with
>         little or no tangible reprocussions.  We would hope however, that
                                                ^^
>         you would have the respect for USENET that we do, and refrain from
                                                     ^^
>         such actions.  But yes, if it got bad enough there are actions that
>         can and would be taken.

Just for the record: I don't do job postings, nor do I plan to do any in
the near future. I just don't mind at all seeing them here. But who is
"we"? By which organization am I addressed here? The Fat People? The Usenet
Community? Excuse me, but I am part of the latter, and I do not remember
having authorized you to speak in my behalf.

-- 
Roberto Bourgonjen,
roberto@toutatis.net


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

Date: 08 Sep 1998 22:49:04 -0500
From: "Jim Woodgate" <jdw@dev.tivoli.com>
Subject: Re: Perl Programmer Needed
Message-Id: <obbtoqeyj3.fsf@alder.dev.tivoli.com>


"Richard" <Richard@WowMe.com> writes:
> 4) Within an hour of me posting this, someone posted a message stating they
> were trying to sell their O'Reilly Perl book.  Is this the wrong place to do
> that?  Do you plan on educating them too?

and to think when this whole thread started I almost replied, "what's
next, selling books just because they're about Perl?" :)

my 2 cents (since people seem to be keeping score :), as long as I've
been reading news (not even a decade), the tech discussion groups have
always been no job postings/for sale/etc.  Many groups will allow the
*.announce for commercial products, I haven't looked at the charter
for cpla to see if they accept those types of posts.  Me personally,
I'd prefer to not see them here, but never complain, as I have a
threaded news reader and since you had a nice subject, I didn't need
to read it if I didn't want to.  There are job newsgroups, and I
believe www.tpj.com has a service for matching up projects like yours
to programmers, and I'd have to guess there are tons of other web
resources to handle this also.  If I want to buy a used book over the
internet, I'd prefer to look in the *.forsale newsgroups...

Something to think about.  If job postings/solicitations were welcomed
in this news group, considering many of the participants run their own
consulting companies, write books, etc, there could easily be an
additional 30-50 posts a week of bots posting "Use xxxx's Consulting
Company", "You like my posts?  Buy my book!", etc. which IMHO wouldn't
be such a great thing...

As for Randals original reply, it certainly wasn't sugar coated, but I
personally didn't read any flameage into it (esp not directed at you
or your company).  I didn't see it as a "knock" or "embarrassment"
directed at you, but rather as a, "hey guys, over the last month or so
there have been a lot of job postings here, they're not supposed to be
here".  IMHO of course.  Obviously, you took it a different way, but
if what really bothered you was that others in the forum would take
the original reply as a slam against you, I for one didn't see it that
way at all...

later...

-- 
Jim Woodgate 
Tivoli Systems
E-Mail: jdw@dev.tivoli.com


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

Date: 9 Sep 1998 14:32:20 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Perl Programmer Needed
Message-Id: <6t63hk$ona$2@info.uah.edu>

In article <9gfJ1.2798$JW5.8411615@news.rdc1.md.home.com>,
	"Richard" <Richard@WowMe.com> writes:
: There really IS NO
: WHERE ELSE for them to go and look for this type of work because the job
: newsgroups and other resources on the net are for full-time positions.

You know, if you'd checked DejaNews before you posted like you should
have, you would have come up with <URL:http://www.tpj.com/tpj/jobs/>
and this thread wouldn't have exploded.  Whether or not you help or
intend to help anyone is irrelevant.

Greg
-- 
A little poison now and then: that makes for pleasant dreams. And
much poison at the end for a pleasant death.
    -- Nietzsche


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

Date: Wed, 09 Sep 1998 13:51:18 GMT
From: jboes@my-dejanews.com
Subject: Re: Perl Source Needed
Message-Id: <6t614m$517$1@nnrp1.dejanews.com>

In article <35F430D9.29913E3B@lod.com>,
  Michael Hodge <mhodge@netcom.ca> wrote:

> I'm in search of good, Perl example

There's a lot of links to Perl scripts at www.cgi-resources.com, and another
great resource is
http://www.stars.com/Authoring/Languages/Perl/Resources.html.


--
Jeff Boes  jboes@qtm.net
http://www.qtm.net/~jboes/

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 09 Sep 1998 09:04:17 -0700
From: Art DeBuigny <debuigny@dallas.net>
To: Jonathan Stowe <Gellyfish@btinternet.com>
Subject: Re: Problem installing perl 5.004_04
Message-Id: <35F6A701.A29F31EB@dallas.net>

Yes.  That was the problem.

Thanks so much!!

Art DeBuigny
debuigny@dallas.net

Jonathan Stowe wrote:

> On Fri, 04 Sep 1998 14:57:21 -0700, Art DeBuigny wrote :
>
> >Greetings;
> >
> >I am having trouble installing perl 5.004_04 on AIX 4.1 using gcc
> >2.7.2.2
> >as my C compiler.
> >
> >Here is the error message I get when I run the make command.
> >
> >Writing Makefile for DynaLoader
> >mkdir ../../lib/auto/DynaLoader
> >The Unsupported function umask function is unimplemented at
> >../../lib/ExtUtils/Install.pm line 247.
> >make: 1254-004 The error code from the last command is 2.
> >
> >make 1254-004 The error code from the last command is 2.
> >
> A quick glimpse at Extutils::Install.pm seems to indicate that the
> only platform that is not supposed to support umask() is VMS.
>
> It might be that Configure incorrectly guessed whether umask() was
> available on your system.  Have a look at config.sh and see what it
> says about umask (there will be a line like "d_umask='') if you think
> it is wrong then edit it and run Configure -S to remake all the
> Makefiles and so on then "make depend" "make" etc.  Alternatively if
> you are unsure about this then you could just do "make distclean"
> (remove config.sh if it is still there) and start again - this time
> paying special attention to what it is being said when it checks what
> library functions are available.
>
> /J\
> --
> Jonathan Stowe
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>





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

Date: 09 Sep 1998 15:10:17 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: newsgrp@business-heaven.com
Subject: Re: regexp teaser
Message-Id: <m3r9xlzb2e.fsf@joshua.panix.com>

newsgrp@business-heaven.com writes:

> unless(open(HTMLDOC, "<$htmldoc")) {
> 		print "Can't open $htmldoc for input: $!";
> 		exit;
> 	}

It's more pithy (and more common) to say

  open(FOO,"<bar") or die "Can't open bar for read: $!";

> @HTMLLINES=<HTMLDOC>;

It looks to me like you'd rather read the text into a scalar.

  $html_lines = do { local $/; <HTMLDOC> };

> <meta name=keywords content="Keyword1 Keyword2 Keyword3">
> What is the most efficient regexp to tokenize the keywords?

As has been said many, many times before in this very newsgroup,
regexes are the wrong tool for the job of parsing HTML.  You need to
use a real parser.  That's what the HTML::Parser module is for.
You'll find it at the CPAN.

Once you've found the content of the keywords meta, just use split()
to extract the keywords.

  #!/usr/bin/perl -w
  package KeywordSniffer;
  use HTML::Parser;
  use base 'HTML::Parser';
  sub start {
    my ($self, $tag, $attr, $attrseq, $origtext) = @_;
    return unless $tag eq 'meta' && $attr->{name} eq 'keywords';
    my @keywords = split ' ', $attr->{content};
    $self->{_keywords} = \@keywords;
  }
  sub keywords { wantarray ? @{$_[0]->keywords} : $_[0]->{_keywords} }

  package main;
  my $chunk = 
    '<html><meta name=keywords content="Keyword1 Keyword2 Keyword3"></html>';
  my $p = KeywordSniffer->new;
  $p->parse($chunk);
  print join("\n", $p->keywords), "\n";

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Wed, 09 Sep 1998 15:45:19 +0200
From: Koos Pol <koos_pol@nl.compuware.com>
Subject: Soap Series, or is it...
Message-Id: <35F6866E.3189@nl.compuware.com>

Sometimes a few days of unread clpm is just like viewing a soap series.
And I really enjoy it :-)
It's not all Perl which makes the world go round. :-)

-- 
Koos Pol
----------------------------------------------------------------------
S.C. Pol                          T: +31 20 3116122
Systems Administrator             F: +31 20 3116200
Compuware Europe B.V.             E: Koos_Pol@nl.compuware.com
Amsterdam                         PGP public key available


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

Date: 09 Sep 1998 07:42:42 -0500
From: "Jim Woodgate" <jdw@dev.tivoli.com>
Subject: Re: String to Binary
Message-Id: <ob3ea1o3st.fsf@alder.dev.tivoli.com>


dchen <dchen@aludra.usc.edu> writes:
> I have tried Mr. Larry Rosler's perl line and it works (except parentheses
> needed around pack and unpack).

you might want to get a copy of perl 5, the parentheses aren't needed
for newer versions of perl...

-- 
Jim Woodgate 
Tivoli Systems
E-Mail: jdw@dev.tivoli.com


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

Date: 9 Sep 1998 14:44:57 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: String to Binary
Message-Id: <6t6499$2cm@news-central.tiac.net>

In article <ob3ea1o3st.fsf@alder.dev.tivoli.com>,
Jim Woodgate <jdw@dev.tivoli.com> wrote:

>dchen <dchen@aludra.usc.edu> writes:
>> I have tried Mr. Larry Rosler's perl line and it works (except parentheses
>> needed around pack and unpack).
>
>you might want to get a copy of perl 5, the parentheses aren't needed
>for newer versions of perl...

Although they're not needed you might think of maintainers in the future.
Most whitespace in many perl programs isn't needed but is considered a
good thing as it is frequently used to indent the code to reflect its
logical structure.  Maybe a human needed the parentheses...

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Wed, 9 Sep 1998 07:37:19 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Truncation problem when appending arrays in Perl
Message-Id: <vps5t6.b26.ln@metronet.com>

Darren Hayes (darrenh@efn.org) wrote:

: I have two arrays, 


   You have two hashes.

   Or two associative arrays.

   Plain arrays start with the '@' character.


: one %form_data, the other %form_data2 which 
: I am appending with the command:

: %form_data = (%form_data, %form_data2);

: However I find that the data originating from %form_data fields is 
: truncated at the point where the first space character appears in 
: the data. But all data from %form_data2 shows up in the resulting 
: array fine (including full sentences with spaces, etc).

: Any suggestions on keeping truncation from occurring? Thanks.


   I suggest that you post a complete and short example that exhibits
   the behavior you want to discuss.

   The one I made below seems to work fine...



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

%form_data = ( 'key one' => 'value one',
               'key two' => 'value two'
             );

%form_data2 = ( 'key2 one' => 'value2 one',
                'key2 two' => 'value2 two'
              );

%form_data = (%form_data, %form_data2);

foreach (sort keys %form_data) {
   print "$_ ==> $form_data{$_}\n";
}
------------------


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


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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